How antonny890/rutas-beta works
ENRUTA is an Arequipa public-transit interface for passengers, drivers, and administrators. The main passenger workflow is to explore live bus and route information, choose a route or stops, and request a fare estimate; authenticated users enter role-specific workspaces. Shared React context holds user, fleet, route, and fare state, with sample transit data and geographic fare calculations supporting the interface. The supplied excerpts show a mock-data-backed frontend, not a connected transit backend. Some driver and administrative details are visible only through imports or UI excerpts, so their internal behavior is summarized conservatively.
Main entry points: App.tsx Role workspace · AppContext.tsx Application state · PassengerView.tsx Passenger workspace · mockData.ts Transit sample data
Components 18
Application shell
- Role workspace
src/App.tsx
Passenger tools
- Passenger workspace
src/components/passenger/PassengerView.tsx - Live transit map
src/components/map/ArequipaMap.tsx - Trip fare planner
src/components/passenger/TripPlanner.tsx - Route catalog
src/components/passenger/RoutesCatalog.tsx - Bus details
src/components/passenger/BusDetailModal.tsx
Transit operations
- Driver workspace
src/components/driver/DriverView.tsx - Admin dashboard
src/components/admin/AdminView.tsx
Shared state and data
- Fare and geography
src/utils/geoUtils.ts - Application state
src/context/AppContext.tsx - Transit sample data
src/data/mockData.ts - Transit domain types
src/types/index.ts
Access and navigation
- Login screen
src/components/auth/LoginScreen.tsx - Authentication modal
src/components/auth/AuthModal.tsx - Role header
src/components/common/Header.tsx - Bottom navigation
src/components/common/BottomNav.tsx - Toast notifications
src/components/common/ToastContainer.tsx
Other components
- Transit user
Connections 30
- Transit user → Role workspace: opens
- Role workspace → Application state: provides state
src/App.tsx - Role workspace → Login screen: shows when signed out
src/App.tsx - Role workspace → Authentication modal: renders
src/App.tsx - Role workspace → Role header: renders
src/App.tsx - Role workspace → Bottom navigation: renders
src/App.tsx - Role workspace → Toast notifications: renders
src/App.tsx - Role workspace → Passenger workspace: selects by role
src/App.tsx - Role workspace → Driver workspace: selects by role
src/App.tsx - Role workspace → Admin dashboard: selects by role
src/App.tsx - Passenger workspace → Application state: reads state
src/components/passenger/PassengerView.tsx - Passenger workspace → Live transit map: renders
src/components/passenger/PassengerView.tsx - Passenger workspace → Trip fare planner: renders
src/components/passenger/PassengerView.tsx - Passenger workspace → Route catalog: renders
src/components/passenger/PassengerView.tsx - Passenger workspace → Bus details: renders
src/components/passenger/PassengerView.tsx - Trip fare planner → Fare and geography: calculates fare
src/components/passenger/TripPlanner.tsx - Trip fare planner → Application state: reads state
src/components/passenger/TripPlanner.tsx - Route catalog → Application state: reads routes
src/components/passenger/RoutesCatalog.tsx - Live transit map → Application state: reads fleet state
src/components/map/ArequipaMap.tsx - Live transit map → Transit sample data: uses map center
src/components/map/ArequipaMap.tsx - Bus details → Application state: reads state
src/components/passenger/BusDetailModal.tsx - Driver workspace → Application state: uses shared state
src/components/driver/DriverView.tsx - Admin dashboard → Application state: reads and updates
src/components/admin/AdminView.tsx - Authentication modal → Application state: updates access state
src/components/auth/AuthModal.tsx - Authentication modal → Transit sample data: uses default users
src/components/auth/AuthModal.tsx - Application state → Transit sample data: initializes transit state
src/context/AppContext.tsx - Application state → Fare and geography: uses geographic helpers
src/context/AppContext.tsx - Fare and geography → Transit sample data: uses coverage constants
src/utils/geoUtils.ts - Transit sample data → Transit domain types: types transit records
src/data/mockData.ts - Fare and geography → Transit domain types: returns fare quote
src/utils/geoUtils.ts