Architecture: Where should platform notification infrastructure live — bac...

Documentation for Sessions

🏗️ Architecture: Where should platform notification infrastructure live — bac...

Date: 2026-03-19
Time: 17:50:40 UTC
Session: gspace1-241.2
Agent: backend
Confidence: 92%
Status: ✅ Documented


📋 Decision Context

Question:

Where should platform notification infrastructure live — backend-api, backend-vitto-api, or a new microservice?

Task: Design notification system architecture for GoGrab platform


🎯 Decision Made

Chosen:

Keep all platform notification infrastructure (ProactiveDispatcherService, ChannelGatewayService, scheduled queue, proactive triggers) in backend-vitto-api. Add a NotificationBridgeClientService in @libs-api/messaging-core and an internal endpoint on vitto-api for other backends to trigger notifications.

Options Considered:

  1. Move notification infrastructure to backend-api (large refactor)
  2. Create a dedicated notification microservice (backend-notification-api)
  3. Keep in vitto-api with bridge client in messaging-core (chosen)

💭 Reasoning

Vitto is the sole originator of every platform notification today. Moving 6 services, 3 schemas, and 14 endpoints to backend-api would introduce a distributed coordination problem (HTTP calls for every dispatch) with zero operational benefit — the system works, has no bugs from this architecture, and the team isn't confused. The only gap was that backend-api had no way to trigger notifications (3 commented-out billing stubs). A thin bridge client (~50 lines) in messaging-core + one internal @ServiceOnly endpoint on vitto-api solves this without refactoring working code. ProactiveDispatcherService's safety guards (quiet hours, frequency cap, dedup) remain in-process with zero additional failure modes.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation