Repository navigation
Design Decisions
The load-bearing choices, and why they hold the system up.
src/lib/engine.ts (and friends: impact.ts, ridePlan.ts, vehicleProfile.ts) contain no React and no I/O. Every estimate — schedule, budget, warnings — is a deterministic function of (trip data, assumptions). That's what makes the numbers transparent (the UI can cite its assumptions), testable (259 unit tests, node env, no DOM), and safe to memoize.
Every mutation updates the in-memory cache synchronously (instant UI) and fires the Supabase write in the background — and checks its result: on error it toasts and rolls back the optimistic write, so the UI never disagrees with the server. Authorization is enforced by Postgres Row Level Security, not UI checks. A fire-and-forget write is the bug class that made a published itinerary "vanish" (v0.23.0) and seeded ~2,100 junk trips (Sep 2026); the write-through rule is law (AGENTS §4).
Times are stored as 24h "HH:MM" strings and formatted at render (12h/24h is a user preference); coordinates are plain lat/lng numbers so any map provider can consume them; optional fields are string | undefined and helpers type for the real shape.
Google Places/Routes are opt-in keys with quota guards; on absence, exhaustion, or failure the app silently falls back to the open stack (OSM, Wikipedia, Mappls, OSRM, Open-Meteo). The basemap is OpenFreeMap — keyless, commercial-OK, attribution carried by its TileJSON. Data-only usage: Google results render as suggestions, never persisted.
Surfaces share tokenized glass (--yf-nav-glass, border, blur tokens). Hard-won: a backdrop-filter ancestor becomes the blur root, so nested panels' frost silently does nothing — floating panels must portal outside it (Sep 2026).
The theme radiate transition suppresses backdrop-filter for its duration — Chromium renders glass inside VT snapshots without its backdrop, turning the page into a gray veil (AGENTS §4).
Related: Architecture Overview · Release Process
Canonical doc: docs/ARCHITECTURE.md · AGENTS.md
YatraFlow · Repo · Docs index · Changelog
Repo docs are canonical — wiki pages are summaries that link to them.
YatraFlow Wiki
Learn
Do
Understand
Look up
Repo