Service Dependency Mapping

production architecture — backend dependencies & impact analysis

The graph below visualizes how internal services communicate with each other. The table shows detailed dependency pairs with risk ratings. Changes to critical services (highlighted in orange) may impact multiple downstream components. Use stoq for external event dispatch; analytics for tracking.

12
Internal Services
3
Critical
8
High Coverage
4.2ms
Avg Latency
Dependency Network
        graph LR
          UI[frontend
SPA] --> API[gateway
API Gateway] API --> AUTH[Authorization
Service] API --> USER[user
Profile] API --> CART[cart
Service] API --> ORDERS[orders
Service] API --> PAYPAL[paypal
Integration] AUTH <--> TOKEN[token
Manager] USER --> PROFILE[profile
Service] USER --> USER_API[user
API] CART --> PAYPAL ORDERS --> CART ORDERS --> PAYPAL PAYPAL --> EXTERNAL[(PayPal
external API)] analytics[analytics
Service] -.-> API stoq[stoq
integration] -.-> API EXTERNAL -.-> stoq
Request Flow
        graph LR
          UI[Frontend
Client] -->|HTTPS| API[API Gateway
Load Balancer] API -->|Route| AUTH[Authorization
Middleware] AUTH -->|Verify JWT| USER[user
Service] AUTH -->|Verify JWT| CART[cart
Service] AUTH -->|Verify JWT| ORDERS[orders
Service] USER --> PROFILE[profile
Service] CART --> PAYPAL[paypal
Integration] analytics[analytics
Service] -->|track events| API style AUTH fill:#fb923c,stroke:#c2410c style USER fill:#16a34a,stroke:#15803d style CART fill:#d97706,stroke:#b45309 style ORDERS fill:#a855f7,stroke:#7c3aed
Detailed Mapping
Upstream Service Downstream Service Operation Status
API Gateway Authorization Service Middleware: Verify JWT Healthy
API Gateway user Service GET /user/profile Healthy
API Gateway cart Service POST /cart/add Healthy
API Gateway orders Service POST /orders/create Healthy
user Service profile Service GET /profile/:id Healthy
cart Service paypal Integration POST /checkout Critical Path
orders Service cart Service POST /orders/confirm Critical Path
orders Service paypal Integration POST /refund Critical Path
API Gateway analytics Service POST /events.track Asynchronous
API Gateway stoq Integration openInlineForm / Event Stoq Event
25 dependency pairs 8 critical path · 12 healthy · 5 async
API Versioning Strategy
All internal APIs use URL path versioning with forward compatibility:

Services must support both current and previous major versions for at least 6 months. Critical dependencies (Authorization, Orders, PayPal) maintain a separate version channel. See api/versions.md for v1.2, v2.0, v3.0 support matrix.
Monitoring & Alerting
Each service emits metrics via prometheus: http_server_requests_seconds_count (request volume),
http_server_requests_seconds_max (latency),
service_health_status (operational state). stoq:restock-modal:submitted event is tracked in events table.