This a lightweight saas template with github oauth, email/password 2fa, postgres and stripe.
This combines the works of two excellent contributors to the dev community:
- Lee Robinson: who built the original template on which this one is based Next.js SaaS Starter
- Pilcrow: the author of the Lucia auth library and great learning materials on rolling your own auth. https://lucia-next.pages.dev/
This template takes the original template by Robinson and replaces JWT tokens auth with session auth and adds 2fa for email/password auth.
- Framework: Next.js
- Database: Postgres
- ORM: Drizzle
- Payments: Stripe
- UI Library: shadcn/ui
- Email: Resend
- Authentication: Roll your own
git clone https://github.com/ysqander/light-n-locked
cd light-n-locked
pnpm install
Use the included setup script to create your .env
file:
pnpm db:setup
Then, run the database migrations:
pnpm db:migrate
pnpm db:push
To use github oauth and Resend email you need to creae API keys for each service and set the following environment variables i nthe .env file:
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
RESEND_API_KEY=
To start the dev server run:
pnpm dev
Open http://localhost:3000 in your browser to see the app in action.