This is a simple budget friendly photo album. You can read more about my journey on this project in the following blog post - budget photo album using aws s3.
Project is created with:
To run this project, you will need the following:
- An AWS account.
- Follow the prerequisite tasks and CORS configuration from this AWS doc.
- Create a postgres database for this project, I've set it to
memories
you may name it whatever you want.
After completing the above and cloning the project, you can uncomment and update the environment variables accordingly in the .env
file.
JWT_SECRET_KEY="insert_secret"
# --- AWS ---
ALBUM_BUCKET_NAME="insert_bucket_name"
BUCKET_REGION="insert_bucket_region"
IDENTITY_POOL_ID="insert_identity_pool_id"
# --- Postgres ---
DATABASE_URL="postgres://postgres:postgres@localhost:5432/memories"
# --- For access to settings page ---
SECRET_PASSWORD="insert_secret_password"
Next, navigate to your project and run:
$ npm install
Next, run the migrationa to ensure that the DB is properly setup:
$ db-migrate up
Last but not least, we want to start the project!
$ nodemon app.js
You should see a message on your terminal saying STARTED APP ON PORT 8000
.
Go to your browser and type http://localhost:8000/
, you should see the Welcome page.
To create a user go to http://localhost:8000/settings
and enter your SECRET_PASSWORD
. You should now be able to log in and start creating albums and uploading photos to your S3 bucket.
Code released under the MIT license.