How yashhhh2526/rail_safe_alert- works
RailSafe Alert is a railway journey tracker whose central workflow is train search, route and destination selection, live monitoring, then an approaching-destination alarm. The web client is the most fully documented product surface, backed by an Express API, train data and persistent account/journey services; the tree also includes a separate React Native client. README documents capabilities that the sampled excerpts do not fully expose, so those relationships are cited to the README; uncertain implementation links are omitted.
Main entry points: App.jsx Web app routing · TrainDetails.jsx Route and alarm setup · ActiveAlarm.jsx Active monitoring · server.js Express API
Components 23
Web journey experience
- Web app routing
web-frontend/src/App.jsx - Train search
web-frontend/src/pages/Home.jsx - Route and alarm setup
web-frontend/src/pages/TrainDetails.jsx - Journey history
web-frontend/src/pages/Journeys.jsx - Alarm preferences
web-frontend/src/pages/Settings.jsx - Authentication client
web-frontend/src/utils/authService.js - Journey persistence client
web-frontend/src/utils/journeyService.js
Tracking and alerts
- Active monitoring
web-frontend/src/pages/ActiveAlarm.jsx - Telemetry client
web-frontend/src/services/liveTrackingService.js - ETA and time helpers
web-frontend/src/utils/timeUtils.js - Route distance math
web-frontend/src/utils/railwayDistance.js - Multisensory alarm
web-frontend/src/utils/alarmAudioService.js - Preference storage
web-frontend/src/utils/settingsService.js
Backend API
- Express API
backend/server.js - Train and telemetry routes
backend/routes/trains.js - Account routes
backend/routes/auth.js - Journey routes
backend/routes/journey.js - Rail kilometrage service
backend/services/railwayDistanceService.js
Persistence and integrations
- Timetable and demo trains
backend/data/demoTrains.js - MySQL database
backend/config/database.js - RailRadar telemetry
- Browser alert APIs
Other components
- Passenger
Connections 32
- Passenger → Web app routing: uses
README.md - Web app routing → Train search: routes to
web-frontend/src/App.jsx - Web app routing → Route and alarm setup: routes to
web-frontend/src/App.jsx - Web app routing → Active monitoring: routes to
web-frontend/src/App.jsx - Web app routing → Journey history: routes to
web-frontend/src/App.jsx - Web app routing → Alarm preferences: routes to
web-frontend/src/App.jsx - Train search → Route and alarm setup: selects train
README.md - Route and alarm setup → Active monitoring: starts monitoring
README.md - Route and alarm setup → Route distance math: calculates route distance
web-frontend/src/pages/TrainDetails.jsx - Route and alarm setup → Telemetry client: requests telemetry
web-frontend/src/pages/TrainDetails.jsx - Route and alarm setup → Journey persistence client: saves journey
web-frontend/src/pages/TrainDetails.jsx - Active monitoring → Telemetry client: fetches live data
web-frontend/src/pages/ActiveAlarm.jsx - Active monitoring → ETA and time helpers: uses time helpers
web-frontend/src/pages/ActiveAlarm.jsx - Active monitoring → Preference storage: reads preferences
web-frontend/src/pages/ActiveAlarm.jsx - Active monitoring → Multisensory alarm: triggers alarm
README.md - Multisensory alarm → Browser alert APIs: uses audio vibration speech
web-frontend/src/utils/alarmAudioService.js - Alarm preferences → Preference storage: stores preferences
web-frontend/src/pages/Settings.jsx - Alarm preferences → Multisensory alarm: previews sound
web-frontend/src/pages/Settings.jsx - Journey history → Journey persistence client: loads journeys
web-frontend/src/pages/Journeys.jsx - Journey persistence client → Authentication client: gets token
web-frontend/src/utils/journeyService.js - Authentication client → Express API: calls account API
web-frontend/src/utils/authService.js - Journey persistence client → Express API: calls journey API
web-frontend/src/utils/journeyService.js - Telemetry client → Express API: requests live endpoint
web-frontend/src/services/liveTrackingService.js - Express API → Train and telemetry routes: mounts routes
backend/server.js - Express API → Account routes: mounts routes
backend/server.js - Express API → Journey routes: mounts routes
backend/server.js - Train and telemetry routes → Rail kilometrage service: processes route distances
backend/routes/trains.js - Train and telemetry routes → Timetable and demo trains: uses train profiles
backend/routes/trains.js - Train and telemetry routes → RailRadar telemetry: proxies telemetry
README.md - Account routes → MySQL database: persists accounts
README.md - Journey routes → MySQL database: persists journeys
README.md - Train search → Timetable and demo trains: uses verified search data
web-frontend/src/pages/Home.jsx