How nguyenlinhit-cpu/diennuocroot works
Điện Nước Root connects customers and repair workers through customer/worker Flutter apps, a Flutter web admin, and a Rust API. The main workflow is service and worker discovery, booking, job coordination, and payment; the product also supports account access, worker verification, messaging, complaints, support, and operations dashboards. The graph follows documented app/API responsibilities and sampled backend routes and handlers. Several UI and backend subsystems are represented from the tree and README rather than inspected source, so their internal wiring is shown only where documented.
Main entry points: routes.rs HTTP and WS routes · screens Customer and worker app · chat/handlers.rs Booking chat · booking/handlers.rs Booking lifecycle
Components 23
User applications
- Customer and worker app
app/lib/ui/screens - Mobile API services
app/lib/core/api_client.dart - Admin portal
admin/lib/screens - Admin API client
admin/lib/api.dart - Worker screens
app/lib/ui/screens/worker
API and domain
- HTTP and WS routes
backend/src/routes.rs - Accounts and auth
backend/src/auth/handlers.rs - Services and areas
backend/src/catalog/handlers.rs - Worker discovery
backend/src/workers/handlers.rs - Booking lifecycle
backend/src/booking/handlers.rs - Booking chat
backend/src/chat/handlers.rs - Payment and invoice
backend/src/payments/handlers.rs - File uploads
backend/src/upload.rs
Operations
- Admin operations
backend/src/admin/handlers.rs - Complaints and support
backend/src/admin/handlers.rs
Runtime state
- PostgreSQL
- Redis
- OpenStreetMap
- ZaloPay and Momo
- Firebase messaging
Other components
- Customer
- Repair worker
- Administrator
Connections 31
- Customer → Customer and worker app: uses
- Repair worker → Customer and worker app: uses
- Administrator → Admin portal: uses
- Customer and worker app → Mobile API services: requests
- Mobile API services → HTTP and WS routes: calls API
- Admin portal → Admin API client: requests
- Admin API client → HTTP and WS routes: calls API
- HTTP and WS routes → Accounts and auth: dispatches auth
- HTTP and WS routes → Services and areas: dispatches catalog
- HTTP and WS routes → Worker discovery: dispatches discovery
- HTTP and WS routes → Booking lifecycle: dispatches bookings
- HTTP and WS routes → Booking chat: dispatches chat
- HTTP and WS routes → Payment and invoice: dispatches payments
- HTTP and WS routes → File uploads: dispatches uploads
- HTTP and WS routes → Admin operations: dispatches admin
- HTTP and WS routes → Complaints and support: dispatches support
- Customer and worker app → OpenStreetMap: displays maps
- Worker screens → Mobile API services: requests
- Accounts and auth → PostgreSQL: reads/writes accounts
- Services and areas → PostgreSQL: reads catalog
- Worker discovery → PostgreSQL: reads/writes workers
- Booking lifecycle → PostgreSQL: reads/writes bookings
- Booking lifecycle → Booking chat: publishes status
- Booking chat → PostgreSQL: stores messages
- Booking chat → Redis: uses cache
- Payment and invoice → PostgreSQL: reads/writes payments
- Payment and invoice → ZaloPay and Momo: initiates payment
- File uploads → PostgreSQL: stores metadata
- Admin operations → PostgreSQL: reads/writes operations
- Complaints and support → PostgreSQL: reads/writes cases
- Worker screens → Firebase messaging: receives alerts