Skip to content

Configuration

Identity is sourced from src/resources/app-info.json (via getAppInfo()), not from .env.development. App config is built by createAppConfig() from @nx/core. Env naming follows the core APP_ENV_* convention.

1. Environment Variables

Identity (authoritative vs. env)

Propertyapp-info.json (authoritative).env.development (stale)
Application codeSVC-00120-HELPDESKSVC-00120-HELPDESK ✓ now matches (was SVC-00030-HELPDESK)
Port3113031032
Snowflake node id120
Base path/v1/api/helpdesk/v1/api/helpdesk

Identity drift. Treat app-info.json as the source of truth. .env.development should be reconciled to SVC-00120 / 31130 / 12 when the build is repaired. Do not rely on the .env identity values.

Core runtime

NameTypeDefaultRequiredDescription
RUN_MODEstartup|worker|migratestartupProcess role
NODE_ENVstringEnvironment selector
APP_ENV_APPLICATION_CODEstringfrom app-infoShould be SVC-00120-HELPDESK
APP_ENV_SERVER_PORTnumber31130HTTP listen port
APP_ENV_SERVER_BASE_PATHstring/v1/api/helpdeskRoute prefix
APP_ENV_SNOWFLAKE_WORKER_IDnumber12Snowflake node id
APP_ENV_SNOWFLAKE_EPOCH_CHECKPOINTnumber1735689600000Snowflake epoch

Database

NameTypeRequiredDescription
APP_ENV_POSTGRES_*string/numberPostgres connection (host/port/db/credentials) via PostgresCoreDataSource

Redis (cache + BullMQ + WebSocket pubsub)

NameTypeDescription
APP_ENV_CACHE_REDIS_MODEcluster|standaloneCache Redis mode (cluster in dev)
APP_ENV_CACHE_REDIS_IDENTIFIERstringe.g. cache
APP_ENV_CACHE_REDIS_PASSWORDstringAuth
APP_ENV_CACHE_REDIS_CLUSTER_NODESstringComma-separated host:port cluster nodes
APP_ENV_WEBSOCKET_REDIS_*Separate Redis identifier (ws) for WebSocket pubsub

Mail (Nodemailer)

NameTypeDescription
APP_ENV_MAIL_HOSTstringSMTP host (e.g. smtp.gmail.com)
APP_ENV_MAIL_PORTnumbere.g. 465
APP_ENV_MAIL_SECUREbooleanTLS
APP_ENV_MAIL_USER / APP_ENV_MAIL_PASSWORDstringSMTP credentials
APP_ENV_MAIL_FROM_NAME / APP_ENV_MAIL_FROM_MAILstringFrom identity
APP_ENV_LOCAL_TEMPLATE_DIRstringEmail 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.

NameDefault (fallback)Description
APP_ENV_SUPPORT_MANAGER_EMAILhuy.pham@nexpando.comEscalation manager recipient
APP_ENV_SUPPORT_LEADERSHIP_EMAILhuy.pham@nexpando.comLeadership recipient (critical)
APP_ENV_SUPPORT_ESCALATION_SLACK#support-escalationsEscalation Slack channel
APP_ENV_SUPPORT_CRITICAL_SLACK#support-critical-escalationsCritical Slack channel

2. Feature Flags

Declared in app-info.json features (descriptive capability flags; not runtime kill-switches).

FlagValueCapability
ticketingtrueTicket management
slaManagementtrueSLA tracking + escalation
knowledgeBasetrueArticles + feedback
surveystrueCSAT surveys
analyticstrueAnalytics (queue name reserved, no worker wired)
contextEnrichmenttrueOrder/product enrichment
autoAssignmenttrueRule-based assignment

3. SLA / Worker Tuning Constants

Compile-time constants in src/shared/common/constants/common.constant.ts.

ConstantValue
WORKER_CONFIG.SLA_MONITOR_INTERVAL*/1 * * * * (every minute)
WORKER_CONFIG.SLA_BATCH_SIZE100
SLA_WARNING_THRESHOLDSYELLOW 75 / ORANGE 90 / RED 100 / CRITICAL 150
SLA_DEFAULTS (by priority 10/20/30/40/50)response/resolution minutes per tier
ESCALATION_TIMINGL1→L2 45m, L2→L3 75m
COMPENSATION_MATRIXper tier (STANDARD/PREMIUM/VIP) × severity → amount
SYSTEM_ORGANIZER_ID / SYSTEM_MERCHANT_ID0000-0000-0000-0000

4. Seeded Data

Migration processes in src/migrations/processes/ — run via RUN_MODE=migrate. Default email templates ship as JSON under src/resources/email-templates/default/ (ticket lifecycle, SLA warning/breach, escalation levels, assignment, compensation, after-hours).

SourceSeedsNotes
migrations/processes/migration-process.tsDrizzle migration processesSchema migrations (centralized models in @nx/core)
resources/email-templates/default/*.json~18 email templatesLoaded 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 helpdesk schema (not a generic Configuration table). See Domain Model.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.