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
- Storage: Link a Neon Database to this project (if not already). Use the same Neon project where you enable Neon Auth.
- Storage: Link Vercel Blob to this project (Create Store → Blob).
- 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).
Neon Console
Where: neon.tech → Your Project
- Create a project and database if you haven’t. Copy the connection string (with ?sslmode=require) → use as DATABASE_URL.
- Enable Neon Auth for this project (Integrations or Auth section). Neon creates the neon_auth schema and gives you NEON_AUTH_BASE_URL.
- Generate or copy NEON_AUTH_COOKIE_SECRET (e.g. openssl rand -base64 32) and set it in Vercel and .env.local.
Environment variables (.env.local)
Where: Project root
- Copy .env.example to .env.local.
- Set DATABASE_URL = Neon connection string.
- Set NEON_AUTH_BASE_URL and NEON_AUTH_COOKIE_SECRET from Neon Auth config.
- Set BLOB_READ_WRITE_TOKEN from Vercel → Storage → Blob.
- Run vercel env pull to sync with Vercel if you added them there first.
Cursor MCP (optional)
Where: Cursor Settings → Features → MCP Servers
- Add a new MCP Server: Name Neon, Type command, Command: npx -y @neondatabase/mcp-server-neon start.
- Add environment variable NEON_API_KEY (from Neon Console).
- Cursor can then use run_sql, get_database_tables, create_branch, etc.
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
- Create a project at neon.tech and a database.
- Copy the connection string (with ?sslmode=require) into DATABASE_URL.
- 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_URLNEON_AUTH_COOKIE_SECRET
Setup steps
- Enable Neon Auth in Neon Console for your project.
- Set NEON_AUTH_BASE_URL and NEON_AUTH_COOKIE_SECRET (cookie secret: e.g. openssl rand -base64 32).
- 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
- In Vercel: Project → Storage → Create Store → Blob.
- 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
- No signup. Uses DATABASE_URL (same Neon DB).
- Run npx drizzle-kit pull to import neon_auth tables; add custom tables in lib/db/schema.ts.
- 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_SECRETDATABASE_URL
Setup steps
- PAYLOAD_SECRET: any long random string.
- 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
- Create an account at openrouter.ai; add credits.
- Generate an API key and set OPENROUTER_API_KEY.
Python Engine (FastAPI)
Optional microservice for heavy math or custom logic.
Environment variables
PYTHON_ENGINE_URLINTERNAL_SERVICE_KEY
Setup steps
- Host the FastAPI app (e.g. Railway, Render).
- 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_KEYSTRIPE_WEBHOOK_SECRETNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
Setup steps
- 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_KEYCONTACT_TO_EMAILCONTACT_FROM_EMAILCONTACT_FROM_NAME
Setup steps
- 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
- 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
- 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_URLNEXT_PUBLIC_SUPABASE_ANON_KEYDATABASE_URI
Setup steps
- Create project; get connection string and anon key; create buckets; add redirect URLs for Auth.
- See docs/DATABASE_OPTIONS.md for Supabase-as-default wiring.
See Neon+Auth+VercelBlob+Drizzle.md and .env.example for full reference.
