This is a simple example of using SST v3 and AWS service to host a simple social app
- The get started instruction assumes that you have docker install and setup and AWS CLI setup
- In this code, the database and the user token is hardcoded. In production environment, I would setup the db environment via AWS secret and the user token would be generated from user login (Ex. AWS cognito). We hardcoding it here to keep the project simple.
-
Clone the new repo.
-
Set the script files to be runnable.
chmod +x /scripts/migrateDB.sh chmod +x /scripts/startupDev.sh
-
Update your user token in /infra/web. Search for "NEXT_PUBLIC_API_TOKEN" and change it to the user id you want to create post as.
-
In a separate terminal, start the postgres database.
./scripts/startupDev.sh
-
In another separate terminal tab, start the migration script.
./scripts/migrateDB.sh
-
Deploy!
npm install npx sst dev