Skip to main content

Transport

A school's transport setup is three lists: Buses, Drivers, and Routes. A route is a sequence of stops between two endpoints. A bus is the physical vehicle, with a registration plate, an assigned route, and an assigned driver. The student app uses this same setup to render live bus tracking.

At a glance

Who can do thisAdmins & sub-admins with transport permission
Where it livesAdmin panel → /dashboard/school/:id/transport (default tab bus) · sub-tabs bus, driver, route
Touches which appsAdmin (CRUD) · Student app (live tracking under /bus-page)
Related featuresBus Tracking · Student Details

How it flows

The three sub-entities

The Transport page is a tabbed view backed by three independent lists. Each tab is a DataTable with search, pagination, view-detail modal, and create/delete actions.

Routes (tab route)

A route is a named path with an origin, a destination, and an ordered list of stops in between.

FieldRequiredNotes
Route Name / IDyesE.g. "North Sector Express"
Origin PointyesFree-text landmark or station
Final DestinationyesFree-text landmark or station
Stops(read-only in the create modal)Shown in the detail view as a Timeline with sequence numbers

The route detail modal renders a vertical timeline: green dot at origin → grey dots for each intermediate stop with Stop #n → red flag at destination.

Deleting a route is called "Retire route" in the UI. The confirm dialog warns that all associated mapping is removed.

Drivers (tab driver)

A driver is a person record. The detail modal calls itself a "Staff Dossier".

FieldRequiredNotes
Full Legal Nameyes
Direct Contact NumbernoPhone, free-form
Commercial License IDnoLicense number
Profile Photo URLnoURL to an external image

Deleting a driver is called "Remove Staff Record". Doing so does not automatically clear the driver from a bus that referenced them — the bus's driver field must be re-assigned by editing/re-registering the bus.

Buses (tab bus)

The unit of physical fleet. The detail modal calls itself "Vehicle Intelligence".

FieldRequiredNotes
Registration Plate NumberyesE.g. "DL 01 AB 1234"
Assign RoutenoDropdown of routes for this school
Assign DrivernoDropdown of drivers for this school
Current StatusyesOne of available, on_route, maintenance. Defaults to available

The bus list also surfaces a real-time ETA column (in minutes) that's pushed from the live tracking layer — this isn't something the admin types in.

Deleting a bus is called "Decommission Vehicle".

Step-by-step: setting up transport from scratch

1. Create the routes first

  • Tab: Route
  • Click "Blueprint Route" → fill name + origin + destination → save.
  • Repeat for every route the school operates.

2. Add drivers

  • Tab: Driver
  • Click "Enlist Personnel" → fill name (required) + optional phone, license, photo → save.
  • Tab: Bus
  • Click "Add Vehicle" → fill plate (required) → pick a route (optional) → pick a driver (optional) → set status → save.
  • Once a bus has a route + driver, it's ready to be tracked.

4. (Implicit) Students get linked via their section/profile

Students are not assigned to a route from the transport page itself. The link runs through the student's profile (and, in practice, through the section/class they belong to). On the student app, the bus-tracking surface picks up the bus configured for the route the student is assigned to and shows its position and ETA.

How buses, drivers, routes relate

A route can exist without a bus. A driver can exist without a bus. A bus can technically exist without either, but it won't be useful for tracking.

Edge cases & things to test

  • Delete a driver who's assigned to a bus — the bus row keeps the now-stale driverId. The detail modal should fall back to "No driver assigned" in the dropdown lookup. Verify nothing crashes.
  • Delete a route that's assigned to a bus — same as above; the bus loses its route link. Verify the bus detail modal handles missing route gracefully.
  • Two buses on the same route — should both be allowed and both should show up for students whose section is on that route.
  • Two drivers assigned to the same bus — not possible; the bus form has a single driverId. Confirm the dropdown is single-select, not multi.
  • Mobile vs desktop — every sub-tab has a mobileRender card layout. Resize and verify search, pagination, view, and delete actions all work on a narrow viewport.
  • Deep link to a tab/dashboard/school/:id/transport/bus, /transport/driver, /transport/route should all open the correct tab. /transport with no tab should redirect to /transport/bus.
  • Status maintenance — a bus marked maintenance should still be visible in admin lists. Check whether the student app hides or shows buses in this status.
  • ETA column for a bus with no live signal — the column should render N/A, not crash.
  • Search on a long list — search should debounce and re-fetch from page 1, not append.
  • Pagination — change page size, navigate forward/back, then search; the page should reset to 1.
  • Permission: a sub-admin without transport permission should not see the Transport entry in the school sidebar at all (cf. Sub-admin access control).