A civic technology and smart community reporting platform for tracking flooding, sanitation, waste, infrastructure, and local safety issues in Ghanaian communities.
# EcoCity Ghana
EcoCity Ghana is a civic technology and smart community reporting platform for Ghanaian communities. Residents can report flooding, blocked drains, poor drainage, illegal dumping, sanitation concerns, unsafe roads, broken streetlights, public infrastructure issues, and community safety risks.
The app uses Next.js App Router, TypeScript, Tailwind CSS, MapLibre/MapTiler, and Supabase.
## Report Submission
Residents submit reports at `/report` with category, community, location detail, description, urgency, danger signal, optional evidence images, optional contact preference, and optional map coordinates. New reports are saved with the `needs_review` workflow status and `under_review` public visibility. Public pages label these reports as awaiting review/submitted for review so they do not appear as official verified reports.
Reports can include browser location, a dropped map pin, typed-location search, manual coordinates, or only a descriptive location. Reports without coordinates are still saved and reviewed. Evidence images are optional and should only be added when it is safe to collect them.
## Supabase Persistence
Run `supabase-schema.sql` in the Supabase SQL editor before using the app with a live database. The schema creates:
- `reports` for submitted community reports.
- `report_evidence` for multiple uploaded evidence image records linked to reports.
- `report_updates` for public civic response timeline entries.
- `public_reports` view for public report reads without private reporter contact fields. This view excludes hidden and rejected reports.
- `public_report_dashboard_summary` invoker view for counts derived only from publicly visible reports.
- `report-evidence` Supabase Storage bucket setup for uploaded evidence images.
- RLS policies and column-level grants that allow public report submission and safe public reads without reporter contact fields.
- Public evidence/update reads only for reports that are still publicly visible. …