Back to Home
Documentation

Operations

Local Development

Run the Go API, Next.js frontend, tests, and local Vercel flow for development.

Prerequisites

ToolVersionPurpose
Go1.21+Go backend, CLI, and tests
Node.js18+ (Node 20+ recommended for Next 16)Web frontend
npm9+Frontend dependencies and scripts

Run locally

bash
git clone https://github.com/fernandofatech/diagram-as-code.git
cd diagram-as-code

# Terminal 1 - local Go API
go run ./cmd/api-dev

# Terminal 2 - Next.js app
cd web
npm install
npm run dev

Validation commands

bash
# Go validation
go test ./...

# Frontend validation
cd web
npm run lint
npm run build

Alternative: Vercel dev

bash
npm install --global vercel
vercel dev

Development notes

  • When running the web app locally, /api/* is proxied to the Go API in development.
  • The hosted frontend lives in web/, while the serverless endpoint lives in api/generate.go.
  • The root vercel.json controls how Next.js and Go are deployed together.