This is a sample for easily building a simple app (infrastructure) using Next.js and PostgreSQL on AWS with SST.
- sst
- Next.js
- PostgreSQL
- Drizzle ORM
- AWS
- Node.js (npm)
- sst
- Automatically installed with
npx sst ...
command
- Automatically installed with
npm i
sudo npx sst tunnel install
npx sst tunnel install
is a script that installs the network interface needed to tunnel to an RDS within a VPC. Therefore, sudo
is required.
First, create a tunnel.
npx sst tunnel
In another tab
npm run db generate
npm run db migrate
npm run sst:dev
You can view the output at http://localhost:3000. Additionally, you can use Drizzle Studio at https://local.drizzle.studio.
npx sst tunnel --stage production
In another tab
sudo npx sst shell drizzle-kit migrate --stage production
npm run sst:deploy