An saas boilerplate app built using TypeScript, PostgreSQL, NextAuth and PgTyped.
You will need:
- Node v16+
- Docker
- First, install dependencies using
pnpm install
- Copy .env.example to .env and replace the missing variables.
- Next, run docker-compose to set up your local database
- Third, install dbmate (https://github.com/amacneil/dbmate) and run
dbmate migrate
to get your local database migrated and ready for use - Now, run the app server using
pnpm dev
- Open http://localhost:3000 with your browser to see the result.
We use two packages for managing our postgresql database.
- DBMate (https://github.com/amacneil/dbmate) - is used to manage our migrations files & migrating the database with them. It has various cli cmds you can leverage to migrate your local db.
- PGTyped (https://pgtyped.dev/docs/getting-started) - we use to create typed queries from raw SQL queries. These raw & compiled queries can be found in ./src/db/queries