Skip to content

🚲 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 ​

2. 🧩 Core Product Features ​

The current supported application capabilities are categorized into focused functional modules:

3. πŸ“š Visual Use Cases & Scenarios ​

Over 35 edge scenarios mapping real-world rider requirements are fully specified and cataloged:

4. πŸ”Ž Active UX/UI Audits ​

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 ​

LayerTechnologies UsedKey Responsibilities
Frontend MapMapLibre GL JSCore canvas rendering, vector styles, terrain overlay, interactive markers.
Frontend FrameworkReact 18 + Vite 6 + ZustandDynamic single-page client, modular components, reactive telemetry store.
Backend FrameworkHono API + Node ServerUltra-fast endpoint serving, route crop computations, Strava synchronizer.
DatabasePostgreSQL + PostGISGeographic coordinate projection, geometry lines, fast spatial lookups.
Object-RelationalDrizzle ORMSchema definition, SQL migrations, nested transactions for route updates.
AuthFirebase Admin + Client SDKSecure token check, email/Google SSO authentication.
RoutingBRouter Public EnginePoint-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 ​

  1. Strict Spatial Standard: Coordinates must always be stored and handled in strict GeoJSON format: [longitude, latitude] (LNG first, LAT second).
  2. 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.
  3. 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.
  4. 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.