How ludix45/sab-android works
SAB Android is a Flutter bike-sharing reservation and ride app backed by a FastAPI service. Users authenticate, select a pickup point and time, manage reservations, then follow simulated bike assignment and ride status; completed rides feed profile and carbon-impact estimates. The graph combines documented app capabilities with sampled backend calls and data handling. Flutter implementation details were not sampled, so client-side links are documented at the workflow level rather than inferred from imports; hardware control and telemetry are not yet integrated.
Main entry points: main.py FastAPI application · bike_simulation.py Bike simulation routes · auth.py Authentication routes · prenotation_request.py Reservation routes
Components 23
Flutter user experience
- App entrypoint
lib/main.dart - Login and reset
lib/login.dart - Bike booking
lib/screens/bike_booking_screen.dart - Location map
lib/screens/prenotazione_map_screen.dart - Reservation list
lib/lista_prenotazioni.dart - Ride screen
lib/screens/corsa_bici_screen.dart
Client services
- HTTP client
lib/api_client.dart - Reservation API
lib/prenotazioni_api.dart - Session storage
lib/session_storage.dart - Bike notifications
lib/notification_polling.dart - Carbon estimate UI
lib/widgets/carbon_calculator.dart
Backend API
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/routers/auth.py - Reservation routes
backend/app/routers/prenotation_request.py - Bike simulation routes
backend/app/routers/bike_simulation.py - Profile statistics
backend/app/routers/profile_stats.py
Backend domain and storage
- Token and password utilities
backend/app/utils/auth.py - Reset email delivery
backend/app/utils/authEmail.py - Database access
backend/app/database.py - Reservation and bike records
backend/app/models.py - Ride impact calculation
backend/app/ride_impact.py
Other components
- App user
- SMTP service
Connections 33
- App user → App entrypoint: uses
- App entrypoint → Login and reset: presents
- App entrypoint → Bike booking: presents
- App user → Bike booking: selects ride
README.md - Bike booking → Location map: selects location
README.md - Bike booking → Reservation API: submits booking
README.md - Reservation list → Reservation API: loads bookings
README.md - Ride screen → Bike notifications: polls status
README.md - Reservation list → Bike notifications: polls status
README.md - Login and reset → HTTP client: sends credentials
README.md - Reservation API → HTTP client: uses HTTP
- Bike notifications → HTTP client: fetches events
README.md - HTTP client → FastAPI application: calls API
README.md - FastAPI application → Authentication routes: registers router
backend/app/main.py - FastAPI application → Reservation routes: registers router
backend/app/main.py - FastAPI application → Bike simulation routes: registers router
backend/app/main.py - FastAPI application → Profile statistics: registers router
backend/app/main.py - FastAPI application → Database access: uses sessions
backend/app/main.py - FastAPI application → Bike simulation routes: starts simulation
backend/app/main.py - Authentication routes → Token and password utilities: verifies credentials
backend/app/routers/auth.py - Authentication routes → Reset email delivery: sends reset
backend/app/routers/auth.py - Reset email delivery → SMTP service: delivers email
backend/app/utils/authEmail.py - Authentication routes → Database access: reads user
backend/app/routers/auth.py - Reservation routes → Token and password utilities: validates token
backend/app/routers/prenotation_request.py - Reservation routes → Database access: uses session
backend/app/routers/prenotation_request.py - Reservation routes → Reservation and bike records: reads and writes
backend/app/routers/prenotation_request.py - Bike simulation routes → Token and password utilities: validates token
backend/app/routers/bike_simulation.py - Bike simulation routes → Database access: uses session
backend/app/routers/bike_simulation.py - Bike simulation routes → Reservation and bike records: updates bike state
backend/app/routers/bike_simulation.py - Profile statistics → Token and password utilities: validates token
backend/app/routers/profile_stats.py - Profile statistics → Reservation and bike records: reads rides
backend/app/routers/profile_stats.py - Profile statistics → Ride impact calculation: finalizes estimates
backend/app/routers/profile_stats.py - Ride impact calculation → Carbon estimate UI: provides estimate data
README.md