Amir Ventures is a serverless, event-driven platform: a driver app and a dispatcher command center talking through a real-time cloud backend built to survive weak signal and never drop a job. This is how the 44,400+ lines fit together — and why they hold up in daily production.
Every write lands in the Realtime Database; Cloud Functions react to it and fan out to notifications, scheduling, and audit. Both apps observe the same live tree, so dispatch and driver stay in lockstep.
Each layer earns its place. Serverless where it scales, on-device where the signal dies, and deny-by-default everywhere trust matters.
53 Cloud Functions on Firebase handle dispatch, offer timeouts, reassignment, recurring reservations, notifications, and audit — no servers to patch, provision, or wake up. Logic runs where the data changes.
One live tree is the single source of truth. Every write propagates in real time to both apps, so a dispatch, a status change, or an accepted offer shows up everywhere at once — no polling, no refresh.
Phone number plus PIN, with Face ID / Touch ID for fast re-entry. Access is gated by deny-by-default rules, and dispatchers carry a custom auth claim that unlocks command-center privileges no driver can hold.
Jobs and completions are written to a disk-first queue before anything touches the network. A socket watchdog and idempotent writes mean a trip finished in a dead zone survives, deduplicates, and syncs the moment signal returns.
Job offers ship as Time-Sensitive pushes that break through Do-Not-Disturb and Focus — including the Driving Focus CarPlay enables — so drivers hear the one that matters. Multi-device tokens fan out to every phone a user carries.
Drivers upload a Zelle receipt; the platform reads the amount and auto-approves it within a set tolerance. Dispatchers only review the exceptions. Commission moves from a manual chore to a background check.
Deny-by-default database rules mean nothing is readable or writable unless a rule explicitly allows it. Storage and every path are locked to the authenticated user, and a dispatcher custom claim scopes command-center access on the server side.
Because the backend is serverless and event-driven, functions scale with demand instead of with headcount. The same architecture that runs one fleet runs many — each company gets its own isolated backend under the white-label model.
The driver app runs on iOS and Android. The dispatcher command center runs on iOS, Android, iPad, and Mac — from a phone on the road to a full desk setup — all from one Expo / React Native codebase.
One codebase, per-company brand packs, and a separate backend for each company. Colors, names, and app identities swap per brand while the engineering stays shared — new deployments inherit every fix instead of forking.
Earnings, weekly settlement, trip logs, and leaderboards are computed from the same live tree — no separate warehouse. A client database builds itself from completed trips, with CSV export for outreach.
Apps ship through Expo / EAS to the App Store and Google Play; Cloud Functions and security rules deploy to Firebase. Config-gated flags let behavior change server-side without a store rebuild, so fixes go live in the low-traffic window.
The architecture is easiest to read as a story. Here's what happens the moment a dispatcher taps Dispatch — every hop is an event, and every event is recorded.
Real numbers from a real system running for a working transportation company every day.
Every layer here is running in production right now. Book a technical walkthrough and we'll trace a real job through the stack — functions, rules, offline queue, and all.