How rohin19/bikesafe works
BikeSafe Vancouver is a cyclist-focused web app for planning safer routes and finding bike-share vehicles, with hazard reporting, community reviews, and administration. A cyclist signs in, plans a trip using map points or address search, compares safety-scored alternatives, and can save or navigate the selected route. Separate workflows support hazard reporting and discovery, bike-share lookup, and route reviews. The graph reflects documented capabilities; edges are limited to relationships shown in excerpts, the SOURCE INDEX, or README, so some unsampled implementation links are omitted.
Main entry points: App.tsx Session and page routing · app.ts Express API · api.ts REST API client · index.ts PostgreSQL connection
Components 26
Web application
- Session and page routing
frontend/src/App.tsx - Sign-in and registration
frontend/src/components/AuthPanel.tsx - Route planning and navigation
frontend/src/pages/RoutesPage.tsx - Alternative selection
frontend/src/pages/routeAlternatives.ts - Interactive map
frontend/src/components/Map.tsx - Hazard dashboard
frontend/src/pages/Hazards.tsx - Hazard reporting
frontend/src/pages/ReportHazard.tsx - Bike-share map
frontend/src/pages/BikeSharePage.tsx - Route reviews
frontend/src/pages/ReviewsPage.tsx - User administration
frontend/src/pages/Admin.tsx - REST API client
frontend/src/services/api.ts
Backend API
- Express API
backend/app.ts - Authentication
backend/routes/auth.ts - Admin operations
backend/routes/admin.ts - Hazard service
backend/routes/hazards.ts - Route planning and storage
backend/routes/routes.ts - Geocoding
backend/routes/geocode.ts - Bike-share proxy
backend/routes/bikeShare.ts - Review service
backend/routes/reviews.ts - Auth and role checks
backend/middleware/requireAuth.ts
Persistence
- PostgreSQL connection
backend/db/index.ts - PostgreSQL
External services
- OpenRouteService
- Lime GBFS feed
Other components
- Cyclist
- Browser geolocation
Connections 42
- Cyclist → Session and page routing: uses
- Session and page routing → Sign-in and registration: shows when signed out
frontend/src/App.tsx - Session and page routing → Route planning and navigation: routes to
frontend/src/App.tsx - Session and page routing → Hazard dashboard: routes to
frontend/src/App.tsx - Session and page routing → Hazard reporting: routes to
frontend/src/App.tsx - Session and page routing → Bike-share map: routes to
frontend/src/App.tsx - Session and page routing → Route reviews: routes to
frontend/src/App.tsx - Session and page routing → User administration: routes to
frontend/src/App.tsx - Sign-in and registration → REST API client: calls
frontend/src/components/AuthPanel.tsx - Route planning and navigation → REST API client: calls
frontend/src/pages/RoutesPage.tsx - Route planning and navigation → Alternative selection: selects safest
frontend/src/pages/RoutesPage.tsx - Route planning and navigation → Interactive map: renders route on
frontend/src/pages/RoutesPage.tsx - Hazard dashboard → REST API client: calls
frontend/src/pages/Hazards.tsx - Hazard dashboard → Interactive map: renders hazards on
frontend/src/pages/Hazards.tsx - Hazard reporting → REST API client: calls
frontend/src/pages/ReportHazard.tsx - Hazard reporting → Interactive map: selects location on
frontend/src/pages/ReportHazard.tsx - Bike-share map → REST API client: calls
frontend/src/pages/BikeSharePage.tsx - Bike-share map → Interactive map: renders vehicles on
frontend/src/pages/BikeSharePage.tsx - Route reviews → REST API client: calls
frontend/src/pages/ReviewsPage.tsx - User administration → REST API client: calls
frontend/src/pages/Admin.tsx - REST API client → Express API: sends REST requests
frontend/src/services/api.ts - Express API → Authentication: mounts
backend/app.ts - Express API → Admin operations: mounts
backend/app.ts - Express API → Hazard service: mounts
backend/app.ts - Express API → Route planning and storage: mounts
backend/app.ts - Express API → Geocoding: mounts
backend/app.ts - Express API → Bike-share proxy: mounts
backend/app.ts - Express API → Review service: mounts
backend/app.ts - Authentication → PostgreSQL connection: queries
backend/routes/auth.ts - Admin operations → PostgreSQL connection: queries
backend/routes/admin.ts - Hazard service → PostgreSQL connection: queries
backend/routes/hazards.ts - Route planning and storage → PostgreSQL connection: queries hazards and routes
backend/routes/routes.ts - Review service → PostgreSQL connection: queries
backend/routes/reviews.ts - PostgreSQL connection → PostgreSQL: connects to
- Route planning and storage → OpenRouteService: requests cycling directions
- Geocoding → OpenRouteService: requests geocoding
- Bike-share proxy → Lime GBFS feed: proxies GBFS feed
- Route planning and storage → Auth and role checks: guards route deletion
backend/routes/routes.ts - Admin operations → Auth and role checks: checks admin role
backend/routes/admin.ts - Hazard service → Auth and role checks: checks protected actions
backend/routes/hazards.ts - Review service → Auth and role checks: guards mutations
backend/routes/reviews.ts - Route planning and navigation → Browser geolocation: reads live position
frontend/src/pages/RoutesPage.tsx