Skip to content
Foundry Ventures
  • Products
  • Solutions
  • Blog
  • About
  • Contact
  • Get Started
Foundry Ventures

AI-Powered Software. Shipped.

Navigation

  • Products
  • Solutions
  • Blog
  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
© 2026 Foundry Ventures LLC. All rights reserved.
  1. Home
  2. Blog
  3. Deploying Next.js on Vercel with Neon Postgres: Our Production Stack
Cloud Architecture

Deploying Next.js on Vercel with Neon Postgres: Our Production Stack

February 18, 2026•6 min read•...

Contents

  • The Stack
  • Why Neon Over Traditional Postgres
  • Prisma Configuration
  • Vercel Configuration
  • Environment variables
  • Cron jobs
  • Headers and redirects
  • Monitoring
  • Cost

Every Foundry Ventures web property runs on the same core stack: Next.js on Vercel with Neon PostgreSQL. Here is why, and how we configure it for production.

The Stack

  • Next.js 15 (App Router): Server components, API routes, middleware
  • Vercel: Hosting, edge functions, cron jobs
  • Neon PostgreSQL: Serverless Postgres with connection pooling
  • Prisma 6: Type-safe ORM with migrations

Why Neon Over Traditional Postgres

Neon's serverless architecture matches Vercel's execution model. Traditional Postgres connections are long-lived; serverless functions are short-lived. This mismatch causes connection pool exhaustion.

Neon solves this with:

  • Built-in connection pooling: No need for PgBouncer or similar middleware
  • Scale to zero: Development branches cost nothing when idle
  • Branching: Database branches for preview deployments

Prisma Configuration

Our Prisma setup uses two connection strings:

DATABASE_URL=          # Pooled connection for queries
DIRECT_URL=            # Direct connection for migrations

The pooled URL goes through Neon's connection pooler. The direct URL bypasses it for schema migrations, which need a persistent connection.

Vercel Configuration

Environment variables

We use Vercel's environment variable system with separate values for production, preview, and development. Database URLs point to different Neon branches per environment.

Cron jobs

Vercel Cron triggers our cleanup endpoint daily at 2 AM UTC. The endpoint purges stale view deduplication records, anonymizes old IP addresses, and removes inactive subscribers.

Headers and redirects

Security headers (CSP, HSTS, X-Frame-Options) are configured in next.config.js and applied to every response.

Monitoring

We use Vercel's built-in analytics for core web vitals and Plausible for privacy-friendly page analytics. No Google Analytics, no cookies for tracking.

Cost

For a corporate site with moderate traffic, the total monthly cost is under $30: Vercel Pro ($20), Neon free tier ($0), Plausible ($9). The stack scales significantly before costs increase meaningfully.

Enjoyed this post?

Get AI insights and engineering lessons delivered to your inbox. No spam, unsubscribe anytime.

Share:
From Idea to SaaS: How TestIQ Went From Prototype to Product →

Related Posts

Real-Time Streaming with Amazon Nova Sonic: Architecture Deep Dive

7 min read

How We Built a Voice AI System That Handles Real Healthcare Calls

8 min read

Multi-Agent Systems: Why One AI Isn't Enough

6 min read