Skip to content

Local Development — Management

  • 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
Terminal window
cd Management/management-backend
cp .env.example .env
# Edit .env
go mod download
go run ./cmd/server
# API at http://localhost:8080
VariableExampleNotes
DATABASE_URLsqlserver://sa:Pass@localhost:1433?database=monozu-manage&encrypt=disableSeparate DB from Cloud
IS_DEVtrueForce SQL auth
SECRET_KEYany 32+ char stringDifferent value from Cloud’s SECRET_KEY
APP_ENVdevelopment
PORT8080
APP_BASE_URLhttp://localhost:5173Management SPA URL
API_PUBLIC_URLhttp://localhost:8080Must match Entra redirect URI
MS_CLIENT_IDfrom EntraManagement app registration
MS_CLIENT_SECRETfrom Entra
MS_TENANT_IDfrom EntraEntra directory ID
CLOUD_INTERNAL_API_TOKENany stringMust match Cloud’s value
CLOUD_WEBHOOK_HMAC_SECRETany 32+ char stringMust match Cloud’s value
CLOUD_API_URLhttp://localhost:8000Cloud Backend URL
Terminal window
cd Management/management-frontend
cp .env.example .env
npm install
npm run dev
# SPA at http://localhost:5173
VariableExample
VITE_API_URLhttp://localhost:8080

Create a separate database for Management (do not share with Cloud):

Terminal window
# In SQL Server (Docker)
sqlcmd -S localhost -U sa -P YourPass -Q "CREATE DATABASE [monozu-manage]"

Run Flyway migrations for Management:

Terminal window
cd Management/management-backend
flyway \
-url="jdbc:sqlserver://localhost:1433;databaseName=monozu-manage;encrypt=false" \
-user=sa -password=YourPass \
-locations=filesystem:db/migration \
migrate
  1. Start Cloud Backend on :8000 with MANAGEMENT_API_URL=http://localhost:8080
  2. Start Management Backend on :8080 with CLOUD_API_URL=http://localhost:8000
  3. Register a tenant on Cloud
  4. In Management Frontend, import the tenant (use the cloud_tenant_id from Cloud’s DB)
  5. 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.