Beyt App
Backend development
A geolocation API that helps users find the nearest masjids from wherever they are. Given a user's coordinates, it ranks nearby masjids by true distance, computed with the Haversine formula, so the closest option always comes first.
The problem
"Where's the nearest masjid?" sounds simple until you build it. Naive distance math treats the earth as flat and quietly gives wrong answers over real distances, so the "nearest" result isn't actually the nearest. Beyt App is the backend that gets this right: accurate distances, correctly ranked, and fast.
What it does
Capability | What it means |
|---|---|
Nearest-masjid search | Rank masjids by real distance from the user's location |
Haversine distance | Accurate great-circle distances between coordinates |
Location-first API | A clean, queryable geolocation service, backend-first |
How it works
A request arrives with the user's coordinates. The service narrows to candidate masjids, computes the great-circle distance to each with the Haversine formula, ranks them, and returns the nearest first. It's designed API-first, a focused service that does one job and answers a clear question.
Highlights
- Accurate great-circle distances, not flat-earth approximations
- Backend-first, single-purpose API design
- Location-first: built around the one question it answers
Stack
Node ·
TypeScript ·
PostgreSQL
Why this stack
Choice | Why | Instead of |
|---|---|---|
Node | A light, fast fit for a focused request-response API | a heavier framework for a single-purpose service |
PostgreSQL | A solid home for location data and candidate queries | a store without good support for structured geo queries |
Haversine | Correct great-circle distance on a sphere | flat, Euclidean math that's wrong over real distances |
Sounds trivial, find the nearest masjid, but the distance math is exactly where people get it wrong. I just made sure it's actually right.