ConstructAI

External Services Setup

Base stack for ConstructAI: Neon + Neon Auth + Vercel Blob + Drizzle. Copy .env.example to .env.local and complete the manual steps below.

Manual settings (do these first)

These steps are done in external dashboards or your repo; they cannot be automated.

Vercel Dashboard

Where: vercel.com → Your Project

  1. Storage: Link a Neon Database to this project (if not already). Use the same Neon project where you enable Neon Auth.
  2. Storage: Link Vercel Blob to this project (Create Store → Blob).
  3. Environment variables: Add DATABASE_URL, NEON_AUTH_BASE_URL, NEON_AUTH_COOKIE_SECRET, BLOB_READ_WRITE_TOKEN (or run vercel env pull after setting them in the Vercel UI).
Vercel Storage docs

Neon Console

Where: neon.tech → Your Project

  1. Create a project and database if you haven’t. Copy the connection string (with ?sslmode=require) → use as DATABASE_URL.
  2. Enable Neon Auth for this project (Integrations or Auth section). Neon creates the neon_auth schema and gives you NEON_AUTH_BASE_URL.
  3. Generate or copy NEON_AUTH_COOKIE_SECRET (e.g. openssl rand -base64 32) and set it in Vercel and .env.local.
Neon Auth docs

Environment variables (.env.local)

Where: Project root

  1. Copy .env.example to .env.local.
  2. Set DATABASE_URL = Neon connection string.
  3. Set NEON_AUTH_BASE_URL and NEON_AUTH_COOKIE_SECRET from Neon Auth config.
  4. Set BLOB_READ_WRITE_TOKEN from Vercel → Storage → Blob.
  5. Run vercel env pull to sync with Vercel if you added them there first.

Cursor MCP (optional)

Where: Cursor Settings → Features → MCP Servers

  1. Add a new MCP Server: Name Neon, Type command, Command: npx -y @neondatabase/mcp-server-neon start.
  2. Add environment variable NEON_API_KEY (from Neon Console).
  3. Cursor can then use run_sql, get_database_tables, create_branch, etc.
Neon MCP guide

Base stack

Framework: Next.js 15 (App Router). Database: Neon (Postgres). ORM: Drizzle. Auth: Neon Auth. Storage: Vercel Blob.

Neon (database)

Neon

Base stack: serverless Postgres. Used by Drizzle, Payload, and Neon Auth (neon_auth schema).

Sign up & create project(https://neon.tech/signup)

Environment variables

  • DATABASE_URL

Setup steps

  1. Create a project at neon.tech and a database.
  2. Copy the connection string (with ?sslmode=require) into DATABASE_URL.
  3. Enable Neon Auth in the same project (see Manual settings above).

Neon Auth

Neon Auth

Base stack: managed auth (Better Auth). Users and sessions live in your Neon DB (neon_auth schema).

Neon Auth docs(https://neon.tech/docs/neon-auth/overview)

Environment variables

  • NEON_AUTH_BASE_URL
  • NEON_AUTH_COOKIE_SECRET

Setup steps

  1. Enable Neon Auth in Neon Console for your project.
  2. Set NEON_AUTH_BASE_URL and NEON_AUTH_COOKIE_SECRET (cookie secret: e.g. openssl rand -base64 32).
  3. Auth API is mounted at /api/auth/*; login/sign-out use this.

Vercel Blob (storage)

Vercel Blob docs

Base stack: file storage for uploads (e.g. AI documents).

Sign up & create Blob store(https://vercel.com/signup)

Environment variables

  • BLOB_READ_WRITE_TOKEN

Setup steps

  1. In Vercel: Project → Storage → Create Store → Blob.
  2. Copy BLOB_READ_WRITE_TOKEN into .env.local and Vercel env.

Drizzle ORM

Drizzle docs

Base stack: type-safe DB access (lib/db). Uses neon-http driver; schema in lib/db/schema.ts.

Environment variables

  • DATABASE_URL

Setup steps

  1. No signup. Uses DATABASE_URL (same Neon DB).
  2. Run npx drizzle-kit pull to import neon_auth tables; add custom tables in lib/db/schema.ts.
  3. Run npx drizzle-kit generate and migrate to apply changes.

Payload CMS

Admin at /admin. Uses the same Neon Postgres (DATABASE_URL / DATABASE_URI).

Environment variables

  • PAYLOAD_SECRET
  • DATABASE_URL

Setup steps

  1. PAYLOAD_SECRET: any long random string.
  2. DATABASE_URL: same Neon connection string (or DATABASE_URI for compatibility).

OpenRouter (AI)

OpenRouter

AI pipeline: extraction, analysis, synthesis. Powers AI Reports and Documents.

Sign up & get API key(https://openrouter.ai/keys)

Environment variables

  • OPENROUTER_API_KEY

Setup steps

  1. Create an account at openrouter.ai; add credits.
  2. Generate an API key and set OPENROUTER_API_KEY.

Python Engine (FastAPI)

Optional microservice for heavy math or custom logic.

Environment variables

  • PYTHON_ENGINE_URL
  • INTERNAL_SERVICE_KEY

Setup steps

  1. Host the FastAPI app (e.g. Railway, Render).
  2. Set PYTHON_ENGINE_URL and INTERNAL_SERVICE_KEY.

Stripe (Billing)

Stripe Dashboard

SaaS billing and webhooks.

Sign up & get API keys(https://dashboard.stripe.com/register)

Environment variables

  • STRIPE_SECRET_KEY
  • STRIPE_WEBHOOK_SECRET
  • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY

Setup steps

  1. Use Test Mode; get API keys and set webhook URL.

Brevo (Contact Form)

Brevo

Sends contact form submissions via email.

Sign up & create API key(https://www.brevo.com/en/signup/)

Environment variables

  • BREVO_API_KEY
  • CONTACT_TO_EMAIL
  • CONTACT_FROM_EMAIL
  • CONTACT_FROM_NAME

Setup steps

  1. Sign up at brevo.com; create API key; set CONTACT_TO_EMAIL.

Vercel (Hosting)

Vercel

Deploy and set all environment variables in the project.

Sign up & add project(https://vercel.com/signup)

Environment variables

  • All from .env.example

Setup steps

  1. Link GitHub repo; add env vars (or vercel env pull from CLI).

Security

ENCRYPTION_KEY for sensitive data (32 chars).

Environment variables

  • ENCRYPTION_KEY

Setup steps

  1. Generate a 32-character secret; never commit.

Supabase (alternative stack)

Supabase

Alternative to Neon + Neon Auth + Blob: use Supabase for DB, Auth, and Storage instead.

Supabase Dashboard(https://supabase.com/dashboard)

Environment variables

  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • DATABASE_URI

Setup steps

  1. Create project; get connection string and anon key; create buckets; add redirect URLs for Auth.
  2. See docs/DATABASE_OPTIONS.md for Supabase-as-default wiring.

See Neon+Auth+VercelBlob+Drizzle.md and .env.example for full reference.