Photography Website
Website is a fullstack application using fastify and @fastify/vite to do
server side rendering where needed. The purpose of creating it as a full stack
application was because of the end user experience desired for adding images to
this website. The desired experience was simple to upload an image to a cloud
location and for the image to just appear on refresh of the site. The website
is built within DigitalOcean AppPlatform and the images are stored in a
DigitalOcean Space (think AWS S3 bucket). Since we would need to read from the
bucket each time the page loads, which would require an API key, service side
rendering would be preferred to keep these secret values away from any client;
hence fullstack application.
Note
You will need a properly configured .env file in order to run all the
commands below.
- Clone the repository locally
nvm usein the directory to gain the correct version ofnodeandnpmnpm installto install dependencies- Run the
npm run devscript to run the development server
| Name | Description |
|---|---|
| PORT | Port value the server will listen on when run. Defaults to 3002. |
| DO_SPACE_ACCESS_KEY_ID | The DigitalOcean access key ID for the Space provisioned. |
| DO_SPACE_SECRET_KEY | The DigitalOcean secret key for the Space provisioned. |
| DO_SPACE_BUCKET | The name of the DigitalOcean Space provisioned. |
Note
Run steps 1. through 3. above
- Run the
npm run previewscript to generate a production server
Important
There is no hot reloading with this experience.