/light-n-locked

A light nextJS saas template with own auth management

Primary LanguageTypeScriptMIT LicenseMIT

Next.js SaaS Starter

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:

This template takes the original template by Robinson and replaces JWT tokens auth with session auth and adds 2fa for email/password auth.

Tech Stack

Getting Started

git clone https://github.com/ysqander/light-n-locked
cd light-n-locked
pnpm install

Running Locally

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.