Appearance
π² BikeTrack Project Wiki & Knowledge Base β
Welcome to the BikeTrack technical wiki. This workspace serves as a centralized, high-signal, Obsidian-style repository of knowledge mapping the entire system architecture, features, database structure, and visual use cases of the bicycle route planner app.
πΊοΈ Portal Navigation β
1. ποΈ Architecture & Core Design β
- WIKI Home β You are here!
- Database Schema Guide β Relational structure of PostGIS tables, columns, constraints, and indices.
- API Contract Reference β High-fidelity backend REST routes (Hono) and Drizzle integrations.
- Architect's Ledger β System tenets, folder structure, coding conventions, and critical regressions checklist.
- Ultimate Navigator Specifications β Deep philosophical and technical background on bicycle navigation systems.
2. π§© Core Product Features β
The current supported application capabilities are categorized into focused functional modules:
- Features Index β Unified features roadmap.
- Feature 01: Route Planning β Waypoints, routing profiles, telemetry calculation via BRouter.
- Feature 02: Garage & Component Wear β Virtual components, dual wear models, service checklists.
- Feature 03: Track Library & Archiving β Cloud storage, soft deletes, favorite collections, library dashboard.
- Feature 04: Cue Sheets β Turn-by-turn directions, maneuver indexing, GPX extensions.
- Feature 05: Points of Interest (POI) β Emoji map markers, right-click placements, distance and visibility controls.
- Feature 06: Undo & Redo States β Stack-based state history, drag atomicity protection.
3. π Visual Use Cases & Scenarios β
Over 35 edge scenarios mapping real-world rider requirements are fully specified and cataloged:
- Visual Use Cases Map β Interactive grouping.
- Core Planning Use Cases (e.g. Out & Back, Route Auto-healing, Offgrid planning).
- Advanced Utilities (e.g. Smart Coordinate Thinning, Route Cropping for Anti-Doxing).
4. π Active UX/UI Audits β
- Main Map Canonical Audit β July 2026 β Reconciled findings, raw evidence, release blockers, phased remediation plan, and the mandatory retest matrix for the full-screen planning map.
5. π Operations & Third-Party Compliance β
- Strava API 2026 Compliance β Canonical product rules, access tiers, privacy, AI prohibition, data lifecycle, readiness blockers, release gate, and coding-agent guardrails.
- Strava Review Submission Runbook β Public URLs, form-answer template, screenshot package, and production verification checklist.
π οΈ The Tech Stack β
| Layer | Technologies Used | Key Responsibilities |
|---|---|---|
| Frontend Map | MapLibre GL JS | Core canvas rendering, vector styles, terrain overlay, interactive markers. |
| Frontend Framework | React 18 + Vite 6 + Zustand | Dynamic single-page client, modular components, reactive telemetry store. |
| Backend Framework | Hono API + Node Server | Ultra-fast endpoint serving, route crop computations, Strava synchronizer. |
| Database | PostgreSQL + PostGIS | Geographic coordinate projection, geometry lines, fast spatial lookups. |
| Object-Relational | Drizzle ORM | Schema definition, SQL migrations, nested transactions for route updates. |
| Auth | Firebase Admin + Client SDK | Secure token check, email/Google SSO authentication. |
| Routing | BRouter Public Engine | Point-to-point path calculation with custom bike profiles. |
π¦ Directory Map & Monorepo Layout β
bike-maps/
βββ apps/
β βββ api/ # Hono backend with Drizzle ORM
β β βββ src/
β β β βββ app.ts # Hono application setup
β β β βββ db/ # PostgreSQL & Drizzle schemas and connections
β β β βββ routes/ # REST endpoints grouped by resource
β β β βββ services/ # External integrations (Strava, Firebase)
β βββ web/ # React frontend following Feature-Sliced Design (FSD)
β βββ src/
β β βββ app/ # Setup, providers, router
β β βββ entities/ # Zustand Stores (route, user, components)
β β βββ features/ # Complex user interactions (build-route, crop-route)
β β βββ widgets/ # Major layout pieces (MapCanvas, PlannerSidebar)
β β βββ shared/ # Common components, styles, utility hook libraries
βββ packages/
β βββ shared/ # Common core dependencies
β β βββ src/
β β βββ geo/ # Geo-math formulas (RDP, Haversine, GPX parsing)
β βββ test-utils/ # Standardized fixtures and unit test helpers
βββ docs/ # Extensive technical markdown wikiπ§ Core Tenets for Developers β
- Strict Spatial Standard: Coordinates must always be stored and handled in strict GeoJSON format:
[longitude, latitude](LNG first, LAT second). - Immutable Geometry Updates: When performing path manipulation (crop, split, simplification), execute updates within database transactions to ensure route telemetry (
distance,elevation_gain) remains strictly in sync with coordinate geometry arrays. - Fail-Safe Routing: The application must remain functional even when BRouter is slow. Implement a 10s request timeout, with automatic cancellation/abort of stale queries on map click.
- No Direct DOM Mutation: Let React handle marker instances and render layers through declarative Zustand stores. Map coordinates are synchronized in real-time without expensive full map canvas refreshes.