Environment
The root .env.example is the source template for local and production configuration.
Minimal Local Example
Section titled “Minimal Local Example”INSTANCE_NAME="dpg-local"INSTANCE_ENV="development"API_DOMAIN="http://localhost"API_PORT="2742"AUTH_SECRET="replace-this"AUTH_MIDDLEWARE_ENABLED="true"CREATE_TEST_OTP="false"ALLOWED_ORIGINS="http://localhost:3000"SERVED_DOMAINS="yellow_dot/student"NETWORK_CONFIG_SOURCE="local"NETWORK_CONFIG_LOCAL_FILE="examples/schemas/yellow_dot/network.json"SCHEMA_REGISTRY_URL="yellow_dot=https://registry.example.com/schemas/yellow_dot/network.json"POSTGRES_USER="postgres"POSTGRES_PASSWORD="replace-this"POSTGRES_DB="postgresdb"POSTGRES_HOST="127.0.0.1"DATABASE_PORT="5432"REDIS_HOST="127.0.0.1"REDIS_PASSWORD="replace-this"REDIS_PORT="6370"Core Instance Variables
Section titled “Core Instance Variables”INSTANCE_NAMEINSTANCE_ENVAPI_DOMAINAPI_PORTAUTH_SECRETAUTH_MIDDLEWARE_ENABLEDCREATE_TEST_OTPALLOWED_ORIGINSSERVED_DOMAINSNETWORK_CONFIG_SOURCENETWORK_CONFIG_LOCAL_FILENETWORK_CONFIG_URLSSCHEMA_REGISTRY_URL
Database Variables
Section titled “Database Variables”POSTGRES_USERPOSTGRES_PASSWORDPOSTGRES_DBPOSTGRES_HOSTPOSTGRES_PORTDATABASE_PORTPOSTGRES_URLREDIS_HOSTREDIS_PASSWORDREDIS_PORTREDIS_URL
If POSTGRES_URL is present, the individual PostgreSQL fields are fallbacks. If both POSTGRES_PORT and DATABASE_PORT are present, POSTGRES_PORT wins.
If REDIS_URL is present, the individual Redis fields are fallbacks.
In development, AUTH_MIDDLEWARE_ENABLED=false can disable route auth for local debugging. In production, auth middleware is always enabled by the API runtime.
CREATE_TEST_OTP=true enables local test OTP behavior for the unified OTP flow.
Notification Variables
Section titled “Notification Variables”NOTIFICATION_SERVICE_ENDPOINTNOTIFICATION_SERVICE_KEY_IDNOTIFICATION_SERVICE_SECRETSMS_TEMPLATE_ID
SERVED_DOMAINS
Section titled “SERVED_DOMAINS”SERVED_DOMAINS tells the backend which network/domain pairs it serves.
Example:
SERVED_DOMAINS="yellow_dot/student,blue_dot/seeker"This affects:
- which create and fetch requests are allowed
- which schema routes are served
- which instance origins can be allowed by network-driven CORS
Network Config Source
Section titled “Network Config Source”Local example file
Section titled “Local example file”NETWORK_CONFIG_SOURCE="local"NETWORK_CONFIG_LOCAL_FILE="examples/schemas/yellow_dot/network.json"Best for:
- development
- demos
- schema iteration
Remote config URLs
Section titled “Remote config URLs”NETWORK_CONFIG_SOURCE="remote"NETWORK_CONFIG_URLS="yellow_dot=https://registry.example.com/yellow-dot/network.json"Best for:
- production
- multi-network instances
- remote registries
SCHEMA_REGISTRY_URL
Section titled “SCHEMA_REGISTRY_URL”SCHEMA_REGISTRY_URL can be used in two forms.
Single registry base URL
Section titled “Single registry base URL”SCHEMA_REGISTRY_URL="https://registry.example.com/schemas/"This resolves served networks as:
{base}/{network}/network.json
Explicit network mappings
Section titled “Explicit network mappings”SCHEMA_REGISTRY_URL="yellow_dot=https://registry.example.com/schemas/yellow_dot/network.json,blue_dot=https://registry.other.example.com/schemas/blue_dot/network.json"If NETWORK_CONFIG_URLS is not set, the API falls back to SCHEMA_REGISTRY_URL.