GeoServices Directory
GeoServices is a full-stack map-based directory that helps users find nearby service shops based on their location. It uses PostGIS for geographic queries, GADM datasets for polygon hierarchies, and integrates with Denude IDP for authentication.
Built With
- .NET
- Next.js
- Denude IDP
Technical Breakdown
Built with .NET Minimal APIs and PostGIS. We use the `geography` type for clean, radius-based distance filtering. (`geometry` can offer minor improvements if you are exploring projections, but for this use case, `geography` is sufficient.)
- Accurate distance filtering using ST_DWithin and meters.
- Imported GADM L1–L3 data to represent country boundaries.
- Built custom operational areas to fix overlaps — e.g., avoiding Giza and 6th of October clashing at the same level.
- Map-level hierarchy allows clean nesting of regions and services.
- Aggregator endpoint counts shops per polygon.
The Denude IDP Was integrated to keep authentication simple and secure. Users log in using email verification codes only.
- No passwords — just email and code.
- Scoped access with consent page.
- Used in production for both auth and service access control.
Next.js + Leaflet render GeoJSON layers dynamically. Users can explore, filter, and search visually across map areas.
- Dynamic polygon rendering based on backend queries.
- Client-side filtering acts like soft geofencing.
- Haversine used to display distance in km from user location.
Cart and selections persist anonymously and sync on login.
- Anonymous browsing + selection.
- Login merges anonymous data into user profile.
Now that the v2 IDP is kind of stable, the plan is TODO some performance improvements and map rendering upgrades:
- Switch to MapLibre for smoother interactions.
- Use Martin to serve vector tiles from PostGIS.
- Push GeoJSON filtering fully to the client for real-time polygon search.