CV

NoaSpot API.

The REST API behind NoaSpot, a curated travel guide for iOS: it serves cities, places, routes, saved places and semantic search, and feeds the app and the admin dashboard from one OpenAPI contract. The hard parts were search without a slow model call and district borders that stay consistent.

Travel & transport

Year
2026
Built for a client
My part
Sole developer
Core stack
32 technologies
Better Auth, Docker, Gemini API, Hono
Website
Not public
No public link

My role

I built the whole REST API alone and defined the contract the iOS app consumes.

Backend

Capabilities

Contract and model

  • 80+ operations, documented in OpenAPI 3.1 with a Scalar reference
  • 20+ Prisma models and 15+ migrations on PostgreSQL
  • One request pipeline with a global error boundary and one structured log line per request

Search and discovery

  • Semantic search on Upstash Vector with Gemini embeddings, and tags and districts derived from the query
  • Recommendations of three places from different categories, ranked by quality, not distance
  • Saved places, curated routes, recent searches and a hand-ordered picks list per city

Data and maps

  • Seed, Google Places enrichment, Cloudinary photos and generated map pins, with a monthly refresh
  • District borders simplified as one topology, and a grid layout stored in the database
  • Data-health endpoint for missing, invalid and overlapping boundaries

Quality

  • 90+ test files, unit tests without a server and e2e tests over HTTP on a seeded database
  • CI with audit, OpenAPI export, lint, typecheck, migrations, tests and build

Patterns and decisions

  • Each API module is one route file plus one folder per operation. The folder holds the route definition with its handler, and the Zod input and output schemas. There is no service layer. Handlers call Prisma directly and always select only the fields they need. Hono infers types from the route definition to the handler, and an extra layer would break that chain.
  • The data model has 20+ Prisma models and 15+ migrations on PostgreSQL. It covers places, cities, districts, categories, vibes, routes, saved places, search history and the auth tables. The API has 80+ operations, and the admin ones sit behind one guard applied at the admin module.
  • The API serves its OpenAPI 3.1 document and a Scalar reference. CI exports the spec as a validity check. I defined this contract, and the iOS app and the admin dashboard both consume it.
  • Every request passes one pipeline: request id, gzip, security headers, logger, CORS, CSRF, a 1 MB body limit, session middleware and a global error boundary. Pino writes one structured line per request, and handlers add timings for the database, the vector index and the embedding call.
  • Photos go through Cloudinary. The API also generates map pins with sharp. A daily job prunes staged images.
  • There are 90+ test files. Unit tests call the app directly and need no server. E2E tests run over HTTP against a seeded database. CI runs audit, lint, typecheck, migrations, seed, both suites and the build.

Cases

Shared district borders that stayed shared. The iOS grid view tests points against district polygons on the JavaScript main thread, so the polygons had to be simple. Simplifying each polygon alone let two neighbours drop different vertices on their common edge, and overlaps appeared. I simplify the whole district set as one topology. Admin-drawn polygons are stored rounded to 6 decimals and are not simplified. Zone polygons are the union of their children. A count against production showed 99 overlapping pairs over 55,000 m2 with per-polygon simplification, and 241 m2 with the topology pass. The pass is not idempotent, so a test pins that it runs only on raw source.

Search without a generative call. The first design sent every query to Gemini API. On 85 test queries the intent step had a p90 of 6,025 ms and a worst case of 41,256 ms. I embed the query once. Category and vibe tags come from cosine similarity against pre-embedded labels, districts are matched by rule, and the same vector retrieves places from Upstash Vector. Tag accuracy stayed equal at 96.9 percent, and the p90 of the intent step fell to 407 ms. The measurements are from 2026-09-10 against 463 published places in San Francisco. The design doc records the one regression, a query cannot say "not a place", and the rule I followed: a false positive is worse than a false negative. A hedge helper sends a second attempt after a delay when a provider queues a request.

A data pipeline that respects edits. The client's place list started as a JSON file, and curators then edited places in the admin. A plain re-seed would have erased those edits. The steps are seed, Google Places enrichment, Cloudinary photos, pin generation and vector sync, and the seed is idempotent. Hash columns let vector sync and pin generation skip unchanged rows. Every real seed writes a JSON backup first. Field ownership is declared in one tested list. A seed over a database with more than 10 places is refused without an explicit flag. The monthly Google refresh has a time-to-live gate and an hours-only mode.

Core stack

Screenshots