Skip to content

← All products

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

01 β€” Business

02 β€” Architecture

03 β€” Modules β€” the core, one folder each (see priority table below)

04–13 β€” Cross-cutting

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 WhatsApp 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_queue is the central ingestion queue; status drives 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.js startup), 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.