AWS Builder Center
How We Built JalMarg: Turning Every Flooded Road into One Verified Incident on AWS

How We Built JalMarg: Turning Every Flooded Road into One Verified Incident on AWS

A hackathon build log: live geotagged evidence, road-aware duplicate detection, verified work orders, and a simple AWS Amplify + Amazon EC2 deployment.

The problem

Every monsoon, roads in Indian cities flood. Complaints arrive as phone calls and social posts: no photo, no exact location, no follow-up. The same road is reported dozens of times, repairs are marked "done" without proof, and citizens never find out if anything changed.
We asked one question: what if every flooded road became one trusted record that everyone (citizens, workers and officers) could see and verify?

What JalMarg does

  1. Report with proof. Citizens report using the live camera only. The app captures precise GPS at the shutter, and the server watermarks the photo with the location and time.
  1. One road, one incident. The backend snaps each report to the nearest road and merges reports of the same problem within 500 m. Nearby people can confirm with "I see it too".
  1. Assign and fix. A ward officer creates a work order and assigns a field worker. The worker taps On the way (every reporter is notified), follows directions and starts work.
  1. Prove it. The worker can only mark the job done with a live, geotagged photo. It goes to the officer to verify, not straight to the public.
  1. Close the loop. After approval, citizens rate the work or raise an issue with a photo if the road is still flooded.

Architecture

Browser / Android app │ HTTPS ▼ AWS Amplify Hosting (React + TypeScript, custom domain, auto-build from GitHub) │ API calls (VITE_API_URL) ▼ Amazon EC2 (Ubuntu) Nginx :443 → Uvicorn + FastAPI (systemd) → SQLite + evidence photos on EBS
  • Frontend: React 19, TypeScript, Vite, Tailwind, MapLibre with OpenStreetMap. Packaged for Android with Capacitor (camera + GPS).
  • Backend: FastAPI (Python) handles road matching, duplicate detection, evidence verification signals, a rule-based flood-risk score from Open-Meteo rainfall, work orders, and role-based access for citizen, worker, officer and admin.
  • Data: SQLite, which is small, fast and has zero cost. It includes an audit log of every staff action.

How we used AWS

AWS Amplify Hosting serves the frontend. We connected the GitHub repo, and every push to  main  triggers a build. Amplify handles HTTPS, the CDN and our custom domain  jalmarg.notwork.world . The API URL is passed in as a build-time environment variable.
Amazon EC2 runs the API at  jalmargapi.notwork.world . Nginx terminates HTTPS and reverse-proxies to Uvicorn/FastAPI, which runs as a systemd service so it restarts on failure or reboot. We take SQLite online backups on the server before any risky change.

What we learned

  • Trust is the product. A live, geotagged photo is worth more than a hundred phone complaints.
  • Verify at every handoff. Worker → officer → citizen. "Done" means proven.
  • Build-time vs runtime config matters. Vite environment variables are baked in at build time, so changing the API URL means redeploying on Amplify.
  • Keep it simple. Amplify + one EC2 instance + SQLite gave us a production deployment we fully understood, at near-zero cost.

What's next

Storing evidence in Amazon S3, AI photo checks to confirm real flood water in each report, and SMS alerts for people living near a flooded road.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article