Local Development — Management
Prerequisites
Section titled “Prerequisites”- Go 1.26+ (for Management Backend)
- Node.js 20+ and npm (for Management Frontend)
- SQL Server running locally (separate database from Cloud, or same instance with different DB name)
- Cloud Backend running locally if testing M2M integration
Management Backend
Section titled “Management Backend”cd Management/management-backendcp .env.example .env# Edit .envgo mod downloadgo run ./cmd/server# API at http://localhost:8080Key env vars
Section titled “Key env vars”| Variable | Example | Notes |
|---|---|---|
DATABASE_URL | sqlserver://sa:Pass@localhost:1433?database=monozu-manage&encrypt=disable | Separate DB from Cloud |
IS_DEV | true | Force SQL auth |
SECRET_KEY | any 32+ char string | Different value from Cloud’s SECRET_KEY |
APP_ENV | development | |
PORT | 8080 | |
APP_BASE_URL | http://localhost:5173 | Management SPA URL |
API_PUBLIC_URL | http://localhost:8080 | Must match Entra redirect URI |
MS_CLIENT_ID | from Entra | Management app registration |
MS_CLIENT_SECRET | from Entra | |
MS_TENANT_ID | from Entra | Entra directory ID |
CLOUD_INTERNAL_API_TOKEN | any string | Must match Cloud’s value |
CLOUD_WEBHOOK_HMAC_SECRET | any 32+ char string | Must match Cloud’s value |
CLOUD_API_URL | http://localhost:8000 | Cloud Backend URL |
Management Frontend
Section titled “Management Frontend”cd Management/management-frontendcp .env.example .envnpm installnpm run dev# SPA at http://localhost:5173Key env vars
Section titled “Key env vars”| Variable | Example |
|---|---|
VITE_API_URL | http://localhost:8080 |
Database setup
Section titled “Database setup”Create a separate database for Management (do not share with Cloud):
# In SQL Server (Docker)sqlcmd -S localhost -U sa -P YourPass -Q "CREATE DATABASE [monozu-manage]"Run Flyway migrations for Management:
cd Management/management-backendflyway \ -url="jdbc:sqlserver://localhost:1433;databaseName=monozu-manage;encrypt=false" \ -user=sa -password=YourPass \ -locations=filesystem:db/migration \ migrateTesting the full M2M flow locally
Section titled “Testing the full M2M flow locally”- Start Cloud Backend on
:8000withMANAGEMENT_API_URL=http://localhost:8080 - Start Management Backend on
:8080withCLOUD_API_URL=http://localhost:8000 - Register a tenant on Cloud
- In Management Frontend, import the tenant (use the
cloud_tenant_idfrom Cloud’s DB) - Activate license → webhook fires to Cloud → tenant becomes active
Both CLOUD_INTERNAL_API_TOKEN and CLOUD_WEBHOOK_HMAC_SECRET must be set to the same value on both services.