Skip to content
New Project

Next.js + FastAPI + Bindings Starter

A monorepo with a Next.js frontend and a private FastAPI backend.

DeployView Demo

Next.js + FastAPI + Bindings

This example shows a monorepo using Vercel Services with a Next.js frontend and a private FastAPI backend.

Demo

https://nextjs-fastapi-services-bindings.vercel.app/

How it works

The project is structured as a monorepo:

nextjs-fastapi-bindings/
├── backend/
├── frontend/
└── vercel.json

Services are configured in vercel.json:

{
"services": {
"frontend": {
"root": "frontend/",
"framework": "nextjs",
"bindings": [
{
"type": "service",
"service": "backend",
"format": "url",
"env": "BACKEND_URL"
}
]
},
"backend": { "root": "backend/", "entrypoint": "main:app" }
},
"rewrites": [
{
"source": "/(.*)",
"destination": { "service": "frontend" }
}
]
}

Vercel will route all requests to the frontend. Next.js API routes will be able to access the backend at BACKEND_URL.

Running Locally

vercel dev

Open http://localhost:3000 and try:

  • /api/hello (Next.js API route)
  • /svc/api/status (FastAPI via Next.js API route)

Learn More

  • Vercel Services - learn how services work on Vercel.
  • Next.js Documentation - learn about Next.js features and API.
  • FastAPI Documentation - learn about FastAPI features and API.
GitHub
Ownervercel
Repositoryexamples
LicenseView License
Use Cases
Starter
Monorepos
Stack
Next.js
FastAPI

Related Templates

eve Personal Agent

Fork your own personal agent. One identity across web, Slack, and iMessage, with memory you can import, edit, and approve.
eve Personal Agent thumbnail

eve Incident Response Agent

sre investigates production issues using a hypothesis-driven approach and outputs verifiable evidence from connected sources.
eve Incident Response Agent thumbnail

eve Typefully Agent

Run your social presence from Slack. Drafts for X, LinkedIn, and more via Typefully, schedules on approval, reports analytics weekly.
eve Typefully Agent thumbnail
DeployView Demo