How abdulrahmnh/revora works
Mujaser is an embedded Salla revenue-intelligence product. Its merchant loop is to establish a store session, assess data readiness, present a prioritized opportunity, record a merchant decision and any WhatsApp handoff truth, then measure completed-order observations and report observed value with conservative attribution. The three documented engines cover abandoned carts, lost customers, and second purchases. The tree and excerpts support the main API, integration, and engine boundaries; detailed persistence and worker dispatch wiring is not fully sampled, so uncertain links are omitted.
Main entry points: client.ts PostgreSQL access · sync-service.ts Salla integration · page.tsx Embedded app · merchant-decision-loop.ts Decision and action
Components 26
Merchant experience
- Embedded app
apps/web/src/app/app/embedded/salla/page.tsx - Session API
apps/web/src/app/api/session/salla-embedded/route.ts
Store foundation
- Embedded session
packages/core/src/auth/salla-embedded-session.ts - Salla integration
packages/core/src/integrations/salla/sync-service.ts - Readiness API
apps/web/src/app/api/readiness/route.ts - Data readiness
packages/core/src/readiness/data-readiness-service.ts - Merchant stage API
apps/web/src/app/api/merchant-stage/route.ts - Merchant stage
packages/core/src/merchant-stage/merchant-stage-service.ts - Cart ingestion
packages/core/src/integrations/salla/abandoned-cart-ingestion-service.ts
Opportunity lifecycle
- Cart recovery engine
packages/core/src/opportunities/abandoned-cart-recovery-engine.ts - Lost customer engine
packages/core/src/opportunities/lost-customer-recovery-engine.ts - Second purchase engine
packages/core/src/opportunities/second-purchase-engine.ts - Opportunity feed API
apps/web/src/app/api/opportunities/route.ts - Prioritized feed
packages/core/src/opportunities/opportunity-feed.ts - Opportunity actions
apps/web/src/app/api/opportunities/[opportunityId]/actions/route.ts - Decision and action
packages/core/src/opportunities/merchant-decision-loop.ts - WhatsApp handoff
packages/core/src/opportunities/whatsapp-action.ts
Measurement and operations
- Background worker
apps/worker/src/index.ts - Outcome observation
packages/core/src/observation/factual-outcome-observation.ts - Attribution receipts
packages/core/src/opportunities/opportunity-attribution-receipts.ts - Value and insights
packages/core/src/analytics/impact-ledger-service.ts - Notifications API
apps/web/src/app/api/notifications/route.ts - Notification service
packages/core/src/notifications/notification-service.ts - PostgreSQL access
packages/core/src/database/client.ts
Other components
- Merchant
- Salla
Connections 29
- Merchant → Embedded app: opens
- Embedded app → Session API: requests session
- Session API → Embedded session: creates session
- Salla → Session API: provides token
- Salla → Salla integration: provides store data
- Background worker → Salla integration: runs sync
- Salla integration → PostgreSQL access: stores synced data
- Readiness API → Data readiness: assesses
- Data readiness → PostgreSQL access: reads store data
- Merchant stage API → Merchant stage: gets stage
- Merchant stage → PostgreSQL access: reads store state
- Salla integration → Cart ingestion: ingests carts
- Cart ingestion → PostgreSQL access: upserts carts
- Cart recovery engine → PostgreSQL access: reads and saves
- Lost customer engine → PostgreSQL access: reads and saves
- Second purchase engine → PostgreSQL access: reads and saves
- Opportunity feed API → Prioritized feed: loads feed
- Prioritized feed → PostgreSQL access: reads opportunities
- Embedded app → Opportunity feed API: requests opportunities
- Merchant → Opportunity actions: submits decision
- Opportunity actions → Decision and action: records action
- Decision and action → PostgreSQL access: persists action
- Decision and action → WhatsApp handoff: creates handoff
- Merchant → WhatsApp handoff: confirms execution
- Outcome observation → PostgreSQL access: records observations
- Attribution receipts → PostgreSQL access: records receipts
- Value and insights → PostgreSQL access: reads outcomes
- Notifications API → Notification service: reconciles and loads
- Notification service → PostgreSQL access: reads and writes intents