City Fix
Smart Issue Reportingfor Smarter Cities
The problem City Fix solves
Cities today face countless small but critical civic problems — potholes, broken streetlights, overflowing garbage, water leaks, and more. These issues negatively affect public safety, hygiene, and quality of life.
However, there is a major gap between citizens noticing problems and local authorities taking timely action. Most cities lack a unified, intelligent, and transparent platform to manage and resolve public complaints efficiently.
Challenges we ran into
One specific hurdle I faced while building the CityFix app was with integrating the interactive map using Leaflet in a Next.js environment. Since Next.js does server-side rendering (SSR) by default, the Leaflet library—which depends on browser APIs like window and document—was throwing errors and breaking the build.
To overcome this:
I used dynamic imports and conditional checks (typeof window !== "undefined") to ensure Leaflet was only initialized on the client side.
I also isolated the map rendering logic inside a useEffect hook so that it only executed after the component mounted.
Finally, I tested multiple configurations to make sure the map markers (complaint locations) loaded correctly from dynamic query params.
This not only fixed the issue but also gave me a deeper understanding of handling SSR challenges in Next.js with client-side libraries.
Tracks Applied (1)
$300(Open): Cash Prize
Technologies used
