How siwarattia6191/smart-delivery-ops works
Smart Delivery Ops is a multi-tenant food-delivery operations platform with an API-driven order-to-delivery workflow and an AI operations copilot. A customer submits an order; the backend resolves delivery location, prices it, matches a driver, estimates ETA, and records lifecycle events. Payments, reviews, restaurant operations, bulk onboarding, analytics, forecasting, and event export form related product branches. The graph reflects documented capabilities and sampled source references; some route-to-service wiring and unsampled subsystems are documented only at the product level, so those relationships cite the README rather than implying source inspection.
Main entry points: main.py Operations API · order_service.py Order lifecycle · database.py Tenant data store · graph.py Copilot agent
Components 28
Delivery operations
- Order lifecycle
domain/services/order_service.py - Address and routing
domain/services/geocoder.py - Distance rules
domain/rules/geo.py - Pricing and coupons
domain/services/pricing_service.py - Driver matching
domain/services/driver_matching_service.py - ETA estimation
domain/services/eta_model_service.py - Payment settlement
domain/services/payment_service.py - Restaurant and menu
apps/api/routes/restaurants.py - Order reviews
domain/services/review_service.py
API and tenancy
- Operations API
apps/api/main.py - Auth and tenant scope
apps/api/tenancy_middleware.py - Tenant services
domain/services/tenant_service.py - Tenant data store
core/database.py
AI copilot
- Copilot endpoint
apps/api/routes/copilot.py - Copilot agent
apps/copilot/graph.py - Read-only tools
apps/copilot/tools.py - RAG retrieval
apps/copilot/retriever.py - Knowledge ingestion
apps/api/routes/knowledge.py
Data and intelligence
- Event relay
apps/worker/relay.py - Analytics warehouse
dags/warehouse_daily_build.py - Operational analytics
apps/api/routes/analytics.py - Demand forecasting
ml/pipelines/forecast_demand.py
Restaurant onboarding
- Bulk import
domain/services/import_service.py - Onboarding wizard
apps/api/routes/onboarding.py
Other components
- Customer
- Kafka
- MLflow registry
- Operations user
Connections 29
- Customer → Operations API: places order
- Operations API → Auth and tenant scope: scopes requests
apps/api/main.py - Auth and tenant scope → Tenant services: sets tenant context
domain/services/tenant_service.py - Operations API → Order lifecycle: handles lifecycle
- Order lifecycle → Address and routing: resolves address
domain/services/order_service.py - Order lifecycle → Pricing and coupons: quotes delivery
domain/services/order_service.py - Order lifecycle → Driver matching: matches driver
domain/services/order_service.py - Order lifecycle → ETA estimation: estimates arrival
domain/services/order_service.py - Address and routing → Distance rules: checks road distance
- Order lifecycle → Tenant data store: stores lifecycle
domain/services/order_service.py - Operations API → Payment settlement: settles payment
- Operations API → Restaurant and menu: serves restaurant portal
apps/api/main.py - Operations API → Order reviews: accepts ratings
- Order reviews → Tenant data store: reads and writes
domain/services/review_service.py - Order lifecycle → Kafka: publishes events
- Event relay → Kafka: relays outbox events
- Kafka → Analytics warehouse: feeds raw layer
- Operations API → Operational analytics: serves KPI queries
apps/api/main.py - Analytics warehouse → Operational analytics: provides analytics data
- Demand forecasting → Tenant data store: stores forecasts
- MLflow registry → ETA estimation: serves registered model
domain/services/eta_model_service.py - Operations user → Copilot endpoint: asks question
- Copilot endpoint → Copilot agent: runs supervisor
- Copilot agent → Read-only tools: dispatches tools
- Copilot agent → RAG retrieval: retrieves knowledge
- Knowledge ingestion → Tenant data store: stores tenant documents
- Operations API → Bulk import: imports client data
- Onboarding wizard → Operations API: submits setup
apps/api/main.py - Bulk import → Address and routing: geocodes addresses
domain/services/import_service.py