About
## The problem it solves
India already has civic grievance systems. The gap isn't reporting - it's everything a citizen has to know *before* they can report.
Which authority owns a broken streetlight? Which department? Which portal? Which category? Has someone already reported it? How serious is it, and what happens next?
Get any of that wrong and the complaint goes nowhere.
## What AskMyCity does
One photo. The app then does the parts a citizen shouldn't have to:
- **Reads the problem** - category, severity, and a submission-ready description, each shown with a confidence score and an edit button - **Finds the right civic path** - city + category → authority → department → official channel, from a structured registry rather than a model's guess - **Checks whether it's already reported** - nearby open issues of the same category, so you can join one strong issue instead of filing complaint #38 - **Scores priority, explainably** - severity + citizens affected + community confirmations + age + safety risk, with every component shown on screen - **Tells you what happens next** - the authority's own published response window, and whether it has passed - **Drafts a follow-up** - but only once that window actually has passed - **For Hyderabad, fills the real GHMC form** - Zone, Circle, Category, description and photo, then shows you a screenshot of the filled, unsubmitted form. You press submit. There's a manual handoff at every step if you'd rather do it yourself.
## Who it's for
**A citizen** photographs a pothole and gets a routed, tracked, public issue in under a minute - no knowledge of GHMC's org chart required.
**A neighbourhood** stops fragmenting into 24 weak complaints and becomes one issue with 24 confirmed-affected citizens. That's the difference between noise and a signal an authority can act on.
**Anyone** can open City Pulse and see what's actually broken in their city.
## What makes it safer, not just easier
The design assumption is that an AI civic tool will be wrong sometimes, and that being wrong quietly is the real danger.
- Every AI output carries a **confidence score and an inline edit path**. The citizen confirms or corrects before anything is filed. - Every authority entry shows **where it was verified from and when** - and says so plainly when it hasn't been. Unverified rows are labelled unverified, in the UI. - Seeded demo issues are **labelled "Demo data"** and counted separately. - The priority score is **explainable** - you can see each component, and they sum to the total. No black-box number. - When no vision model is connected, the footer says so: *"categories on this instance come from a deterministic stub, not image analysis."* - It **never claims government affiliation**, never promises a resolution, and never files anything without an explicit citizen action. - A complaint ID is **never invented**. If the portal doesn't return one, the app says it doesn't have one.
AskMyCity isn't a replacement for government grievance systems. It's the intelligence layer that makes them findable, understandable, and collectively actionable.
---
## Challenges we ran into
Challenges we ran into
Three that were worth the scars.
## 1. A vote-inflation bug hiding in SQL's definition of NULL
`affected_count` drives `priority_score`, which drives City Pulse. It's the number we ask citizens and judges to trust - so it had better not be forgeable.
Votes were deduplicated two ways: an application pre-check, and a UNIQUE constraint on `(issue_id, anon_key, verification_type)`. Belt and braces.
Both had the same hole. The pre-check only ran `if anon_key is not None`. And in both Postgres and SQLite, **`NULL != NULL`** - so a UNIQUE index never fires on a null column. Post `{"anon_key": null}` in a loop and you could inflate a civic issue's support to any number you liked.
Two independent safeguards, and a null slipped past both because they shared an assumption nobody had stated.
**The fix:** make `anon_key` required and non-empty at the schema layer, so neither guard can be handed nothing to match on. **The lesson:** we'd tested that duplicate votes were rejected. We hadn't tested what happened with *no identity at all*. Now we do - the regression test posts a null key and asserts a 422.
## 2. "Invalid API key" - from a perfectly valid key
Photo uploads to Supabase Storage failed with `SupabaseException: Invalid API key`. We'd just pasted the key. We re-pasted it. Same error.
So we stopped trusting the error message and asked the API directly:
GET /rest/v1/ → 200
GET /storage/v1/bucket → 200
The key was fine. The error came from `create_client`, which validates the key against a **JWT-shaped regex** - three dot-separated segments. Supabase's current key format, `sb_secret_...`, contains no dots. The SDK rejected it before making a single network request.
**The fix:** talk to Storage's REST endpoint over httpx directly. That works with both the legacy JWT keys and the current ones - and it let us drop the `supabase` dependency entirely, which had been pulling in gotrue, postgrest, realtime, storage3, supafunc and websockets to perform one file upload.
**The lesson:** when an error message and the evidence disagree, believe the evidence. We'd have burned another hour re-generating keys.
## 3. Our database was publicly writable and nothing warned us
Supabase exposes every table over PostgREST, authenticated by the `anon` key - a key that is *designed* to be public and ships inside client-side code.
Row Level Security is what stands between that and your data. Tables created through the Supabase dashboard get RLS enabled by default. **Tables created by a migration do not.** Ours were all created by Alembic.
So every table - `civic_issues`, `users`, `feedback` - was readable and writable by anyone holding a key printed in our own frontend bundle. No error, no warning, nothing in the logs. It simply worked, which is the worst way for a security hole to behave.
**The fix:** a migration enabling RLS with no policies - a deny-all for `anon` and `authenticated`. Before writing it we checked on the live database that the backend's role carries `rolbypassrls`, so the server keeps working while the public API is shut out.
**The lesson:** "it works" and "it's safe" are different tests, and only one of them runs itself.
---
Screenshots
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.








