Admin web portal for managing a professional chauffeur business: dispatch, bookings, fleet, drivers, billing, company configuration and reporting. Built on Next.js 16 + React 19 + Tailwind v4 + shadcn/ui, backed by Firebase, and aligned 1:1 with the existing iOS app's Firestore schema.
- Next.js 16 (App Router) · React 19 · TypeScript
- Tailwind CSS v4 · shadcn/ui (ported primitives)
- Firebase: Authentication, Cloud Firestore, Realtime Database (live locations), Admin SDK (server-side session cookies + role gate)
- react-map-gl / Mapbox for the live Dispatch map
- Recharts for reporting · TanStack Table patterns for data grids
| Route | Purpose |
|---|---|
/dashboard |
Operations overview (KPIs, bookings trend, upcoming trips) |
/dashboard/dispatch |
Live map of driver positions (RTDB) + active trips |
/dashboard/bookings |
Trip lifecycle management |
/dashboard/drivers |
Chauffeur management & compliance |
/dashboard/fleet |
Vehicle management (keyed to chauffeurs) |
/dashboard/billing |
Invoices (new invoices collection) |
/dashboard/company |
Overview · Operating Hours · Locations · Pricing |
/dashboard/reports |
Client-side aggregation over trips & invoices |
/dashboard/settings |
Branding · Locale · License · Admins · Integrations |
- Install dependencies (Node 20+):
npm install --legacy-peer-deps- Copy env and fill in values:
cp .env.example .env.local- Run the dev server:
npm run devThe portal is admin-only. Sign in requires a Firebase Auth account whose
users/{uid} document has role == "admin".
TypeScript types and helpers in lib/models/ mirror the iOS Swift Codable models.
Firestore collections: users, trips, vehicles, locations, invoices, and the
app_settings documents (pricing, limits, branding, integrations) and operator
documents (company, locale, operating_hours).
The Dispatch map reads liveLocations/{driverId} from Realtime Database. The iOS
driver app dual-writes GPS to RTDB in the shape:
{ lat, lng, heading?, status?, tripId?, updatedAt }.
Set every variable from .env.example in Project Settings → Environment Variables.
FIREBASE_SERVICE_ACCOUNT_KEY must be the base64-encoded service-account JSON and
must NOT be prefixed with NEXT_PUBLIC_.
firestore.rules— admin-gated Firestore accessstorage.rules— profile photo uploads underusers/{uid}/database.rules.json— RTDB live-location rulesfirestore.indexes.json— composite indexes
Deploy with the Firebase CLI:
firebase deploy --only firestore:rules,firestore:indexes,storage,database