Next version (pun intended) website for the painter and my mom, Heli Kuparinen!
As the last paragraph suggests, this site is created using Next.js, for better SEO than the old CRApp! Easier content management is achieved through Contentful!
The site is deployed at https://helikuparinen.fi!
You will need Node.js v22.12+ and pnpm installed.
To install pnpm (if you don't have it already):
corepack enable
corepack prepare pnpm@latest --activateBefore starting to dev, you need to define an .env.local file on the project root.
Inside:
SPACE_ID=... # contentful space id token and...
ACCESS_TOKEN=... # access token and...
PREVIEW_ACCESS_TOKEN=... # preview token (not necessary for dev)
# + email info for nodemailer form
EMAILUSER=user@email.com
EMAILPASS=super_secretPaSsword666
TO=recipient@email.com
NEXT_PUBLIC_GOOGLE_ANALYTICS=G-SOMETHINGAsk those from me (if for some reason I would need to give these out) or use your own Contentful tokens and IDs and email info.
More about Next apps here!
# install dependencies
pnpm install
# start dev server localhost:3000
pnpm dev
# build production ready code
pnpm build
# start production server localhost:3000
pnpm start
# lint the code with eslint (and fix automatically fixable errors)
pnpm lint -- --fix
# for server
# production ~/helikuparinen.fi
pnpm build
pm2 start pnpm --name "prod" -- start
# beta in ~/beta.helikuparinen.fi
pnpm build
pm2 start pnpm --name "beta" -- start -- --port 8080
# nginx
# test that you have configured your nginx files correctly
sudo nginx -t
# restart nginx so that changes take effect
sudo systemctl restart nginxRun the following command with the Contentful variables required for static generation:
docker build \
--build-arg SPACE_ID=<here> \
--build-arg ACCESS_TOKEN=<here> \
--build-arg PREVIEW_ACCESS_TOKEN=<here> \
--build-arg NEXT_PUBLIC_GOOGLE_ANALYTICS=<analytics tag here> \
-t helikuparinen.fi .Pass email credentials at runtime instead of baking them into the image:
docker run \
-p 3000:3000 \
-e EMAILUSER=<here> \
-e EMAILPASS=<here> \
-e TO=<here> \
helikuparinen.fiI have done some documenting for this project, mainly for my future self and Heli, but any other curious fella can take a look 🙂