uEngage Prism β Engineering Knowledge Base & Learning Portal¶
What this is: the complete technical + business knowledge base for the uEngage Prism platform (F&B customer-engagement / CRM). Built by correlating the Product Manager's feature spec against the actual code in two repositories. Every claim is grounded in real files, classes, tables, routes and functions β never generic.
Who it's for: new joiners, developers switching modules, QA, support engineers, and AI/RAG retrieval.
π Start here¶
| You are⦠| Go to |
|---|---|
| Brand new to Prism | New Joiner Learning Path (4 weeks) β then System Overview |
| Setting up locally | Local Setup |
| Trying to understand the product | Product Overview Β· Business Flow Β· Glossary |
| Understanding the architecture | High-Level Architecture Β· Request Lifecycle |
| Debugging a production issue | Debugging Β· Common Issues |
| An AI assistant | Every page has front-matter (tags, keywords, related, difficulty) for retrieval. Start with this index + System Overview. |
π§ The two-repository platform¶
Prism is built from two repos that share one MongoDB database (uengage):
| Repo | Path | Role | Stack |
|---|---|---|---|
| uengage-crm (this repo) | /uengage-crm |
The monolith β APIs, dashboards, campaigns, loyalty, membership, feedback, 91 crons, 57 controllers | Node.js, Express, MongoDB (Mongoose), MySQL (2 pools), Redis, Socket.IO, Winston |
| prism-services | /prism-services |
Serverless edge β high-throughput order ingestion + WhatsApp send/receipts | AWS Lambda (Node 22), Kafka (MSK), MongoDB |
flowchart LR
subgraph Edge["prism-services (Lambda + Kafka)"]
API[orders-api] --> K[(Kafka MSK)]
K --> CONS[orders-consumer]
WA1[whatsapp api-send] --> K
K --> WA2[whatsapp consumers]
end
subgraph Mono["uengage-crm (Express monolith)"]
R[Routes] --> CTRL[Controllers]
CTRL --> SVC[commonFunctions / processLibrary]
CRON[91 Crons] --> SVC
end
CONS --> Q[(MongoDB: crm_queue)]
API2[monolith ingestion controllers] --> Q
Q --> CRON
SVC --> MONGO[(MongoDB uengage)]
SVC --> MYSQL[(MySQL addo_*)]
SVC --> REDIS[(Redis ElastiCache)]
β οΈ Both repos independently write to the same
crm_queueβ a known duplication/consistency risk. See Technical Debt.
π Knowledge Base map¶
00 β Getting Started¶
- System Overview β the 10-minute technical mental model
- Local Setup β run it on your machine
- Project Structure β where everything lives
01 β Business¶
02 β Architecture¶
03 β Modules β the core, one folder each (see priority table below)¶
04β13 β Cross-cutting¶
- 04 Database Β· 05 API Β· 06 Queues Β· 07 Caching Β· 08 Security Β· 09 Third-Party Β· 10 Deployment Β· 11 Debugging Β· 12 Best Practices Β· 13 Common Issues
14β15 β Learning¶
π― Module priority & build status¶
Modules are prioritized by centrality to the orderβintelligenceβactionβROI spine and by how often engineers touch them. KB status = how complete this documentation is.
| Priority | Module | Why it matters | Primary code | KB status |
|---|---|---|---|---|
| P0 | Order Ingestion | Everything starts here; multi-source; both repos | controllers/*OrderIngestion.js, prism-services |
π’ complete |
| P0 | Customer / CRM | Customer 360, the unified profile | customerController.js, customerInsightsController.js |
π’ complete |
| P0 | Campaigns | Core revenue driver; 3 pipelines | campaignController*.js, processLibrary/campaign* |
π’ complete |
| P0 | Loyalty | Points, tiers, ledger; dual-store | loyaltyController.js, handleWalletPointsFlow.js |
π’ complete |
| P0 | Queues & Background Jobs | 91 crons; the async backbone | crons/, commonFunctions/*Queue.js |
π’ complete |
| P1 | Automated Journeys | 8 event-driven automations | automatedCampaignController.js, processAutomatedCampaigns.js |
π’ complete |
| P1 | Customer Intelligence / RFM | Segmentation, 37 filters | rfmController.js, crons/rfmSegments.js |
π’ complete |
| P1 | Dashboard & Analytics | The client-facing numbers | dashboardControllerNew.js, processLibrary/aggregationProcess.js |
π’ complete |
| P1 | Primary channel; Gupshup + Meta | gupshupOnboardingController.js, metaTSP.js |
π’ complete | |
| P1 | Membership | Paid plans | rewards/loyalty controllers | π’ complete |
| P2 | Wallet Β· Feedback & NPS Β· Digital Bills Β· SMS & Push Β· Fraud Β· Referral Β· Admin/Business | Supporting modules | various | π’ complete |
π΄ planned Β· π‘ in progress Β· π’ complete β all modules are now π’. See Documentation Progress.
π Documentation conventions¶
Every module doc follows the same 15-section template: Overview Β· Business Flow Β· Technical Flow Β· Architecture Diagram Β· Folder Structure Β· Database Β· APIs Β· Code Walkthrough Β· Business Rules Β· Performance Β· Logging Β· Monitoring Β· Troubleshooting Β· FAQs Β· Cheat Sheet β then Assessments and Assignments.
Every page carries YAML front-matter for search/RAG:
tags: [...] keywords: [...] related: [...]
prerequisites: [...] difficulty: Beginner|Intermediate|Advanced
reading_time: N min
Validation legend used throughout (per the user's validation rules): - β Verified in code β confirmed against actual files - π Excel-only β in the PM spec but not (yet) found in code - π» Code-only β exists in code but not in the PM spec - β»οΈ Duplicate β multiple implementations of the same thing - β°οΈ Dead/legacy β appears unused - β οΈ Tech debt / risk
π Platform facts every engineer must know¶
- Multi-tenancy =
parent_business_id(brand/HQ) +child_business_id(outlet). Nearly every query is scoped by these. - Customer identity = 10-digit mobile number, the universal key across MongoDB and MySQL.
- Dual datastore: MySQL (
addo_*transactional β orders, users, wallet, promo) + MongoDB (uengageβ queues, MIS/aggregates, campaigns, events). Bridged by the mobile number and business ids. crm_queueis the central ingestion queue;statusdrives its state machine.- Loyalty points span both stores (MongoDB + MySQL
crm_points_allocation_queue) without atomic transactions β β οΈ a key correctness risk. - 91 crons run in-process inside the monolith (loaded at
index.jsstartup), managed by PM2 (crm_ecosystem.config.js). - Known security debt: hardcoded JWT secrets, ingestion tokens, Redis host, and committed credentials (
.env.dev, serverless YMLs). See Security.
π Documentation Progress¶
- Phase 0 β Codebase + Excel analysis, code maps
- KB skeleton + this index
- 01-Business (Overview, Flow, Terminologies, Roadmap)
- 00-Getting-Started (System-Overview, Local-Setup, Project-Structure)
- 02-Architecture (High-Level, Request-Lifecycle, Folder-Structure, Module-Architecture)
- 04β13 cross-cutting (Database, API, Queues, Caching, Security, ThirdParty, Deployment, Debugging, BestPractices+TechDebt, CommonIssues+KnownBugs)
- 03-Modules β all 16 modules (full 15-section template + L1βL5 assessments + assignments)
- 14β15 learning path & assessments (4-week roadmap, interview bank, 5-level assessments, assignments)
Status: v1 complete β 55 documents. Internal cross-links verified (804 links checked). Docs validate the PM Excel against real code; discrepancies flagged inline (see the validation legend).
Last updated: 2026-07-04.