backend — Core API
The backend repo (package name nodvel) is the platform's core API server. It
is the largest service and the integration hub: clients call it, and it
orchestrates the microservices and external CRMs.
- Stack: Express 4 + Mongoose/MongoDB, Socket.IO (+ Redis adapter), built on the Nodevel framework.
- Runtime: Node 22 (container), FFmpeg installed, 6 GB heap.
- Deploy: Docker → ECR → EKS, 4 API replicas + 1 scheduler pod.
Responsibilities
- Auth & RBAC — registration, sessions, JWT, passport OAuth (Google/Facebook/
Apple), teams, branches. Authorization is
user_type+ the per-userpermissions[]array — the legacy roles/permissions layer (PermissionService,RoleController,PermissionController,populate('roles')in the bearer strategy) was removed 2026-07-20. Force logout (5939ffe37): access JWTs live 6 months and refresh tokens a year, soPOST /company/:_id/force-logout(super-admin) stampsusers.tokens_valid_fromon the owner and every member;AuthService.isRevokedrejects any token whoseiatpredates it (second resolution, so a login racing the click survives) in the bearer strategy — no extra query — and inAuthController.refreshToken. It refuses an ownerless company: with nocompany.user_idthe filter collapses to{'user_parent.parent_id': null}and would log out every web owner and super-admin. Login also seeds the identity graph with the account holder (recordAccountHolder; never fromloginAsimpersonation — see Identity Graph). The reset email subject reads "Forgot Password" (was "Forget Password"). - Tenancy & billing — companies, agencies, subscriptions, packages, add-ons, invoices (Stripe + Xero).
- Visitor identity — the identity graph:
Person/PersonProfileresolution, IP signals, enrichment. - CRM sync — through the
crmport to GoHighLevel, HubSpot, Salesforce, Jobber (+ Slack). - Realtime — the main Socket.IO server for dashboards, call/chat signalling, agent presence.
- Scheduler — ~38 cron jobs (subscriptions, reporting, CRM sync, Knox metrics).
- Orchestration — hands work to ms-ai, ms-sessions, ms-communication.
Boot flow
index.js → otel.js (Sentry/OTel) → Application.run() (Nodevel sequence) →
app/hooks.js:
boot()— middleware (file upload, body parsers, trust proxy, CORS with a 2 h preflight cache —maxAge: 7200,e9528dbc5; without it Chrome re-preflighted every ~5 s, rate limiting keyed onrequest.ip— the ingress-appended hop, never a body/header value), then loads services (Redis, Auth, Mongo, Logger, Mail, EmailQueue, CrmSync, thecrmport, provider services gated bySERVICE_*flags — Salesforce, Jobber, PlatformCrm) and the identity subsystem chain (IdentityGraphRenderer → IdentityGraphConfig → SubscriptionGate → IdentityGraph → Verifier → PersonResolver → PersonWatch), plus Knox auto-engagement and CRM enrichment. The scheduler is the last statement ofboot()— it constructs every job and starts ticking in its constructor, so anything it loads before is invisible to job constructors (see Boot order). Globals declared inhooks.jsmust matcheslint.config.mjs— the same commit keeps them in step.server()— starts Socket.IO, mounts Bull Board (/admin/queues), Sentry error handler.
Directory map
| Path | Contents |
|---|---|
app/configs/ | app/service/database/redis/AWS/Azure/CRM config |
app/controllers/ | 80+ controllers (Admin*, Agency*, AI*, Call*, Chat*, Company*, Payment*, Reporting*, …) |
app/models/ | ~70 Mongoose models (see Data Stores) |
app/routes/ | 80+ route files; api.js is the root |
app/services/ | ~45 service classes (GoHighLevelService, HubspotService, StripeService, IdentityGraphService, PersonResolverService, SocketService, SchedulerService, …) |
app/jobs/ | ~38 cron jobs |
app/lib/ | cross-service clients (msAiHandoff.js, msAiKnoxClient.js, msSessionsRecordingClient.js), ghlResilience.js, ipSignals.js |
core/ | the Nodevel framework |
eks/prod/ | K8s manifests (backend + scheduler deployments, service) |
public/ | served visitor scripts (widget.js, knock-socket.js, Twilio/ElevenLabs clients) |
Key route groups
| Area | Routes |
|---|---|
| Auth | authRoutes.js — login, signup, OAuth, refresh |
| Agency | agencyRoutes.js — multi-client mgmt, staff, packages |
| Company | CompanyRoutes.js — settings, website, FAQ, integrations |
| Chat | chatRoutes.js — messages, chatbot training |
| Calls | callRoutes.js, internalAiCallRoutes.js, aiInboundAgentRoutes.js, aiOutboundCallRoutes.js |
| Sessions | userSessionRoutes.js — visitor analytics |
| Identity | identityGraphRoutes.js, adminIdentityRoutes.js |
| CRM | goHighLevelRoutes.js, hubspotRoutes.js — webhooks + sync |
| Payments | subscriptionRoutes.js, stripeRoutes.js |
| Wallet | internalTelephonyRoutes.js (ms-ai → backend: /internal/telephony/wallet|debit|notify), GET /subscription/wallet-transactions |
| Playground | playgroundRoutes.js — public no-login sandbox + agency/admin management |
| Reporting | reportRoutes.js, statsRoutes.js, statsV2Routes.js |
| Storage | adminStorageRoutes.js — super-admin storage stats + recording cleanup proxy |
| Platform API | platformApiRoutes.js — EzyMigrate integration (three trust zones). See Platform API |
| Lead API | on userSessionRoutes.js behind leadApiAuth: /api/v1/lead/visitors, /api/v1/visitors/count (now key-required — breaking), /api/v1/lead/:user_session_id/transcript |
| SMS agents | aiSmsAgentRoutes.js — /ai-sms-agents CRUD/clone/rotate-secret/messages + public POST /ai-sms/webhook (per-agent secret) |
| Certification | certificationRoutes.js (/certification/*), adminCertificationRoutes.js (/admin/certification/*). See Certification |
| Nox activity | noxActivityRoutes.js — /nox/activity + /export (CSV) + /report |
| Push test | adminPushTestRoutes.js — super-admin push tester (/admin/push-test/*) |
| Engage | POST /user-session/:_id/engage + /engage-status — on-demand live-visitor auto-trigger |
| CRM port | schedulingRoutes.js (/scheduling/*), salesforceRoutes.js, jobberRoutes.js; migrationRoutes.js gains backfill-crm-links + crm-smoke. See CRM Integration |
| Nox config | noxConfigRoutes.js — catalog/read/apply/revert for settings-by-chat, permission-mirrored. See Nox Assistant |
| Nox tasks | NoxActionUserController — create/edit/approve/cancel every ScheduledNoxAction kind; knoxBriefUserRoutes.js GET /knox/brief (mobile) |
| Webhooks | app/configs/webhookEvents.js catalogue + WebhookQueueService (BullMQ retries) — custom webhooks and Zapier share one dispatch. See Webhooks |
| Partners | PartnerApplicationController (POST /certification/apply, PARTNER_API_KEY), app/lib/partnerInvites.js, partnerApplicants.js, certificationSettings.js |
| Ops | opsRoutes.js — Zij board, support tickets (incl. tenant POST /feedback, /support-tickets, agency /agency/client-tickets, public /public/tickets/:number), roadmap, announcements, /ops-worker/* local worker; gated by middlewares/opsAuth.js (OPS_ENABLED). See Ops workspace |
| Partner Hub | partnerHubRoutes.js — /partner-hub/* (taskers, own JWT) + /admin/partner-hub/*. See Partner Hub |
| Admin team | adminTeamRoutes.js (/admin/team/*); section gate lib/adminSections.js. See Admin overview |
| Maintenance | adminMaintenanceRoutes.js — super-admin async wrappers (/admin/maintenance/* + GET /admin/maintenance/jobs/:job_id) |
| Popups | popupRoutes.js — GET /popups/active, POST /popups/:id/event (admin alert popups) |
| Settings | SettingController — settings collection; platform switches via lib/platformSwitch.js (1-minute cache) |
Recent models worth knowing: CredentialModel (credentials — every tenant OAuth token/API key, only through CredentialVault; see Security & Secrets), CredentialKeyModel (key fingerprints), AdminAllowedIpModel (super-admin IP allowlist), Ops*Model (ops workspace), PartnerHub*Model, ProductUpdate*Model, PopupReceiptModel, VoicePreviewModel, ApiSubscriptionModel, SmsAgentMessageModel (per-send SMS-agent log;
status: 'sent' only on a Twilio message SID), ScreenedCallModel
(read-only here — ms-communication owns the collection and all writes;
index definitions must stay byte-identical across both services or Mongo
throws IndexOptionsConflict at boot), ScheduledNoxActionModel (now
kind: 'ai_call' | 'sms'), and user.push_preferences (see
Settings — Notifications).
Request and result bounds
1f2a2cf30 (2026-09-16):
- Bodies —
express.json/urlencodedcapped at 25 MB (was 1000 MB on a 2 Gi pod; one 300 MB POST peaked at 1.7 GB RSS and OOM-killed it). 25 MB is 2× the largest JSON body ever recorded. Uploads are separate:express-fileuploadstays in the backend (100 MB,useTempFiles, flat RSS). - List results —
core/http/validator.jsclamps everylimitrule to[1, MAX_LIST_LIMIT](1000) whether omitted, oversized, zero or negative. 47 of 51 filter schemas were writtenlimit: 'limit'(no:default), which parsed toNaNand meant "no limit" inprocessFilters/paginateArray— whole collections came back, and?limit=-5reached Mongo and 400'd. Controllers that usedNaNas "caller sent nothing" readquery_data.limit_defaultedinstead (live sessions still default to 50). An override setsX-Result-Limit-Capped: 1(exposed via CORSexposedHeaders); endpoints with their own documented defaultremoveHeaderit so dashboard polling doesn't warn every refetch.scripts/audit-unbounded-list-calls.js(local) lists remaining unbounded calls. paginateArraynow sorts before slicing (page 2 was never the second-best ten).GET /chats/ai-messagesuses projection + lean + a company-scopedai_conversationslookup (3.7–4.4 s → 0.6–0.9 s over 3000 chats).- Indexes added:
ai_conversations{question_id}+{company_id}(it had none),chat_queues{company_id, created_at}+{chat_id},users{online_status, online_status_at}for the 60 s offline sweep (50,025 docs examined → 52),companiesgo_high_level.location_id(every GHL native webhook resolves the tenant by location; declared after the 2026-09-17ContactTagUpdateflood — it was created by hand in prod first). - Router — the dispatch scan's
some()never returned true, so every request compared all ~1040 routes and a duplicate url+method would run every matching target; the closure now hands over its own route. - Server-Timing — when
DEBUGis true (set in the PROD backend configmap),server-timingpluslib/dbTiming.jsadddb;dur=<ms>;desc="<n> queries"anddb.slowest(duration +collection.op) to every response, via anAsyncLocalStoragetally aroundQuery/Aggregate.exec(bd38a0dae,5a3dd3401). Overlapping queries are summed, sodbcan exceedtotal. Use it to tell Mongo time from pod time on a slow endpoint. - Deleted
POST /custom-event-recorded/create(no caller in any repo, unauthenticated, andsession_idwas concatenated into a filesystem path — a../probe wrote outsidepublic/session-files/) andAuthController@logs(route long commented out).
Access control & audit
Tenant scoping is enforced per controller, not by middleware. The 2026-10-14 sweep (6c7dd2a7b, 363b0070e; specs security-hardening.spec.js, security-sweep-access.spec.js):
- Company gate —
GeneralHelper.canManageCompanyId(user, company_id)(wrapscanManageCompany: super-admin, owner/member of the owner, agency owner/staff of the company's agency). A failed check answers 404Company not found, not 403. Now applied to active/all user sessions, user sessions by id, chat leads + chat store/update/show/messages/unread/end/transfer/delete, service rooms, AI leads, page rules, bookings, session files, AI conversation update, subscription store/active, agency cards, top agents, email-send, GTM, call-limit, company stats, Calendly slots-auth, FAQs, chatbots, user show, profile image, payment retry. PUT /company/:idstripsADMIN_ONLY_COMPANY_FIELDS(ownership, agency link, billing/wallet, pause/archive, every*_allowed/*_enabledcapability gate, playground, HubSpot sync stamps, …) and prototype-pollution keys for non-admins — each of those has its own route.- Public
GET /get-user-session/:idreturns only_id, company_id, is_blocked, lead_auto_connect_threshold_reachedunless the bearer can manage the company — no visitor PII to the widget. - Public register /
POST /userstrip role and account links; the company index 403s role-less users; member delete is scoped to the caller's company. - Admin-only — package CRUD, agency conversion list/approve/reject, playground admin, error-log delete.
- Secrets — the
api_requestslog drops credential headers (auth|cookie|token|secret|api-key|signature|password|session) and[redacted]s secret-looking body keys (lib/requestRedaction.js); ManyReachapi_keyisselect:falseand preserved on company saves; the Clearbit key moved to config (CLEARBIT_SECRET_KEY). KnoxBriefUserControlleris now registered incontainer.js(GET /knox/briefwas a 500).
Hardening rollout 2026-10-27 → 11-12 (see Security & Secrets): super-admin IP allowlist in passport and every sign-in path; user_type immutable and admins never created through the app; 401s from passport carry code: 'SESSION_INVALID' and auth DB errors answer a generic 503; user endpoints no longer leak other users' secrets; GET /chats find_session scoped to the caller's company; file deletes limited to files the caller owns; private file folders + signed links (lib/fileLink.js); public playground routes refuse non-string ids; self-serve joins to an existing agency need a verified email; tenant secrets in the credential vault; Zapier/Lead API keys hashed and shown once.
Audit trail — lib/auditLog.js is a schema plugin on 39 models that records who created/updated/deleted a record, with a redacted field-level diff, into audit_logs (180-day TTL). Passport enters an AsyncLocalStorage actor context; jobs/webhooks/api-key routes log as system. When you add a model that admins or tenants edit, add the plugin and list its machine-written fields in ignore. See Audit Trail.
Scheduler & cron
Cron runs on a dedicated scheduler pod (SERVICE_CRON=true). Since 3d508d45d CronMonitor also takes a per-minute Redis claim (cron:claim:<job>:<minute>, SET NX EX 120) before every firing and manual trigger, so only one schedular replica runs it; it fails open without Redis. It is a claim, not a run lock — a run that outlives its next firing can still overlap on another replica. SchedulerService registers node-cron jobs wrapped by
CronMonitor (Redis-backed history at /admin/cron).
Staggered, wall-clock firing (c566fd28f, 2026-10-26): ScheduleRunner gives every interval job a fixed offset inside its interval (ScheduleRunner.offsetFor(className, interval) — a hash, stable across restarts and pods) and fires it when its wall-clock slot changes rather than by counting ticks. Same cadence per job, but no more 60+ jobs starting in the same second, dropped node-cron ticks don't drift a job, and a long outage yields one run, not a burst. CronMonitor's claim slot is centred on the job's offset. Expect a "15-minute" job to run at e.g. :07/:22/:37/:52, not :00/:15.
Representative jobs:
| Cadence | Jobs (examples) |
|---|---|
| 1 min | ActiveSessionJob, UserOnlineStatusJob, OutboundCallGhlSyncJob, PostCallWebhookFallbackJob, BalanceAutoRechargeJob (wallet top-up), PlatformCallCompletedWatcherJob (platform-webhook call-completed events), GhlCallNotePostJob, ScheduledNoxActionEnqueueJob (queues due scheduled calls/SMS for exact-time firing) |
| 2 min | SimproInvoiceChaseJob, TapiPollJob |
| 5 min | FactExtractionTriggerJob, AiCallGhlTranscriptSyncJob, MsAiHandoffSweeperJob, GhlCallRecordingAttachJob |
| 10 min | DailyBriefEmailJob, SubscriptionExpireJob, SubscriptionSuspensionJob, FunnelSweepJob |
| 5 min | PartnerHubOutreachJob, PartnerHubTaskNoticeJob (also PartnerHubClaimExpiryJob every 1 min, PartnerHubAgentsJob every 10 min) |
| 15 min | RecordingBackfillSweeperJob (rescue sweep — backfills failed ms-sessions handoffs), RecordingRetentionJob, ConversationPurgeJob, ArchivedAccountDeletionJob, PartnerHubLiveCheckJob |
| 1 min (admin-switched) | ArchiveEmptyChatsJob (Admin → Settings → Empty Chat Archiving), SupportInboxJob (only when SUPPORT_IMAP_HOST is set) |
| Hourly | SalesRepliesMailboxFeeJob (Nox business-mailbox connection fee), SupportAutoCloseJob, AgentKUsageEmitJob (provider usage → ms-ai cost-tracking), AgentKDailyPushJob (daily GHL push), AgentKSequenceJob (Mode B sends), AgentKLinkedInRenewalJob (idempotent per period), FunnelDailyStatsJob |
| Daily | KnoxBaselineMetricsJob (02:00), KnoxGhlSyncJob (03:00), FunnelDormancyJob (04:00), NoxFunnelReconcileJob (04:30), FunnelBackfillJob (05:00) |
| Monthly | AppSumoWalletJob (5 0 1 * * — each active AppSumo license's tier dollars into its agency or company wallet, idempotent per month) |
Cron runs in the schedular deployment, not the API pods — it has its own
configmap (Apps/PROD/schedular/configmap.yaml); provider API keys must exist in
both configmaps or cron feeders silently break. Its livenessProbe is the
DB-aware GET /healthz/db, backed by the MongoService watchdog and a
CronMonitor DB-fatal streak that exit the process on a stuck driver pool — see
Observability › Backend MongoDB self-healing.
Recent cron fixes:
FactExtractionTriggerJob(6841de3b5) — both chats queries hit the 45 s socket timeout every 5-minute run, leaving ~8M-doc scans running server-side (pendingis the default state, so the plain state index matched every chat). Partial indexfact_extraction_sweep_v1onchats(superseded by v2, below) andservice_rooms, a date floor on the opted-out retireupdateMany, andmaxTimeMS30 s on all three queries.- Empty visit chats (
abba5cf9e, 2026-10-14) — every website visit creates an empty chat that sits atfact_extraction_state: 'pending'/transcript_email_sent: falseforever (>1M pending vs ~7k with a message in prod). Both sweeps now run on partial indexes holding only chats with a message —fact_extraction_sweep_v2andtranscript_email_sweep_v4({last_message_at, created_at}; ms-communication declares the same v4,ed2f23c) — repeat thelast_message_at > HAS_MESSAGE_FLOORterm andhintthe index (118 s → 39 ms, 13–37 s → 49 ms). Fact extraction idles on quiet-since-last-message with a 7-day window; opted-out chats resolve in_processChatinstead of a collection-wideupdateMany; the transcript sweep usesfind+hintinstead ofdistinct. Older index versions are dropped by hand. - 04:00 UTC Mongo CPU spike (
3d508d45d/ac803c647) —DailyRecapEmailJobnow spreads sends over 17:00–18:59 local (company_idhash mod 120 min) so every NZ tenant isn't due on the same tick, projects only the fields the email reads, and skips companies withoutwidget_installed.FunnelDormancyJobmatchesflags.reactivation_candidate $in [false, null]on a newfunnel_contactsindex, writes flags + audit rows in batches (NoxFunnelAuditService.logMany), and drops a contact at most one stage per run (5.2 s → 0.55 s Mongo CPU locally). RecordingBackfillSweeperJob/MsAiHandoffSweeperJob(60118219c) — see Session Recording › Sweepers.AgentKLinkedInRenewalJob.run()takes an injectablenow(tests only; every production caller passes no args).
Retired this window: ReportingEmailJob is unscheduled (replaced by the Nox
daily brief) and GhlTipsEmailJob is stopped (both commented out in
SchedulerService).
External integrations
GoHighLevel (GoHighLevelService.js, ~61 KB — the biggest integration), HubSpot,
Slack, Twilio, ElevenLabs, Firebase (FCM), AWS (S3/CloudFront/ACM), Azure CDN,
Stripe, Xero, Simpro, Tapi (IMAP work-order emails), Snitcher/Apollo/Clearbit
(enrichment; HappierLeads removed 2026-09-09), Salesforce, Jobber, Calendly, Dualhook (WhatsApp), Rb2b. Each lives in
app/services/<Name>Service.js with config under app/configs/. See
CRM Integration for the sync mechanics.
Realtime
SocketService creates the Socket.IO server with a Redis adapter (in-memory
fallback for single-pod dev). Session→socket mappings live in Redis
(session_sockets:, 24h TTL); heartbeat writes are throttled via
heartbeat_status: (5m TTL). Events drive live dashboards, call status, typing
indicators, and agent availability. user-status-update (login/logout/socket
connect) goes only to the user's company room and user:<id> room
(f103726be) — it used to be broadcast to every connected client
platform-wide. Every widget socket handshake also feeds
personResolver.trackSessionIp() for mid-session IP changes.
Room auth (6c7dd2a7b): an io.use middleware (SocketService.authorizeSocket) resolves what a socket may join. The company room and user:<id> room require a valid user JWT in handshake.auth.token (the frontend sends it on every (re)connect) whose user canManageCompany the company_id in the query; a widget socket (no token) joins its own session room plus the public widget:<company_id> room, which only ever carries company-settings-updated. socket.data.session_company_id is the visitor session's real company — online-session/offline-session/heartbeat status go to that, never to a client-supplied company_id. Dashboard relays (stop-live-session, update-live-session) only work from an authorized dashboard socket, and stop-live-session checks the session belongs to its company. The /custom-event/create relay was removed. ms-communication and ms-sessions enforce the same rule (see Cross-service communication).
State pushes (RealtimeHelper, b060de28d): id-only pings that make open dashboards refetch — wallet-updated (every credit-ledger row via AICreditAuditHelper.record, agency-paid client top-ups, certification/admin grants) and company-settings-updated (Stripe webhooks, Connect client subscription updates, subscription/trial expiry crons, admin agency edits, and the notifyCompanyChanged middleware on admin feature toggles and agency client-billing routes). Company events go to the company room (settings also to widget:<id>); agencies have no room, so agency events go to the owner's and each staff user's user:<id> room. Best-effort, never throws.
Config & deployment
- Key env:
MS_AI_URL/MS_SESSION_URL/MS_COMMUNICATION_URL,MS_AI_SECRET_TOKEN,MS_COMM_API_KEY(backend → ms-communication),CRON_ENABLED/SERVICE_CRON,FILE_STORAGE,DB_*, plus per-integration credentials. Observability viaBUGSINK_DSN(Sentry) and Winston. Added 2026-09 (backend and schedular configmaps):IP_HASH_SECRET(identity-graph IP HMAC — changing it orphans everyip_hash),ORIGAMI_API_KEY,WHITE_LABEL_PORTAL_URL(portal host for white-label mail/playground links);STRIPE_CONNECT_APPLICATION_FEE_PERCENTis in the backend secret only. Watchdog knobs:MONGO_WATCHDOG_*,CRON_DB_FATAL_EXIT*,HEALTHZ_DB_TIMEOUT_MS(all defaulted). Added 2026-10 (backend and schedular):GO_HIGH_LEVEL_V2_SSO_KEY(decrypts the GHL marketplace Custom Page SSO payload —configs/goHighLevel.jssso_key),HUBSPOT_CLIENT_ID(configmap) +HUBSPOT_CLIENT_SECRET(sops secret) for the tenant HubSpot app.CLEARBIT_SECRET_KEYoverrides the in-code default. Added 2026-11:SECRET_ENCRYPTION_KEYS/SECRET_ENCRYPTION_KEY_CURRENT(keyring, legacySECRET_ENCRYPTION_KEY= v1 — identical in backend and schedular),FILE_LINK_SECRET,PARTNER_HUB_TOKEN,OPS_VIDEO_WORKER_KEY,OPS_ENABLED,SUPPORT_IMAP_*,PRODUCT_UPDATES_*,WP_CHANGELOG_*,POSTMARK_WEBHOOK_*,SERVICE_VIDEO(true only on thevideo-workerpod — see Deployment). Several env switches moved to Admin → Settings → Feature Flags (settingscollection):OPS_AGENCY_CLIENT_TICKETS,NOX_QUALITY_ENABLED,NOX_VOICE_SERVER_REPORTS. - Integration env (backend and schedular unless noted; none has a usable default, so an unset
integration stays off / returns 503):
SERVICEM8_CLIENT_ID/SERVICEM8_CLIENT_SECRET/SERVICEM8_REDIRECT_URI(falls back toBASE_URL+/servicem8/install; alsoSERVICEM8_SCOPES,SERVICEM8_OAUTH_HOST,SERVICEM8_API_BASE,SERVICEM8_HANDSHAKE_TTL);PRACSUITE_VENDOR_KEY(our vendorx-api-key) withPRACSUITE_REQUEST_TIMEOUT_MS(30000),PRACSUITE_RATE_LIMIT_MAX/PRACSUITE_RATE_LIMIT_WINDOW_MS(4 per 1000 ms — the 5/s vendor limit is shared by every clinic),PRACSUITE_SYNC_INTERVAL_MINUTES(30);MICROSOFT_CLIENT_ID/MICROSOFT_CLIENT_SECRET/MICROSOFT_REDIRECT_URI(Outlook Calendar;CalendarSyncJobrefreshes from the schedular);CALCOM_API_BASE(defaultshttps://api.cal.com/v2; the Cal.com key is per tenant, in the vault);SLACK_CLIENT_ID(configmap) /SLACK_CLIENT_SECRET(secret) — no longer defaulted in code (c583ea511);APPSUMO_API_KEY/APPSUMO_CLIENT_SECRET(backend secret only —configs/appsumo.js, plus defaultedAPPSUMO_*plan knobs). As of 2026-11-16 prod flux sets only the Slack and AppSumo ones; ServiceM8, PracSuite and Outlook stay off in prod until theirs are added. - EKS:
backend-deployment.yaml(4 replicas, 8–12 Gi mem), separateschedular-deployment.yaml(1 replica; the CronMonitor claim makes extra replicas safe),backend-service.yaml(ClusterIP). Config viabackend-cmConfigMap. Namespacekk-ns-prod. - CI:
buildspec.ymlbuilds the image, pushes to ECR, andkubectl rollout restarts the deployments. See CI/CD.