Configuration
Identity is sourced from
src/resources/app-info.json(viagetAppInfo()), not from.env.development. App config is built bycreateAppConfig()from@nx/core. Env naming follows the coreAPP_ENV_*convention.
1. Environment Variables
Identity (authoritative vs. env)
| Property | app-info.json (authoritative) | .env.development (stale) |
|---|---|---|
| Application code | SVC-00120-HELPDESK | SVC-00120-HELPDESK ✓ now matches (was SVC-00030-HELPDESK) |
| Port | 31130 | 31032 ⚠ |
| Snowflake node id | 12 | 0 ⚠ |
| Base path | /v1/api/helpdesk | /v1/api/helpdesk ✓ |
⚠ Identity drift. Treat
app-info.jsonas the source of truth..env.developmentshould be reconciled toSVC-00120/31130/12when the build is repaired. Do not rely on the.envidentity values.
Core runtime
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
RUN_MODE | startup|worker|migrate | startup | — | Process role |
NODE_ENV | string | — | — | Environment selector |
APP_ENV_APPLICATION_CODE | string | from app-info | — | Should be SVC-00120-HELPDESK |
APP_ENV_SERVER_PORT | number | 31130 | — | HTTP listen port |
APP_ENV_SERVER_BASE_PATH | string | /v1/api/helpdesk | — | Route prefix |
APP_ENV_SNOWFLAKE_WORKER_ID | number | 12 | ✓ | Snowflake node id |
APP_ENV_SNOWFLAKE_EPOCH_CHECKPOINT | number | 1735689600000 | — | Snowflake epoch |
Database
| Name | Type | Required | Description |
|---|---|---|---|
APP_ENV_POSTGRES_* | string/number | ✓ | Postgres connection (host/port/db/credentials) via PostgresCoreDataSource |
Redis (cache + BullMQ + WebSocket pubsub)
| Name | Type | Description |
|---|---|---|
APP_ENV_CACHE_REDIS_MODE | cluster|standalone | Cache Redis mode (cluster in dev) |
APP_ENV_CACHE_REDIS_IDENTIFIER | string | e.g. cache |
APP_ENV_CACHE_REDIS_PASSWORD | string | Auth |
APP_ENV_CACHE_REDIS_CLUSTER_NODES | string | Comma-separated host:port cluster nodes |
APP_ENV_WEBSOCKET_REDIS_* | — | Separate Redis identifier (ws) for WebSocket pubsub |
Mail (Nodemailer)
| Name | Type | Description |
|---|---|---|
APP_ENV_MAIL_HOST | string | SMTP host (e.g. smtp.gmail.com) |
APP_ENV_MAIL_PORT | number | e.g. 465 |
APP_ENV_MAIL_SECURE | boolean | TLS |
APP_ENV_MAIL_USER / APP_ENV_MAIL_PASSWORD | string | SMTP credentials |
APP_ENV_MAIL_FROM_NAME / APP_ENV_MAIL_FROM_MAIL | string | From identity |
APP_ENV_LOCAL_TEMPLATE_DIR | string | Email template dir (resources/email-templates/default) |
Kafka: no
APP_ENV_KAFKA_*is consumed — the Kafka dep is dead. See API Events.
Escalation / support routing
Defined in
src/shared/common/constants/common.constant.ts(ESCALATION_CONFIG), read from env with fallbacks.
| Name | Default (fallback) | Description |
|---|---|---|
APP_ENV_SUPPORT_MANAGER_EMAIL | huy.pham@nexpando.com | Escalation manager recipient |
APP_ENV_SUPPORT_LEADERSHIP_EMAIL | huy.pham@nexpando.com | Leadership recipient (critical) |
APP_ENV_SUPPORT_ESCALATION_SLACK | #support-escalations | Escalation Slack channel |
APP_ENV_SUPPORT_CRITICAL_SLACK | #support-critical-escalations | Critical Slack channel |
2. Feature Flags
Declared in
app-info.jsonfeatures(descriptive capability flags; not runtime kill-switches).
| Flag | Value | Capability |
|---|---|---|
ticketing | true | Ticket management |
slaManagement | true | SLA tracking + escalation |
knowledgeBase | true | Articles + feedback |
surveys | true | CSAT surveys |
analytics | true | Analytics (queue name reserved, no worker wired) |
contextEnrichment | true | Order/product enrichment |
autoAssignment | true | Rule-based assignment |
3. SLA / Worker Tuning Constants
Compile-time constants in
src/shared/common/constants/common.constant.ts.
| Constant | Value |
|---|---|
WORKER_CONFIG.SLA_MONITOR_INTERVAL | */1 * * * * (every minute) |
WORKER_CONFIG.SLA_BATCH_SIZE | 100 |
SLA_WARNING_THRESHOLDS | YELLOW 75 / ORANGE 90 / RED 100 / CRITICAL 150 |
SLA_DEFAULTS (by priority 10/20/30/40/50) | response/resolution minutes per tier |
ESCALATION_TIMING | L1→L2 45m, L2→L3 75m |
COMPENSATION_MATRIX | per tier (STANDARD/PREMIUM/VIP) × severity → amount |
SYSTEM_ORGANIZER_ID / SYSTEM_MERCHANT_ID | 0000-0000-0000-0000 |
4. Seeded Data
Migration processes in
src/migrations/processes/— run viaRUN_MODE=migrate. Default email templates ship as JSON undersrc/resources/email-templates/default/(ticket lifecycle, SLA warning/breach, escalation levels, assignment, compensation, after-hours).
| Source | Seeds | Notes |
|---|---|---|
migrations/processes/migration-process.ts | Drizzle migration processes | Schema migrations (centralized models in @nx/core) |
resources/email-templates/default/*.json | ~18 email templates | Loaded by Nodemailer template dir |
5. Configuration Storage
Per-merchant SLA policies, assignment rules, notification preferences/templates, and survey definitions are stored as domain tables in the
helpdeskschema (not a genericConfigurationtable). See Domain Model.