RoadStar DispatchOS is a unified Southern Ontario dispatch workspace. It combines manual dispatch, multi-load trip consolidation with trailer-capacity and appointment checks, explainable fleet-wide planning, practical Canadian HOS checks, live track-and-trace, geofences, automated detention, a focused driver workflow with its own paperwork tab, and stop-aware 3D trailer loading.
A load can be dispatched as its own trip or consolidated onto a truck that still has room. Before anything is committed, RoadStar re-sequences the trip's stops and shows the added distance, the added on-duty time, how far apart the delivery points are, the resulting weight and pallet-position fill, and the driver's remaining hours.
Requirements: Node.js 22+ and a Supabase project for cloud synchronization. A JDK 17+ is optional: it enables the xflp loading solver, and without one the app falls back to the browser load planner.
Every script is plain Node and runs on Linux, macOS, and Windows. The solver finds a JDK through JAVA_HOME, then PATH, then the platform's standard install locations, so a JDK that was never added to PATH still works.
npm install
cp .env.example .env.local # Windows: copy .env.example .env.local
npm run dev:fullOpen http://localhost:5173. npm run dev runs the web app alone with browser fallbacks. npm run dev:full starts the web app, telemetry simulator, Java xflp solver, and Ontario 511 gateway.
Only browser-safe Supabase values belong in .env.local:
VITE_SUPABASE_URL=https://YOUR_PROJECT_REF.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=YOUR_PUBLISHABLE_KEY
Never expose a Supabase secret or service-role key through a VITE_ variable.
Migrations live in supabase/migrations and are forward-only. They cover traffic, optimization, decision/replay records, provider and irregular-cargo data, revision-checked snapshots, versioned loading plans, and vendor-neutral synchronization contracts. Apply them through a linked Supabase CLI:
npx supabase login
npx supabase link --project-ref YOUR_PROJECT_REF
npx supabase migration list
npx supabase db pushSigned-out visitors use a deterministic local demo. Selecting the user menu opens sign-in with an email and password or a Supabase magic link; authenticated dispatchers with an explicitly provisioned organization_members record share their organization state through Supabase Realtime. Account creation does not grant organization access automatically.
Authenticated driver accounts also require an explicit driver_user_links record. Drivers are restricted to the driver/map experience, and assignment acceptance, route start, and decline are validated and audited inside Postgres.
npm run dev # Vite web app
npm run simulator # independent SSE telemetry provider on :7071
npm run solver # xflp Java service on :7070 (skipped if no JDK is found)
npm run dev:full # all four development services
npm test # dispatch constraint tests
npm run test:e2e # Chrome workflow and accessibility tests
npm run build # type-check and production bundle
npm run quality # full deterministic release gate
npm run verify:auth # real Supabase role and tenant boundaries (QA accounts)
npm run verify:auth:workflow # realtime, driver actions, audit records and revision races
npm start # serve the built production app on :8080Set the browser-safe Supabase values in .env.local, then run docker compose --env-file .env.local up --build and open http://localhost:8080. On a host, set APP_ORIGIN to the public HTTPS origin. For a self-hosted Ontario routing engine, prepare the map once with npm run osrm:prepare, then start the complete stack with npm run docker:osrm. The graph is generated from the Geofabrik Ontario OpenStreetMap extract and stays outside Git. Configure production ELD/TMS adapters with server-only variables when those providers are required. Never provide a service-role key to the web build.
See P0 implementation, P1 implementation, P2 AI features implementation, the deployment runbook, and the deployment context briefing.
For authenticated role, realtime, cross-organization, driver-action, and concurrency verification, follow the multi-user QA guide, then run npm run verify:auth and npm run verify:auth:workflow.