11
Domain models
platform · 2025 · client unnamed
Find hotels, restaurants and attractions near you, ranked by real distance, across three separate venue types in one query.
11
Domain models
73
Route declarations
3
Identity types
traveller, venue owner, publisher
3
Venue types
unified in one proximity query
The problem
A tourism platform needed the query every travel app lives or dies on: what is near me right now. That sounds simple until the venues are three different collections with different shapes, the results need filtering and pagination, and the answer has to stay fast as the catalogue grows.
The approach
Real geospatial modelling rather than storing coordinates as strings and sorting in application code. Venues carry GeoJSON points with proper spatial indexes, and the proximity endpoint runs a dual query strategy across all three venue types, merging and paginating results while marking which are user favourites. Three separate identity types for travellers, venue owners and publishers, each with their own auth path.
Architecture
GeoJSON points with spatial indexes on every venue type. The proximity controller is the most complex module in the codebase, because merging three heterogeneous collections into one distance-ordered, filtered, paginated result is genuinely fiddly.
Each with what it cost
A decision without a stated tradeoff is a preference.
01
Why
Proximity is the core product query. With GeoJSON and a spatial index the database answers it; with strings the application has to fetch everything and compute distance itself, which stops working at exactly the point the catalogue becomes valuable.
What it costs
Coordinates have to be written in the correct order and validated on the way in, because a spatial index will happily store a point in the sea.
02
Why
Three venue collections with different shapes cannot be answered by one query, but the user wants one ranked list. The controller runs the spatial queries independently and merges them into a single ordered result.
What it costs
Pagination across merged heterogeneous result sets is harder than paginating one collection, which is why that controller is the largest business module in the project.
Outcome
Distance-ranked discovery across hotels, restaurants and attractions from a single endpoint, with filtering and pagination that hold as the catalogue grows.