Tech stack & architecture advice for building a Porter/Uber-like intra-city logistics app? #214396
🏷️ Discussion TypeQuestion 💬 Feature/Topic AreaCode Search and Navigation BodyHey devs, I'm building an on-demand intra-city delivery/logistics platform (customer app, driver partner app, and admin dispatch panel) and wanted to get a sanity check on the architecture before locking it in. Here is what I'm currently thinking: Frontend/Mobile: React Native or Flutter for cross-platform apps, React for the admin dashboard. Backend: Node.js (Express/NestJS) with WebSockets (Socket.io) for real-time driver location updates and order state changes. Database: PostgreSQL + PostGIS (or Redis geospatial indexes) for matching nearby drivers within a radius. A few specific questions for folks who have built real-time location/dispatch systems: Location Tracking: What's the sweet spot for GPS ping intervals (e.g., every 3–5 seconds) to balance live tracking smoothness against server load and driver battery drain? Maps & Routing: To avoid getting crushed by Google Maps API billing early on, has anyone successfully used MapmyIndia (Mappls) or self-hosted OSRM for Indian addresses and accurate ETAs? Order Matching: How do you handle race conditions when broadcasting an order request to the 5 nearest drivers simultaneously so two drivers don't accept the same trip? |
Replies: 2 comments 1 reply
|
Your architecture looks solid. A few things I'd suggest:
I'd keep PostgreSQL as the source of truth and use Redis + Socket.io for temporary dispatch state and real-time communication. |
|
Welcome to the GitHub Community, @Sahaab-Ji! Since your questions are related to software architecture and technology choices for your application, I've moved your discussion to the I see you've already received some guidance from a fellow community member. Hopefully, moving your discussion to the appropriate category will help you gather additional insights from other developers. :) |
Your architecture looks solid. A few things I'd suggest:
GPS Tracking: Use adaptive intervals rather than fixed polling. 3–5 seconds during active trips is reasonable, but increase the interval when drivers are stationary to reduce battery and server load.
Maps & Routing: I'd evaluate Mappls first for Indian address coverage and routing. OSRM is a good self-hosted alternative, but requires infrastructure and OSM data maintenance. Also consider traffic-aware ETA separately.
Order Matching: Start with PostGIS for nearby-driver discovery. You can introduce Redis GEO later if query volume demands it. For concurrent order acceptance, use an atomic conditional PostgreSQL update (
WHERE sta…