Get Started
Clone, configure, and run your dev server in under 5 minutes.
Watch the walkthrough video above for a full demo of the setup process, or follow the steps below.
Prerequisites
- Node.js 20+
- Docker, for running PostgreSQL locally
- Google OAuth credentials, for social login
1. Clone and Install
git clone <your-repo-url> my-app
cd my-app
pnpm install2. Set Up Environment
cp .env.example .envMost defaults in .env.example work for local development. You only need to fill in a few values to get running.
Generate the auth secret
pnpm dlx @better-auth/cli secretPaste the output into BETTER_AUTH_SECRET in your .env file.
Add Google OAuth keys
Go to the Google Cloud Console, create an OAuth 2.0 client, and paste the values:
GOOGLE_CLIENT_ID="your-client-id"
GOOGLE_CLIENT_SECRET="your-client-secret"Minimum required config
The database URL, app URLs, and other defaults are pre-configured for local development. Configure the remaining services later:
| Service | What it powers | Guide |
|---|---|---|
| Stripe | Subscription billing | Billing |
| SMTP2Go | Transactional email | |
| Cloudflare R2 | File uploads and avatars | File Uploads |
| reCAPTCHA v3 | Bot protection (optional) | reCAPTCHA |
Each service has a dedicated guide with a video walkthrough.
3. Start the Database
docker-compose up -dStarts PostgreSQL on port 5432 with credentials matching the default DATABASE_URL.
4. Run Migrations
pnpm prisma migrate devCreates the user, session, account, verification, and subscription tables.
To reset the database at any time:
docker-compose down -v && docker-compose up -d && pnpm prisma migrate dev5. Start the Dev Server
pnpm devOpen http://localhost:3000.
What You Should See
| Route | Page |
|---|---|
/ | Marketing landing page |
/auth/register | Registration |
/auth/sign-in | Sign in |
/dashboard | User dashboard (requires sign in) |
Create an account at /auth/register. To make yourself an admin, update the role field in the user table to "admin".
Next Steps
- Read the overview to understand what each module does
- Set up Stripe to enable subscription billing
- Review the project structure to see where things live
Introduction
Next Starter is a Next.js 16 SaaS boilerplate with authentication, Stripe billing, PostgreSQL, file storage, email, and an admin dashboard. Pre-configured and ready to deploy.
Project Structure
A reference for the Next Starter directory layout, every folder, key file, and the conventions that keep the codebase consistent as it grows.