How tusharqlab/joyful-database-buddy works
Fuelio is a fuel-station discovery and status-sharing app, with separate driver and station-manager experiences. Drivers browse live station availability, search or map stations, plan routes, inspect station details, save favorites, and submit status reports; managers authenticate, access their assigned station, and publish official updates. Supabase provides authentication and application data, while route lookup uses OpenStreetMap geocoding and OSRM. The graph follows relationships visible in excerpts or the SOURCE INDEX; unsampled subsystems are represented by their known paths without assuming internal calls.
Main entry points: client.ts Supabase client · MapPanel.tsx Map and search panel · stations.ts Station data and status · station.$stationId.tsx Station details page
Components 28
App and access
- Station browser
src/routes/_authenticated/app.tsx - Authentication
src/routes/auth.tsx - Auth state
src/hooks/useAuth.tsx - Manager access guard
src/hooks/useManagerGuard.tsx
Station discovery
- Map and search panel
src/components/map/MapPanel.tsx - Station map
src/components/map/StationMap.tsx - Station search
src/components/map/StationSearchPanel.tsx - Route search
src/components/map/RouteSearchPanel.tsx - Geocoding and routing
src/lib/route.ts - Route view
src/routes/_authenticated/route.tsx - Station details page
src/routes/_authenticated/station.$stationId.tsx - Station details card
src/components/station/StationDetailsCard.tsx
Status and management
- Favorites page
src/routes/_authenticated/favorites.tsx - Favorite actions
src/lib/favorites.ts - Favorite control
src/components/station/FavoriteButton.tsx - Driver status report
src/components/station/ReportStatusForm.tsx - Report data
src/lib/reports.ts - Manager area
src/routes/_authenticated/manager.tsx - Official report form
src/components/manager/ManagerReportForm.tsx - Manager operations
src/lib/manager.functions.ts
Data and services
- Station data and status
src/lib/stations.ts - Supabase client
src/integrations/supabase/client.ts - Preview auth storage
src/integrations/supabase/previewAuthStorage.ts - Supabase
- Nominatim
- OSRM routing
Other components
- Driver
- Station manager
Connections 39
- Driver → Station browser: browses stations
src/routes/_authenticated/app.tsx - Driver → Authentication: signs in
src/routes/auth.tsx - Station manager → Authentication: signs in
src/routes/auth.tsx - Station browser → Auth state: reads session
src/routes/_authenticated/app.tsx - Authentication → Auth state: uses auth state
src/routes/auth.tsx - Auth state → Supabase client: reads auth session
src/hooks/useAuth.tsx - Manager access guard → Manager operations: checks access
src/hooks/useManagerGuard.tsx - Station browser → Map and search panel: renders
src/routes/_authenticated/app.tsx - Station browser → Station data and status: loads stations
src/routes/_authenticated/app.tsx - Map and search panel → Station map: renders
src/components/map/MapPanel.tsx - Map and search panel → Station search: renders
src/components/map/MapPanel.tsx - Map and search panel → Route search: renders
src/components/map/MapPanel.tsx - Map and search panel → Station data and status: fetches station data
src/components/map/MapPanel.tsx - Map and search panel → Geocoding and routing: uses route helpers
src/components/map/MapPanel.tsx - Route search → Geocoding and routing: geocodes and routes
src/components/map/RouteSearchPanel.tsx - Geocoding and routing → Nominatim: geocodes with
src/lib/route.ts - Geocoding and routing → OSRM routing: requests routes
src/lib/route.ts - Route view → Supabase client: uses client
src/routes/_authenticated/route.tsx - Station details page → Station details card: renders
src/routes/_authenticated/station.$stationId.tsx - Station details page → Driver status report: renders
src/routes/_authenticated/station.$stationId.tsx - Station details page → Favorite control: renders
src/routes/_authenticated/station.$stationId.tsx - Station details page → Station data and status: loads station
src/routes/_authenticated/station.$stationId.tsx - Station details page → Manager access guard: checks access
src/routes/_authenticated/station.$stationId.tsx - Favorites page → Favorite control: renders
src/routes/_authenticated/favorites.tsx - Favorites page → Favorite actions: uses favorites
src/routes/_authenticated/favorites.tsx - Favorites page → Station data and status: loads stations
src/routes/_authenticated/favorites.tsx - Favorites page → Manager access guard: checks access
src/routes/_authenticated/favorites.tsx - Driver status report → Auth state: uses user session
src/components/station/ReportStatusForm.tsx - Driver status report → Report data: submits reports
src/components/station/ReportStatusForm.tsx - Report data → Supabase client: reads and writes
src/lib/reports.ts - Manager area → Manager operations: loads manager data
src/routes/_authenticated/manager.tsx - Manager area → Official report form: renders
src/routes/_authenticated/manager.tsx - Manager area → Station data and status: formats station data
src/routes/_authenticated/manager.tsx - Manager area → Auth state: uses session
src/routes/_authenticated/manager.tsx - Official report form → Manager operations: loads and submits reports
src/components/manager/ManagerReportForm.tsx - Manager operations → Supabase client: queries via auth context
- Station data and status → Supabase client: queries station data
src/lib/stations.ts - Supabase client → Preview auth storage: configures auth storage
src/integrations/supabase/client.ts - Supabase client → Supabase: connects to
src/integrations/supabase/client.ts