Skip to content
SaaS Starter
EN

Sign in

Sign in or create an account to continue.

Documentation

Connect your frontend and backend

Connect the frontend and API domains, prepare environment variables, and configure CORS.

The source contains two projects: templates/quickstart-nextjs for the website and account pages and templates/quickstart for the backend service. Use both for the full SaaS workflow. Follow their READMEs for the matching runtime, dependency, and database setup.

For local development, copy the frontend .env.example to .env.local and the backend .env.example to .env; also copy the backend deploy/config.yaml.example to deploy/config.yaml. Replace example secrets. For deployment, start from the .env.production.example files and configure your own HTTPS domains and database.

The frontend API address must include /api/v1. The backend CORS origin must match the frontend address. Start the backend service with go run ./cmd/quickstart in its directory, then run npm ci and npm run dev in the frontend directory. OAuth callbacks and Stripe return URLs must use the same configured domains.

# Frontend: .env.local
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_API_BASE_URL=http://localhost:8080/api/v1

# Backend: .env
APP_HTTP_ALLOWED_ORIGINS=http://localhost:3000

Frontend setup README

Backend setup README