Installation
Step-by-step guide to installing and setting up the Next.js 16 Starter Kit on your local machine.
Installation
This guide walks you through installing the Next.js 16 Starter Kit and configuring your development environment.
System Requirements
| Requirement | Version | Notes |
|---|---|---|
| Node.js | 18.x or higher | LTS recommended |
| Bun | 1.0+ | Preferred package manager |
| PostgreSQL | 14+ | Local or cloud instance |
| Git | 2.x+ | For version control |
:::info While Node.js works fine, we recommend using Bun for faster installs and better monorepo support. :::
Step 1: Clone the Repository
# Clone the monorepo
git clone <your-repository-url>
cd nextjs16-starter-kitStep 2: Install Dependencies
Using Bun (recommended):
bun installUsing npm:
npm installStep 3: Environment Configuration
Create your environment file:
cp .env.example .env.localEdit .env.local and configure the required variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
# Authentication (choose your provider)
AUTH_PROVIDER="better-auth" # or "clerk", "next-auth"
AUTH_SECRET="your-secret-key"
# AWS (for email infrastructure)
AWS_REGION="us-east-1"
AWS_ACCESS_KEY_ID="your-access-key"
AWS_SECRET_ACCESS_KEY="your-secret-key"
# Stripe (for billing)
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."Step 4: Database Setup
Generate and run migrations:
# Generate Drizzle migrations
bun run db:generate
# Run migrations
bun run db:migrate
# (Optional) Seed the database
bun run db:seed:::warning
The db:push command is for development only and can overwrite data. Always use db:migrate for production.
:::
Step 5: Start Development Server
# Start with Turbo TUI
bun run devYour application will be available at http://localhost:3000.
Verification
After starting the server, verify everything works:
- Open
http://localhost:3000- You should see the homepage - Check
http://localhost:3000/api/health- Should return status 200 - Open Drizzle Studio:
bun run db:studio
Common Issues
Port Already in Use
# Kill process on port 3000
lsof -ti:3000 | xargs kill -9Database Connection Failed
- Verify PostgreSQL is running
- Check
DATABASE_URLformat - Ensure database exists:
createdb dbname
Missing Environment Variables
The app will warn about missing required variables on startup. Check the Environment Variables reference for the full list.