Skip to content

Fleet Dashboard

The Fleet Dashboard is the company-facing operations web app. Managers use it to run enrollment, fleet, trips, live operations, analysis, and reviews. Platform-owner administration remains in Filament (/admin) and is not part of this surface.

1. Responsibility and Audience

Concern Detail
Primary audience Manager role within a Company.
Primary responsibility Company operations: overview, enrollment, trips, extra cars, D2D settings, live tracking, trip analysis, and reviews.
Excluded responsibility Platform Admin company/tier administration (Filament only).
Host policy Checked out and deployed on this host.

2. Stack and Hosting

  • Stack: React + TypeScript SPA on Vite; Tailwind + shadcn/ui; TanStack Query; laravel-echo + pusher-js against Reverb; @vis.gl/react-google-maps; TanStack Table; React Hook Form; Zod; i18next + react-i18next.
  • Auth: Sanctum token auth against the API.
  • Hosting: Built to static assets and served by nginx at /dashboard on the beta host.
  • Look/feel: Teams-like look, RTL-friendly (build spec).
flowchart TD
    Manager[Manager] --> Dash[Fleet Dashboard /dashboard]
    Dash -->|Sanctum Bearer token| API[API /api]
    Dash -->|Echo/Pusher| Reverb[Reverb /reverb]
    API --> DB[(MySQL)]
    API --> Redis[(Redis)]
    Reverb --> Redis

3. Core Areas

The build spec defines these Dashboard pages/areas:

Area Responsibility Key spec/source references
Overview Company operational summary; shows seats used vs tier limit and analytics KPI overview (trips, bookings, utilization, D2D, enrollments, reviews, completion rate). Analytics Overview, Build spec §5.1, §6
Enrollment Review queue for pending Passenger requests; accept/reject; bulk actions including select by gender. Enrollment Approval
Trips Manage routes, vehicles, trips, and Driver accounts; duplicate trips; trip groups/car offerings. Trips and Cars
Extra cars Create and manage Manager-initiated extra car requests for missed/unserved Passengers. Trips and Cars
D2D settings Manage Company D2D enablement and per-member eligibility, including bulk selection by gender. D2D
Live Vehicle positions, route plan with secondary routes, boarded counts, Driver status feed. Live Tracking, Realtime Channels
Trip analysis Per-trip analysis view with map overlay and one-line reason. Trip Analysis
Reviews Passenger review list with filters by rating and trip. Reviews

4. Operational Rules

  • Company scope: All Manager data is company-scoped; company_id is derived from authenticated membership, never accepted from client.
  • Suspension: A suspended Company is blocked on the Dashboard with a clear message.
  • Realtime: Managers consume private-company.{companyId} for company live events; trip live views also require appropriate authorization.
  • Maps: Use @vis.gl/react-google-maps; maps render LTR even in RTL layouts.

5. Routes and Navigation

The implemented Trip routes are:

Path Responsibility
/trips Company Trip list, status filter, loaded-page search, pagination, Create Trip drawer, and View action.
/trips/:id Deep link to the Trip detail drawer over the Trip list.

The Trip list derives booked seats as seat_capacity - seats_left; only approved Bookings occupy Trip seats. Search is client-side over the current API page because GET /company/trips currently documents only status, page, and per_page.

The detail drawer shows Trip planning fields, seat occupancy, Bookings, Company status, and Tier max_users. Managers can approve/reject pending Bookings and cancel scheduled/in-transit Trips through /company/*. Start/Complete controls are disabled with Driver App guidance: the only documented lifecycle endpoints are /driver/trips/{id}/start and /driver/trips/{id}/complete, and they reject Manager callers.

Slice 4 does not expose NavRoute or Vehicle management/list endpoints. The Dashboard uses mock reference pickers for those missing lists only when VITE_USE_MOCKS=true; real mode accepts validated company reference IDs until the Fleet slice defines them. Approved Driver choices come from GET /company/enrollments?role=driver&status=approved. No undocumented fleet endpoint is called.

6. Open Questions

  • Fleet reference contract: NavRoute/Vehicle management and list endpoints, including their resource fields and Manager authorization, remain future Fleet-slice work.
  • Overview metrics: Beyond seats used vs tier limit, the exact overview KPIs/cards are not specified.
  • Role granularity: Build spec describes Manager use; whether read-only/support roles exist in Dashboard is not specified.
  • D2D settings placement: D2D settings are listed as a page/area; exact information architecture within Dashboard is an implementation detail to confirm.