This directory contains the source code of the CodebaseShow website.
The CodebaseShow website is a single-page application created with Layr. The frontend is statically hosted in AWS S3 + CloudFront and the backend is serverlessly hosted in AWS Lambda + API Gateway. Regarding the database, it is a free-tier MongoDB Atlas cluster with a daily backup that is handled by a Lambda function.
- Make sure your have a Node.js (v14 or newer) installed.
- Make sure you have Boostr installed as it is used to manage the development environment.
Install all the npm dependencies with the following command:
boostr install- Create a GitHub OAuth App with the following settings:
- Homepage URL:
http://localhost:15541 - Authorization callback URL:
http://localhost:15541/oauth/callback
- Homepage URL:
- Create a GitHub personal access token with no scopes selected.
- Generate a JWT secret by running the following command in your terminal:
openssl rand -hex 64
- In the
backenddirectory, duplicate theboostr.config.private-template.mjsfile, name itboostr.config.private.mjs, and modify it to set all the required private development environment variables.
Migrate the database with the following command:
boostr database migrateStart the development environment with the following command:
boostr start
The website should be available at http://localhost:15541.
- Create a GitHub OAuth App with the following settings:
- Homepage URL:
https://codebase.show - Authorization callback URL:
https://codebase.show/oauth/callback
- Homepage URL:
- Create a GitHub personal access token with no scopes selected.
- Generate a JWT secret by running the following command in your terminal:
openssl rand -hex 64
- In the
backenddirectory, duplicate theboostr.config.private-template.mjsfile, name itboostr.config.private.mjs, and modify it to set all the required private production environment variables. - In the
databasedirectory, duplicate theboostr.config.private-template.mjsfile, name itboostr.config.private.mjs, and modify it to set thestages.production.urlattribute to the URL of your production MongoDB database. - Create an AWS IAM role with the following settings:
- Trusted entity:
AWS service - Use case:
Lambda - Name:
codebaseshow-website-backend-prod - Permission policies:
- CloudWatchLogsFullAccess
- AmazonSESFullAccess
- Trusted entity:
Migrate the database with the following command:
boostr database migrate --productionDeploy the website to production with the following command:
boostr deploy --production
The website should be available at https://codebase.show.
Once a day, all CodebaseShow public data are automatically backed up to the following repository: