Quick Start

Quick Start

This guide starts the app locally with the smallest useful configuration.

Requirements

ToolVersionNotes
Node.js20+Required by Next.js and Inngest dependencies in this project
pnpm10+ recommendedThe lockfile is maintained with pnpm
PostgreSQL14+ recommendedLocal PostgreSQL, Neon, Supabase, or another compatible host

Install dependencies

git clone git@github.com:evepupil/NextDevTpl.git
cd NextDevTpl
pnpm install

Create environment file

cp .env.example .env.local

On Windows PowerShell:

Copy-Item .env.example .env.local

Minimal environment variables

Only these variables are required for a basic local boot:

DATABASE_URL="postgresql://postgres:password@localhost:5432/nextdevtpl"
BETTER_AUTH_SECRET="replace-with-a-random-secret"
BETTER_AUTH_URL="http://localhost:3000"

Generate a strong local secret with:

openssl rand -base64 32

OAuth, email, payments, storage, Redis, logging, monitoring, AI, and background jobs can be enabled later.

Initialize the database

For a new local database, push the current Drizzle schema:

pnpm db:push

Use migrations for shared or production databases:

pnpm db:generate
pnpm db:migrate

Start the dev server

pnpm dev

Open:

http://localhost:3000

The middleware will route you to the active locale, for example /en or /zh.

Verify the app

After startup, verify these flows:

CheckExpected result
Home pageMarketing page renders without missing translation errors
Sign upEmail/password account can be created
Sign inAuthenticated user reaches /dashboard
DashboardSidebar, settings, credits, and support links render
AdminUser with role = "admin" can access /admin
Docs/en/docs and /zh/docs show language-specific content

Common commands

pnpm dev            # Start Next.js dev server
pnpm build          # Create a production build
pnpm start          # Start production server
pnpm typecheck      # Run TypeScript type checking
pnpm lint           # Run Biome lint
pnpm check          # Run Biome check with fixes
pnpm db:push        # Push Drizzle schema in development
pnpm db:generate    # Generate migration files
pnpm db:migrate     # Run migrations
pnpm db:studio      # Open Drizzle Studio
pnpm test:run       # Run tests once

On this page