-
Create project from template
pnpm create next-app@latest my-project --example https://github.com/byrmch/nextjs-fast-start cd my-project -
Set up environment variables
cp .env.example .env node -e "const{randomBytes}=require('crypto'),{readFileSync,writeFileSync}=require('fs'),e=readFileSync('.env','utf8');writeFileSync('.env',e.replace('your-secret-at-least-32-chars',randomBytes(32).toString('base64')))"Copies
.env.example→.env, then auto-generates a secureBETTER_AUTH_SECRETand writes it in. -
Generate Prisma client
npx prisma generate
Generates the typed database client from
prisma/schema.prisma. -
Initialize database
npx prisma db push
Pushes the Prisma schema to SQLite — creates all tables.
-
Seed test user
npx prisma db seed
Creates a test account:
test@example.com/12345678. -
Start dev server
pnpm dev
Open http://localhost:3000 — the homepage runs a self-check for all modules.
| Auth | Better Auth v1.6, email/password sign-up & sign-in |
| Database | Prisma v7 + SQLite, zero config |
| AI | Vercel AI SDK v7 + DeepSeek |
| UI | Tailwind CSS v4 + shadcn/ui, dark mode follows system |
| Unified Response | { code, data, msg } + success() / fail() |
| Error Handling | AppError + withErrorHandler, zero try/catch |
| Proxy | Auth guard + request logging + response time header |
| Env Validation | Zod schema, validated at startup |
| Security Headers | CSP / X-Frame-Options / Referrer-Policy |
| Category | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript 5 |
| Styling | Tailwind CSS 4 |
| Components | shadcn/ui |
| ORM | Prisma 7 + SQLite |
| Auth | Better Auth 1.6 |
| AI | Vercel AI SDK 7 + DeepSeek |
cp .env.example .env| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
SQLite file path | file:./dev.db |
BETTER_AUTH_SECRET |
Auth secret (≥32 chars) | - |
BETTER_AUTH_URL |
App URL | http://localhost:3000 |
AI_MODEL |
AI model name | deepseek-v4-flash |
DEEPSEEK_API_KEY |
DeepSeek API key | - |
| Command | Description |
|---|---|
pnpm dev |
Start dev server |
pnpm build |
Production build |
pnpm lint |
ESLint check |
npx prisma db push |
Database initialization |
npx prisma db seed |
Seed test user |
src/
├── core/ # Pluggable feature modules
│ ├── ai/ # AI API wrapper
│ ├── auth/ # Better Auth config
│ ├── db/ # Prisma client
│ └── response/ # Unified response + error codes
├── config/env.ts # Env validation
├── proxy.ts # Auth guard + request logging
├── lib/utils.ts # cn() utility
├── components/
│ ├── ui/ # shadcn/ui components
│ └── layout/ # Navbar
├── app/
│ ├── page.tsx # Self-check homepage
│ ├── layout.tsx # Root layout
│ ├── error.tsx # Error boundary
│ └── api/ # API routes
prisma/
├── schema.prisma # Data models
├── migrations/
└── seed.ts
MIT © byrmch