Quick Start

Create a full-stack Igniter.js project in 2 minutes. Next.js starter, PostgreSQL database with Prisma, Better Auth, and your first generated feature — copy-paste ready.

Quick Start

This guide walks you from zero to a running Igniter.js project in under two minutes. You'll create a Next.js project with a PostgreSQL database, authentication, and a schema-generated feature — all from the terminal.

Install the CLI

npm install -g @igniter-js/cli
pnpm add -g @igniter-js/cli
yarn global add @igniter-js/cli
bun add -g @igniter-js/cli

Verify it works:

igniter --help
# Usage: igniter [options] [command]
# Commands:
#   init        Create a new Igniter.js project with interactive setup
#   generate    Scaffold new features or generate client schema
#   dev         Start development mode with automatic schema and docs regeneration

Create a Project

The init command creates a new project. You can answer interactive prompts or pass flags directly:

igniter init my-saas \
  --template nextjs \
  --add-ons database,auth \
  --database postgresql

This command:

  • Creates my-saas/ with a Next.js starter
  • Configures Prisma with a PostgreSQL provider
  • Wires Better Auth with default plugins
  • Sets up Docker Compose (PostgreSQL container)
  • Installs dependencies automatically
  • Initializes a Git repository

What happens under the hood: The CLI clones the Next.js starter template, applies add-on templates (database configuration, auth setup), merges environment variables into .env, adds Docker services to docker-compose.yml, updates package.json dependencies, and runs post-install hooks.

cd my-saas

Explore the Project Structure

Your project now has a complete Igniter.js structure:

prisma/schema.prisma
docker-compose.yml
.env
package.json

The example feature was scaffolded automatically. Every feature follows the same pattern: controllers (HTTP routes), procedures (business logic), and interfaces (TypeScript types).

Generate a Feature from Your Database Schema

Define a model in prisma/schema.prisma:

model User {
  id        String   @id @default(cuid())
  name      String
  email     String   @unique
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

Then generate the feature:

igniter generate feature users --schema prisma:User

This produces a complete feature with:

  • Controller — CRUD routes (GET /users, POST /users, etc.)
  • Procedure — type-safe business logic with Prisma queries
  • Interfaces — Zod-validated input/output types derived from the schema

The --schema flag uses the Prisma schema provider. It reads your schema.prisma, extracts the model definition, and generates controllers with typed Zod schemas matching your column types.

Start Development Mode

Run igniter dev to start your development server with automatic schema regeneration:

igniter dev --cmd "pnpm dev"

The dev command:

  • Starts your app's dev server via the --cmd flag
  • Watches src/igniter.router.ts and src/features/ for changes
  • Regenerates src/igniter.schema.ts (client schema) on every change
  • Regenerates src/docs/ (OpenAPI spec) on every change
  • Displays a split-pane TUI with Igniter logs and app logs

The file watcher uses a 300ms debounce to avoid rapid regeneration. It ignores node_modules, .git, dist, .next, .turbo, .cache, and test files.

Register Your Feature in the Router

Open src/igniter.router.ts and register the generated controller:

import { IgniterRouter } from '@igniter-js/core';
import { UsersController } from './features/users/controllers/users.controller';

export const igniterRouter = IgniterRouter.create()
  .addController(UsersController)
  .build();

The dev watcher detects the change and regenerates the schema automatically. Your new routes are now typed and available in the client.


✅ Success Checkpoint

You now have a project that:

  • Runs on Next.js with the Igniter.js framework
  • Has a PostgreSQL database configured via Prisma
  • Includes Better Auth for authentication
  • Has a schema-generated feature (users) with CRUD routes
  • Uses dev mode to auto-regenerate the client schema and OpenAPI docs
  • Can be started with a single command

What You Can Do Next

# Add more add-ons to an existing project
igniter init . --mode install --add-ons jobs,logging,telemetry

# Generate a caller from an external OpenAPI spec
igniter generate caller --name stripe --url https://api.stripe.com/openapi.json

# Generate only the OpenAPI docs
igniter generate docs

# Generate only the client schema
igniter generate schema

# Scaffold a new controller inside a feature
igniter generate controller profile --feature users

# Scaffold a new procedure
igniter generate procedure send-welcome-email --feature users

Next Steps