A Typescript boilerplate web project using Next.js (App Router) and Tailwind, and Postgres. User authentication (username/password) has been set up using NextAuth.js.
This boilerplate contains:
- 🔑 User auth and session management using NextAuth.js
- 👪 ORM using Prisma
- 📄 A user signup page, sign in page, and user list page using React, Tailwind, and Daisy UI
- 🌍 State management using Redux RTK query
- ✅ CI/CD using Github Actions
- 💻 E2E testing using Cypress
- 🤡 Unit testing using Jest
Note that SSR is not included in this boilerplate as it is not really applicable user authentication (which uses redux to update state). Feel free to add SSR to your own pages though!
# next-auth
SECRET=<anything>
# database
POSTGRES_HOSTNAME=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOSTNAME}:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public
- Run the following in the root directory
npm run install
npm migrate
- For automatic tagging, allow read and write permissions for workflows in your github repo's Settings > Actions > General > Workflow permissions section.
The following command will containerize, build, and start the database, backend, and frontend
npm run up
npm run dev
- Sign up and create a project on supabase.
- Create a public storage bucket and add
SUPABASE_BUCKET
to the.env
above - Add a policy to your bucket that allows
SELECT
,INSERT
,UPDATE
, andDELETE
. - From Settings > API, add your URL and anon/public API keys to the
.env
asSUPABASE_URL
andSUPABASE_ANON_KEY
.