Master Guides
Configuration
Three small files control your whole app.
Everything configurable lives in predictable places: ports in master.config.js, secrets in .env, and database settings per environment.
master.config.js#
Drives the dev/build/start orchestration.
master.config.js
export default {
frontend: true, // is there a Next.js frontend?
backendPort: 3001,
frontendPort: 3000,
backendDir: 'backend',
frontendDir: 'frontend',
};Environment variables#
Copy .env.example to .env per environment:
.env
# Where the frontend reaches the backend (used by Next.js fetches)
NEXT_PUBLIC_API_URL=http://localhost:3001
# Where the backend allows CORS from (the frontend origin)
FRONTEND_URL=http://localhost:3000Database settings#
Per-environment, in backend/config/environments/env.<env>.json, keyed by the context name. See Connecting a Database.
env.development.json
{ "AppContext": { "type": "better-sqlite3", "connection": "db/" } }Backend server settings#
The backend can also read server settings (port, hostname, timeout) from its own environment files — see MasterController Configuration.