Skip to content
Road Guard Safety

Road Guard Safety

Detech Dispatch Repair Verify

Created on 13th September 2026

•

Road Guard Safety

Road Guard Safety

Detech Dispatch Repair Verify

The problem Road Guard Safety solves

RoadGuard is a smart road-damage detection and rapid-response system that uses cameras, IMU sensors, GPS and Edge AI to automatically detect potholes and road defects while municipal vehicles travel on their normal routes. The system verifies the defect using sensor fusion, identifies its exact location, assigns its severity and priority, and sends the information to a cloud-based municipal dashboard. Authorities can then dispatch repair teams and later verify the repair through another road scan, creating a complete closed-loop process from detection to resolution.

Challenges we ran into

RoadGuard

An AI-assisted municipal road-damage detection and repair-workflow dashboard.

  • Frontend: React 19 + Vite, in the repo root.
  • Backend: Node.js + Express + Socket.IO, in server/. Real REST API, JSON-file persistence, file uploads for report photos, JWT auth, and real-time updates over WebSockets.

The frontend used to run entirely on hardcoded mock data. It now talks to the real backend below: reports, fleet status, work orders, notifications, activity feed, and settings are all persisted server-side and pushed live to every connected browser tab.

Quick start

You need two things running at once: the API server (port 4000) and the Vite dev server (port 5173). The Vite dev server proxies /api, /uploads, and /socket.io to the backend, so the frontend never needs to know a different origin.

# 1. Install both sets of dependencies
npm install
npm --prefix server install

# 2. Run both servers together
npm run dev:full

Then open http://localhost:5173.

If you'd rather run them in separate terminals:

npm run server   # backend on http://localhost:4000
npm run dev      # frontend on http://localhost:5173

The backend auto-creates its database (server/data/db.json) on first run, seeded with the same sample reports/fleet/notifications the mock version shipped with. To wipe it back to that seed state at any time:

npm --prefix server run seed:reset

Seeded login

The backend seeds one admin user for the JWT-protected /api/auth endpoints (not currently wired into the UI, but ready to use — see below):

username: admin
password: roadguard123

Override these via server/.env (copy from server/.env.example) before first run if you want different credentials.

What's actually real now

FeatureBeforeNow
ReportsHardcoded array, reset on refreshPersisted to disk, survives restarts
Report photo uploadFilename shown, never sent anywhereActually uploaded, stored, and served from server/uploads/
AI severity/confidence scoreRandom number generated in the browserGenerated server-side from a damage-type → severity table, consistent for every client
Status advancement, fleet cycling, work-order stagesLocal useReducer, per-tab onlyPersisted server-side, broadcast to all open tabs instantly via Socket.IO
Notifications / activity feedMock arrayReal, generated by backend events (new critical report, status change, etc.)
Settings"Saved" toast with no actual persistencePersisted to disk
Multi-user / multi-tabNot possible — no shared stateTwo browser tabs stay in sync live; open the dashboard in two windows and submit a report in one to see it appear in the other

Backend API reference

Base URL: http://localhost:4000/api (or just /api through the Vite proxy).

MethodPathDescription
POST/auth/login{ username, password } → { token, user }
GET/auth/meRequires Authorization: Bearer <token>
GET/reports?search=&severity=&status=List/filter reports
GET/reports/:idSingle report
POST/reportsMultipart form: location, damage, description, photo (file)
PATCH/reports/:id/advanceMoves status forward one stage (open → assigned → repair → resolved)
DELETE/reports/:idRemove a report
GET/fleetList fleet vehicles
PATCH/fleet/:id/status{ status? } — omit body to cycle to the next status
GET/workflowList work-order pipeline stages
POST/workflow/advanceAdvances the active stage to done, activates the next
GET/notificationsList notifications + unread count
POST/notifications/mark-all-readMarks all as read
GET/activity?limit=Recent activity feed
GET/settingsCurrent dashboard settings
PUT/settings{ refresh?, mapLayer?, criticalAlerts? }
GET/statsLive counts: critical, moderate, total, resolved, open work orders
GET/stats/analyticsResolution rate (real) + illustrative sensor metrics (see note below)

Uploaded photos are served statically from /uploads/<filename>.

Real-time events (Socket.IO)

The backend emits these to every connected client whenever the underlying data changes — the frontend listens for all of them in src/state/StoreContext.jsx:

report:created, report:updated, report:deleted, activity:created, notification:created, notifications:markedAllRead, fleet:updated, workflow:updated, settings:updated.

Honest limitations

This is a functional backend for the dashboard's workflow (reports, fleet, work orders, notifications, settings) — it is not a real road-damage detection system:

  • There is no camera/IMU sensor pipeline. Report severity comes from a lookup table on the damage-type you select, not computer vision.
  • The map is st

Tracks Applied (1)

Hardware

RoadGuard is a smart road-damage detection and rapid-response system that uses cameras, IMU sensors, GPS and Edge AI to ...Read More

Discussion

Builders also viewed

See more projects on Devfolio