Skip to content

Configuration

v1 preview

The complete repository and supported production Compose release are not public during beta. This reference describes the intended v1 configuration surface and may change before release. It is not a current deployment guide.

The planned self-hosted release uses environment variables for application, database, cache, search, AI, mail, and administration settings. Final required values, defaults, secret handling, and service versions will be published with v1.

Compose File

The planned compose.prod.yml file defines the service topology and reads its configuration from environment variables or a Docker secrets workflow. The public v1 release will identify which values are required and provide the supported startup procedure.

Environment Variables

Application

VariableDescriptionRequiredDefault
APP_URLPublic URL of the applicationYes
WS_URLPublic WebSocket URL. Set this when the WebSocket server runs on a different host or port than the appNoSame as APP_URL
PORTApplication portNo3000
SESSION_SECRETExpress session secretYes
JWT_SECRETJWT signing secretYes
NODE_ENVEnvironment modeNoproduction
SERVER_MODERun mode: omit for full app, ws for WebSocket-only, scheduler for background jobsNo
SOCKET_IO_ADAPTERSocket.IO cluster transport: mongodb or memoryNomongodb
SOCKET_IO_MONGO_URLOptional MongoDB connection override for the MongoDB adapterNoMONGO_URI

The MongoDB Socket.IO adapter stores events in the socketio collection and uses change streams, so it requires a MongoDB replica set or sharded cluster.

Database

VariableDescriptionRequiredDefault
MONGO_URIMongoDB connection stringNomongodb://mongo:27017/managani

Cache

VariableDescriptionRequiredDefault
MEMCACHED_SERVERSComma-separated Memcached endpointsNomemcached:11211 in Docker Compose

Search (Typesense)

VariableDescriptionRequiredDefault
TYPESENSE_HOSTTypesense server hostNotypesense
TYPESENSE_PORTTypesense server portNo8108
TYPESENSE_PROTOCOLProtocol (http or https)Nohttp
TYPESENSE_API_KEYTypesense API keyYes
TYPESENSE_NODESMulti-node cluster config as JSON. Example: [{"host":"ts1","port":8108,"protocol":"http"},{"host":"ts2","port":8108,"protocol":"http"}]No
TYPESENSE_COLLECTION_PREFIXPrefix added to all collection names (mg_urls_<id>), so multiple products can share one Typesense cluster. Set to an empty string to keep unprefixed names on a dedicated cluster.Nomg

When TYPESENSE_NODES is set, the individual host/port/protocol variables are ignored and the cluster config is used instead.

AI / LLM

Managani uses plan-aware model tiers for AI tasks:

VariableDescriptionRequiredDefault
LLM_BASIC_MODELLower-cost model for basic plans, parsing, classification, and internal analysisNogpt-5.4-mini
LLM_BASIC_MODEL_PROVIDERProvider for the basic model: google or openaiNoopenai
LLM_TOP_MODELTop model for Pro/customer-facing replies and generated contentNogpt-5.6-terra
LLM_TOP_MODEL_PROVIDERProvider for the top model: google or openaiNoopenai
CHAT_AI_MODELLegacy alias for LLM_TOP_MODEL when LLM_TOP_MODEL is unsetNogpt-5.6-terra
CHAT_AI_MODEL_PROVIDERLegacy alias for LLM_TOP_MODEL_PROVIDER when LLM_TOP_MODEL_PROVIDER is unsetNoopenai
NL_SEARCH_MODELOptional override for intent classificationNogpt-5.4-mini
NL_SEARCH_MODEL_PROVIDEROptional provider override for intent classificationNoopenai
TS_CONVERSATION_MODELOptional override for Typesense conversation searchNogpt-5.4-mini
TS_CONVERSATION_MODEL_PROVIDEROptional provider override for Typesense conversation searchNoopenai
GOOGLE_API_KEYGoogle AI API key (required when using Google models)Conditional
OPENAI_API_KEYOpenAI API key (required when using OpenAI models)Conditional
WIDGET_CHAT_EMAIL_FALLBACK_ENABLEDGlobal emergency switch for unread chat fallback emailNotrue
WIDGET_CHAT_EMAIL_FALLBACK_CRONScheduler cadence for due fallback emailNo* * * * *
WIDGET_CHAT_EMAIL_FALLBACK_DELAY_MINUTESUnread delay reset after each team or AI replyNo3
WIDGET_CHAT_EMAIL_FALLBACK_MAX_PER_RUNMaximum fallback deliveries claimed per scheduler runNo50

At least one API key is required for AI chat to function. Hosted Free and Starter tenants are downgraded to the basic model for top-tier requests; hosted Pro tenants use the top model.

Email (SMTP)

VariableDescriptionRequiredDefault
SMTP_HOSTSMTP server hostYes
SMTP_PORTSMTP server portNo587
SMTP_USERSMTP usernameYes
SMTP_PASSSMTP passwordYes
SMTP_FROMSender email addressYes

Admin

VariableDescriptionRequiredDefault
SYSADMIN_EMAILSystem admin email. If set, a sysadmin account is provisioned on startupNo
SYSADMIN_PASSWORDSystem admin passwordNo

Analytics (OpenPanel)

VariableDescriptionRequiredDefault
ENABLE_OPENPANELEnable OpenPanel analyticsNofalse
OPENPANEL_CLIENT_IDOpenPanel client IDNo
OPENPANEL_CLIENT_SECRETOpenPanel client secretNo
OPENPANEL_API_URLOpenPanel API URLNo

Reverse Proxy

The planned production deployment will sit behind a reverse proxy such as nginx or Caddy. The final v1 guide will require operators to:

  1. Set APP_URL to your public domain
  2. Proxy WebSocket connections to port 3001
  3. Proxy MCP connections to port 3002
  4. Set X-Forwarded-For and X-Forwarded-Proto headers

Example nginx configuration:

nginx
server {
    listen 443 ssl;
    server_name your-instance.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /ws {
        proxy_pass http://localhost:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    location /mcp {
        proxy_pass http://localhost:3002;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}