Quick start

From clone to running dev server in under 60 seconds.

Prerequisites

  • Node.js 18.17 or later
  • npm, yarn, or pnpm
  • A Resend account (free tier works)
  • An Upstash Redis database (free tier works)
  • Your chosen database credentials (MongoDB Atlas / Supabase / Firebase)

1. Clone the repo

terminal
git clone https://github.com/Talhaahmad9/nextforge.git my-project
cd my-project

2. Choose your database

Run the interactive setup script. This is a one-time operation.

terminal
node setup.mjs

The script presents:

terminal
┌──────────────────────────────────────────┐
│        NextForge - Database Setup        │
└──────────────────────────────────────────┘

Which database backend do you want to use?
  1) MongoDB (Mongoose)
  2) Supabase (PostgreSQL)
  3) Firebase (Firestore)

Enter 1, 2, or 3: _

The script will:

  • Copy the correct database files into place
  • Remove unused variant dependencies from package.json
  • Generate a .env.local.example with only the env vars you need
  • Delete _variants/ and setup.mjs itself - leaving a clean standard Next.js project

3. Install dependencies

terminal
npm install

4. Configure environment variables

terminal
cp .env.local.example .env.local

Open .env.local and fill in your values. See the Environment variables reference for the complete list.

Generate AUTH_SECRET with:

terminal
openssl rand -base64 32

5. Supabase only - run the schema

Skip this section if you chose MongoDB or Firebase.

  • Open your Supabase project dashboard
  • Navigate to SQL Editor
  • Paste the contents of lib/db/schema.sql
  • Click Run

6. Start the dev server

terminal
npm run dev

Open http://localhost:3000. The /register, /login, /verify-email, /forgot-password, and /reset-password routes are all live.

Next steps

Continue learning