Local development runs both the Next.js web app and the Express API concurrently via Turborepo. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/paramveer-cyber/Deployaar/llms.txt
Use this file to discover all available pages before exploring further.
pnpm dev command at the repo root delegates to turbo dev, which starts all workspace packages in parallel with full hot-reload: tsx watch for the API (rebuilds TypeScript on save) and Next.js Fast Refresh for the web app. Both services share a single .env file sourced through dotenv-cli.
Prerequisites
Before starting, make sure you have the following available:- Node.js 18 or higher — enforced by the
enginesfield inpackage.json - pnpm 9.0.0 — install with
npm install -g pnpm@9; thepackageManagerfield pins this version exactly - A running PostgreSQL database — a local Docker container or a Neon development branch both work; set the connection string in
DATABASE_URL - A GitHub App with a webhook secret and a downloaded private key — needed for
GITHUB_APP_ID,GITHUB_APP_PRIVATE_KEY, andGITHUB_WEBHOOK_SECRET - At least one AI provider API key —
GOOGLE_GENERATIVE_AI_API_KEYis the recommended free-tier default; setDEFAULT_AI_PROVIDER=googleandDEFAULT_AI_MODELaccordingly - An E2B account and API key (
E2B_API_KEYandE2B_TEMPLATE_ID) — required for the coding agent to provision sandboxed execution environments
Setup Steps
Install dependencies
pnpm resolves all workspace packages (
apps/* and packages/*) in a single install:Configure environment variables
Copy the example env file into each app, then open both files and fill in every required secret:The
.env.example file at the repo root contains the minimal set of variables. See the Environment Variables reference for the complete list of required and optional keys.Generate and apply database migrations
Drizzle ORM manages the schema. Run This creates all required tables, including better-auth’s
db:generate first to produce migration SQL from the current schema files in packages/database/models/, then db:migrate to apply them to your database:verification table (migration 0001_icy_lyja.sql) — without it, Google and GitHub OAuth logins will fail with state_security_mismatch.Local URLs
Oncepnpm dev is running, all services are available at:
| Service | URL |
|---|---|
| Web app | http://localhost:3000 |
| API | http://localhost:8000 |
| API Docs (Scalar) | http://localhost:8000/docs |
| OpenAPI JSON | http://localhost:8000/openapi.json |
/docs provides an interactive API reference generated from the OpenAPI document and is useful for testing REST endpoints without a separate client.
Available Scripts
All scripts are defined in the rootpackage.json and run through Turborepo via dotenv-cli:
| Script | Description |
|---|---|
pnpm dev | Starts all services in development mode (persistent, no cache) via turbo dev |
pnpm build | Runs production builds for all packages in dependency order via turbo build |
pnpm db:generate | Generates Drizzle migration SQL files from schema changes in packages/database/models/ |
pnpm db:migrate | Applies all pending migrations to the database pointed to by DATABASE_URL |
pnpm lint | Runs ESLint across all packages via turbo run lint |
pnpm check-types | Runs TypeScript type checking across all packages via turbo run check-types |
pnpm format | Formats all .ts, .tsx, and .md files with Prettier |
Turborepo
Deployaar uses Turborepo to manage the monorepo task pipeline. Key behaviours to understand:- Parallelisation —
turbo buildbuilds all packages concurrently, respectingdependsOn: ["^build"]so a package only builds after its dependencies have finished - Build caching — Turborepo hashes inputs (source files, environment variables listed in
globalEnv,.env*files) and skips rebuilding packages whose outputs are already cached. This makes repeatedpnpm buildruns near-instant for unchanged packages - Task pipeline —
devis marked"cache": falseand"persistent": trueso it always runs and keeps processes alive;db:generateanddb:migratehave no dependencies so they run independently in any package that defines them
The root-level scripts (
dev, build, db:generate, db:migrate) all use dotenv -- from dotenv-cli before invoking turbo. This loads the root .env file and injects its variables into the Turborepo process and all child processes, so environment variables are available during both build and runtime without manual export steps.