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.

Deploying Deployaar to production requires configuring two hosting providers — Render for the Express API and Vercel for the Next.js web app — along with several external services: Neon Postgres, Inngest, E2B, a GitHub App, an AI provider, and Razorpay. The two services must be deployed in order: the API first, so you have its public URL before configuring the web app’s environment variables.

Deploy the API to Render

1

Create a new Web Service on Render

From the Render dashboard, click NewWeb Service.
2

Connect your GitHub repository

Authorise Render to access your fork or clone of the Deployaar repository and select it. Choose the main (or master) branch to track.
3

Set the Build Command

pnpm install && pnpm build
This installs all workspace dependencies and runs turbo build (via the root build script), which builds all packages in dependency order — including apps/api via tsup.
4

Set the Start Command

node apps/api/dist/index.js
tsup emits the bundled API entrypoint to apps/api/dist/index.js. The noExternal: [/^@repo\//] option in tsup.config.ts means all internal workspace packages are already inlined — no node_modules resolution is needed at runtime beyond the external npm dependencies.
5

Set the PORT environment variable

Render automatically injects a PORT environment variable into every web service. The API reads it via apps/api/src/env.ts (PORT: z.string().optional()) and defaults to 8000 if absent. No manual configuration is required for this variable.
6

Add all API environment variables

In the Render Environment tab, add every variable your deployment requires. See the Environment Variables reference for the complete list. At minimum you need:
DATABASE_URL
BASE_URL
BETTER_AUTH_SECRET
BETTER_AUTH_URL
NEXT_PUBLIC_WEB_URL
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET
GITHUB_APP_ID / GITHUB_APP_PRIVATE_KEY / GITHUB_WEBHOOK_SECRET
GOOGLE_GENERATIVE_AI_API_KEY  (or another AI provider key)
DEFAULT_AI_PROVIDER / DEFAULT_AI_MODEL
E2B_API_KEY / E2B_TEMPLATE_ID
RAZORPAY_KEY_ID / RAZORPAY_KEY_SECRET / RAZORPAY_WEBHOOK_SECRET
7

Deploy and note the service URL

Click Deploy. Once the build and startup succeed, Render assigns a public URL such as https://deployaar.onrender.com. Copy this URL — you will need it for the next two steps.
8

Set BASE_URL and BETTER_AUTH_URL

Return to the Render environment settings and set:
BASE_URL=https://deployaar.onrender.com
BETTER_AUTH_URL=https://deployaar.onrender.com
Both must equal the API’s own public URL. Trigger a redeploy so the new values take effect.

Deploy the Web App to Vercel

1

Import the repository in Vercel

From the Vercel dashboard, click Add New → Project and import your Deployaar repository from GitHub.
2

Set Root Directory

Leave Root Directory blank or set it to . (the repository root). Vercel must run commands from the repo root so Turborepo can resolve all workspace packages.
3

Set Build Command

In Build & Development Settings, set the Build Command to:
turbo run build --filter=web
This tells Turborepo to build only the apps/web package and its workspace dependencies, skipping apps/api.
4

Set Output Directory

Set the Output Directory to:
apps/web/.next
Vercel needs the explicit path because the Next.js app is not at the repo root.
5

Set Install Command

Set the Install Command to:
pnpm install
Vercel auto-detects pnpm from packageManager: "pnpm@9.0.0" in package.json, but specifying it explicitly prevents fallback to npm.
6

Add environment variables

In the Environment Variables section, add all NEXT_PUBLIC_* variables and the shared auth secrets. At minimum:
NEXT_PUBLIC_API_URL=https://deployaar.onrender.com/trpc
NEXT_PUBLIC_WEB_URL=https://your-vercel-domain.vercel.app
BETTER_AUTH_SECRET=<same secret as the API>
BETTER_AUTH_URL=https://deployaar.onrender.com
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET
7

Set NEXT_PUBLIC_API_URL

Ensure NEXT_PUBLIC_API_URL points to the Render API’s tRPC endpoint:
NEXT_PUBLIC_API_URL=https://deployaar.onrender.com/trpc
This value is baked into the Next.js client bundle at build time. If it is wrong, every tRPC call from the browser will fail.
8

Deploy and note the web URL

Click Deploy. Once the build completes, note the Vercel domain (e.g., https://deployaar.paramveer.xyz). Go back to the Render API environment settings and update NEXT_PUBLIC_WEB_URL and FRONTEND_URL to this URL, then redeploy the API.

Configure GitHub App Webhooks

After both services are live, update your GitHub App’s webhook URL so push and pull-request events reach the API:
  1. Open your GitHub App settings at https://github.com/settings/apps/{your-app-name}
  2. Under Webhook URL, set:
    https://{your-render-api-url}/api/github/webhook
    
  3. Confirm the Webhook Secret matches GITHUB_WEBHOOK_SECRET in your Render environment
  4. Save changes — GitHub will immediately start delivering events to the new URL

Run Database Migrations

Migrations must be applied to the production Neon database before the API first starts. The API will fail to authenticate users if the verification table (created by migration 0001_icy_lyja.sql) is absent. Set your production DATABASE_URL locally or in a CI environment and run:
pnpm db:migrate
You can also run migrations from the Neon SQL console by pasting the contents of each file in packages/database/drizzle/ in order. After the initial deploy, run pnpm db:migrate whenever you pull changes that include new migration files — migrations are additive and safe to apply without downtime.

Verify Deployment

Once both services are live and the database is migrated, verify the deployment with the following checks:
  • API health endpointGET https://{api-url}/health should return:
    { "message": "API is healthy", "healthy": true }
    
  • Scalar API docshttps://{api-url}/docs should load the interactive Scalar API reference
  • OAuth sign-in — navigate to https://{web-url}/sign-in and complete a Google or GitHub OAuth login end-to-end; a successful redirect to /dashboard confirms that BETTER_AUTH_URL, NEXT_PUBLIC_WEB_URL, and the OAuth app callbacks are all aligned
BETTER_AUTH_URL must equal the Render API URL exactly — no trailing slash. For example, https://deployaar.onrender.com is correct; https://deployaar.onrender.com/ is not. A mismatch causes better-auth to reject the OAuth callback with state_security_mismatch because the stored state URL and the incoming redirect URL do not match.
For the full list of every environment variable — including optional AI provider keys, logging levels, and Razorpay webhook configuration — see the Environment Variables reference.

Build docs developers (and LLMs) love