CASE FILE 01 · iOS + Android · live
Cite
The live map of UTech, UWI Mona and Kingston: places, events and tickets, area alerts confirmed by neighbours, local businesses and moving vendors. Adopted by the UTech Students' Union as an app for students.
The problem
Most maps tell you what exists. Cite tells you what is true right now: the second-floor bathroom is locked, the campus cafe has a queue out the door, a road is flooded, there is free lunch in ten minutes.
The useful half of local knowledge never reaches Google Maps: it is too small, too temporary or too specific to the people nearby. Cite is Jamaica-first, built for a campus and for a neighbourhood during a disruption.
It has been adopted by the UTech Students' Union as an app for students, so people on campus find rooms, events and what is open without asking around.
Numbers
- UTech SUadopted by the UTech Students' Union as an app for students
- 183Klines of app source (TypeScript), plus 88K of tests
- 72Klines of hand-written Go, plus 49K of tests
- 119SQL migrations
- 9,500automated tests counted in source (8.1K Jest, 1.36K Go)
- 5event sources pulled every 6 hours
- 12 / 26dbt models / data tests
What I built
Architecture
- A modular monolith: one deployable per backend, split into clear internal modules, plus the Go service. The Express API keeps controllers, services, routes, middleware and validation apart, with a service module per area (pins, reports, area alerts, events, ticketing and event fees, groups, chat, moderation, notifications, business, flyers and event import). The Go service mirrors that with a package per concern (pins, events, alerts, safety, search, places, ingest, jobs, notify, realtime, billing, eventdoor).
- Why: a small team, simple deploys, and modules with their own boundaries that can be split out later. Go and Rust took over routes and jobs one at a time on exactly that seam.
- Expo app on iOS and Android, an Express API, a Go API and worker that take routes over from Express one at a time, and a Rust geo engine. Postgres with PostGIS is the source of truth.
- The phone never queries Supabase for data, only for sign-in. Every read and write goes through the API, which is what lets Postgres row-level security stay deny-all.
- A write-diff harness replays each moved write route against Express and Go and compares the response, the database change, the pushes and the live updates before a route moves.
Backend
- Pins, reports, area alerts, events, groups, reviews, saved items, tickets, vendors and claimed businesses, as REST plus a Socket.IO layer for chat, presence and live location.
- A trust-and-safety layer: polymorphic flagging, reputation-weighted auto-hide, penalties scoped to the abused capability, and a moderator queue that groups flags by target.
- Event ticketing and a door tool: QR tickets, a scanner for staff, walk-up admissions and an append-only scan log.
- Natural-language search through OpenAI with a keyword fallback; image uploads checked by magic bytes and capped at 50 megapixels; rate limits keyed on the account.
Frontend
- Expo SDK 57, React Native 0.86 and React 19 in TypeScript, with expo-router, a Mapbox map with custom styling, bottom sheets and Reanimated gestures.
- TanStack Query with a persister so the map opens already filled when offline; Zustand for local state.
- Live turn-by-turn walking navigation, 3D indoor campus maps, a paper-and-ink design system and a guest mode.
- The marketing site, operator tools (vendor, console, door, post, admin) and a blog on plain HTML and CSS, no framework.
Infrastructure
- Railway for the Go API, Go worker, Express and the geo engine; Supabase for Postgres and auth; Redis for rate limits, locks and live fan-out.
- GitHub Actions run typecheck, lint (as a ratchet that only fails if warnings grow) and tests; EAS Build and over-the-air updates ship the app.
- k6 load tests against a staging copy, with a guard that refuses to run against production.
Data
- An ingestion pipeline pulls events from 5 web sources every 6 hours with per-host rate limits, idempotent upserts and cross-source dedup.
- A validation layer skips bad records with a counted reason (no location, vague venue, outside Jamaica), so every run has a data-quality report.
- AI enrichment: a vision model reads flyers and recovers venues, with strict JSON output, a 0.6 confidence threshold, geocoding fallbacks and a moderator queue.
- A national seed of emergency and public places from OpenStreetMap, and about 12 scheduled jobs that run on exactly one server through Redis locks.
- A DuckDB star schema (3 fact tables, 5 dimensions) loaded nightly to keep the history the app deletes, with 12 dbt models and 26 data tests on GitHub Actions.
Hard problems
- 01Walking directions that follow campus paths
A route over the OpenStreetMap graph came out about 1.9 times longer on campus, where paths cut through buildings and plazas. A custom obstacle-grid router and a Kalman-filtered GPS pipeline removed those detours.
- 02Things that expire on purpose
Each report type has a lifetime and a ceiling, and every reply extends it without ever making it immortal. Missing-person alerts are the exception: they never auto-delete, they drop to local-only and ask the poster to confirm.
- 03Trust with deny-all row-level security
Every table has RLS on with no policies, so the key in the app bundle reads nothing. Authorisation lives in one place, the API. Penalties attach to the abused capability, so deleting an account resets nothing.
- 04Paid for the door, never touching ticket money
Jamaica is not supported by Stripe Connect and holding ticket money is custody, so Cite invoices a percentage of door-scanned value instead. Walk-up admissions and a scan log make that count honest for cash events.
- 05Reading official notices without inventing words
Monitors turn NWA closures, NWC lock-offs, JCF curfews, Met Service warnings, NHC, USGS, JPS and JIS posts into alerts. AI only finds places and times in prose; the text people read comes from the agency's own words. A notice is read once.
- 06Moving a live backend to Go and Rust without a rewrite
Go took the scheduled jobs and the read routes first, checked by the write-diff harness. Map clustering was ported to Rust and parity-tested against a corpus recorded from the TypeScript original.
- 07Duplicates that are not duplicates
Two rooms on either side of a wall share nearly the same coordinates. Cite parses room codes, so 47A2 beside 47A1 is a different place while 47A1 posted twice is caught.
Stack
- React Native (Expo)
- TypeScript
- expo-router
- Mapbox
- Reanimated
- TanStack Query
- Zustand
- Express
- Go
- Rust
- Socket.IO
- OpenAI
- PostgreSQL
- PostGIS
- Redis
- DuckDB
- dbt
- Supabase
- Railway
- GitHub Actions
- EAS
- Jest
- Playwright
- k6
Screens














