Skip to content
Dashboard

Vercel Services: Run full stack on Vercel

Link to headingCompose applications with Vercel Services

vercel.json
{
"services": {
"my_frontend": {
"root": "frontend/",
"framework": "nextjs"
},
"my_backend": {
"root": "backend/",
"entrypoint": "main:app"
}
},
// my_backend has no public route
// it is only reachable from my_frontend internally
"rewrites": [
{
"source": "/(.*)",
"destination": { "service": "my_frontend" }
}
]
}

Public internet routes to the frontend. The backend has no public route and is only reachable internally via a service binding.

A visualization of Services Graph in the Deployment UIA visualization of Services Graph in the Deployment UI
A visualization of Services Graph in the Deployment UI

Link to headingService bindings

vercel.json
{
"services": {
"my_frontend": {
"root": "frontend/",
"framework": "nextjs",
"bindings": [
{
"type": "service",
"service": "my_backend",
"format": "url",
"env": "BACKEND_INTERNAL_URL"
}
]
},
"my_backend": { ... }
},
"rewrites": [ ... ]
}

A binding injects BACKEND_INTERNAL_URL into the frontend, pointing at the backend over Vercel's internal network

app/api/users/route.ts
export async function GET() {
const url = new URL("/users", process.env.BACKEND_INTERNAL_URL);
const res = await fetch(url);
const users = await res.json();
return Response.json(users);
}

The frontend calls the backend using the injected internal URL. Traffic never leaves Vercel's network.

Link to headingFramework-defined infrastructure

Link to headingThe full stack platform

Link to headingIsolated compute for agent services

Link to headingReal-time backends with WebSocket support

Link to headingReach external services with Vercel Connect

Link to headingDatabases and storage for your services

Link to headingRun durable workflows and background jobs

Link to headingConnect privately and run on the right compute

Link to headingA single platform for everything you ship

Run your whole backend on Vercel

Compose a frontend and every backend behind it in one project, on one domain, talking to each other with the connections wired for you.

Get started

Ready to deploy?