Skip to content
New Project

Next.js + Gin Starter

A monorepo with a Next.js frontend and a public Gin backend.

DeployView Demo

Next.js + Gin

This example shows a monorepo using Vercel Services with a Next.js frontend and a public Gin backend.

Demo

https://nextjs-gin-services.vercel.app/

How it works

The project is structured as a monorepo:

nextjs-gin/
├── backend/
├── frontend/
└── vercel.json

Services are configured in vercel.json:

{
"services": {
"frontend": { "root": "frontend/", "framework": "nextjs" },
"backend": { "root": "backend/", "entrypoint": "main:app" }
},
"rewrites": [
{
"source": "/svc/api/:path*",
"destination": { "service": "backend" }
},
{
"source": "/(.*)",
"destination": { "service": "frontend" }
}
]
}

Vercel will route requests to the backend service for URL with paths starting with /svc/api/ and to frontend for all other URLs.

Running Locally

vercel dev

Open http://localhost:3000 and try:

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

Learn More

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

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 GitHub Maintainer

GitHub maintainer eve agent for your inbox. Weekly issue digests you reply to, PR summaries, Linear handoffs, and @mention answers.
eve GitHub Maintainer 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
DeployView Demo