MealRoute – Secure Logistics Platform
GitHubProduction-style logistics system with secure authentication, RBAC, and real-time synchronization for food delivery operations.
Overview
MealRoute is a fleet management and logistics platform designed with security as a primary requirement, ensuring that sensitive customer data and driver locations are strictly compartmentalized.
The Problem
Unauthorized access risks and data leakage across multi-tenant delivery operations.
System Architecture
React frontend interfacing with a Firebase backend. Utilizing Firestore for real-time location syncing and Firebase Cloud Functions for secure business logic.
Engineering Trade-offs
Chose Firebase for rapid development of real-time features, accepting the risk of vendor lock-in and potential scalability costs.
Lessons Learned & Future
Production Learnings
Writing robust Firestore Security Rules is essentially writing a secondary layer of backend logic; it requires rigorous unit testing to prevent accidental data exposure.
Future Improvements
Migrating the routing algorithm to a custom backend service to optimize delivery paths based on historical traffic data.
Database Layer
Firestore (NoSQL) with complex Security Rules to enforce row-level access control based on user claims.
API Design
Event-driven architecture using Cloud Functions triggered by Firestore document writes to handle order state transitions securely.
Security Decisions
1. Implemented Custom Custom Auth Claims to enforce RBAC directly in Firestore Security Rules, preventing client-side spoofing. 2. Driver locations are ephemeral and deleted after order completion.
Scale & Metrics
Location updates sync across all clients in under 300ms.