Quick Start
Quick Start
Requirements
| Tool | Version | Notes |
|---|---|---|
| Node.js | 24.x | The generator and project target Node 24 |
| pnpm | 10.x | The workspace and lockfile use pnpm |
| PostgreSQL | 14+ | Local PostgreSQL, Neon, or another compatible service |
Generate a project
For a conventional SaaS app:
pnpm dlx create-nextdevtpl@latest my-app --preset saas --target vercel
cd my-app
For auth and a dashboard only:
pnpm dlx create-nextdevtpl@latest my-app --preset minimal
For the operations kit:
pnpm dlx create-nextdevtpl@latest my-ops \
--preset custom \
--modules auth,analytics,operations \
--payment stripe \
--alerts webhook \
--analytics posthog
See Generator and Presets for all three official presets and custom flags.
Inspect the generated selection
Get-Content nextdevtpl.generated.json
It records the effective modules, adapters, and target. Configure only the capabilities listed there.
Configure environment variables
Copy-Item .env.example .env.local
On macOS or Linux:
cp .env.example .env.local
A basic boot needs:
DATABASE_URL="postgresql://postgres:password@localhost:5432/nextdevtpl"
BETTER_AUTH_SECRET="replace-with-a-long-random-secret"
BETTER_AUTH_URL="http://localhost:3000"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
The generated .env.example is selection-specific. Fill OAuth, payment, mail,
storage, AI, jobs, and rate limiting only when selected. See
Configuration for the variable map.
Initialize and run
For a new local database, push the schema and start the app:
pnpm db:push
pnpm dev
Open http://localhost:3000. Use migrations for shared and production
databases:
pnpm db:generate:init
pnpm db:migrate
Review generated SQL before committing migration files.
First verification
| Check | Expected result |
|---|---|
| Home | /en and /zh work when marketing is selected |
| Auth | An email/password user can reach /dashboard |
| Docs | /en/docs and /zh/docs work when marketing is selected |
| Health | /api/health returns HTTP 200 and healthy |
| Optional services | Verify only adapters listed in nextdevtpl.generated.json |
| Operations | When selected, sign in as an admin, open /admin/operations, then call the snapshot and alert cron routes with CRON_SECRET |
Before committing:
pnpm format
pnpm lint
pnpm typecheck
pnpm test:run
pnpm build
Continue with Deployment when preparing production.