Skip to main content

Documentation 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.

Local development runs both the Next.js web app and the Express API concurrently via Turborepo. The 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 engines field in package.json
  • pnpm 9.0.0 — install with npm install -g pnpm@9; the packageManager field 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, and GITHUB_WEBHOOK_SECRET
  • At least one AI provider API keyGOOGLE_GENERATIVE_AI_API_KEY is the recommended free-tier default; set DEFAULT_AI_PROVIDER=google and DEFAULT_AI_MODEL accordingly
  • An E2B account and API key (E2B_API_KEY and E2B_TEMPLATE_ID) — required for the coding agent to provision sandboxed execution environments

Setup Steps

1

Clone the repository

git clone https://github.com/paramveer-cyber/Deployaar.git
cd Deployaar
2

Install dependencies

pnpm resolves all workspace packages (apps/* and packages/*) in a single install:
pnpm install
3

Configure environment variables

Copy the example env file into each app, then open both files and fill in every required secret:
cp .env.example apps/api/.env
cp .env.example apps/web/.env
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.
The setup.sh script at the repo root automates the copy step and also creates hard links from each package directory back to a single root .env, so you only have to maintain one file during development.
4

Generate and apply database migrations

Drizzle ORM manages the schema. Run 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:
pnpm db:generate
pnpm db:migrate
This creates all required tables, including better-auth’s verification table (migration 0001_icy_lyja.sql) — without it, Google and GitHub OAuth logins will fail with state_security_mismatch.
5

Start all services

pnpm dev
Turborepo starts both the web app and the API in watch mode. Logs from all packages stream to the terminal UI simultaneously.

Local URLs

Once pnpm dev is running, all services are available at:
ServiceURL
Web apphttp://localhost:3000
APIhttp://localhost:8000
API Docs (Scalar)http://localhost:8000/docs
OpenAPI JSONhttp://localhost:8000/openapi.json
The Scalar UI at /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 root package.json and run through Turborepo via dotenv-cli:
ScriptDescription
pnpm devStarts all services in development mode (persistent, no cache) via turbo dev
pnpm buildRuns production builds for all packages in dependency order via turbo build
pnpm db:generateGenerates Drizzle migration SQL files from schema changes in packages/database/models/
pnpm db:migrateApplies all pending migrations to the database pointed to by DATABASE_URL
pnpm lintRuns ESLint across all packages via turbo run lint
pnpm check-typesRuns TypeScript type checking across all packages via turbo run check-types
pnpm formatFormats all .ts, .tsx, and .md files with Prettier

Turborepo

Deployaar uses Turborepo to manage the monorepo task pipeline. Key behaviours to understand:
  • Parallelisationturbo build builds all packages concurrently, respecting dependsOn: ["^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 repeated pnpm build runs near-instant for unchanged packages
  • Task pipelinedev is marked "cache": false and "persistent": true so it always runs and keeps processes alive; db:generate and db:migrate have no dependencies so they run independently in any package that defines them
Run pnpm db:migrate after pulling changes from main that include new migration files in packages/database/drizzle/. New migrations are additive and safe to apply to an existing development database.
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.

Build docs developers (and LLMs) love