# shivram-aade/movesmart architecture

> Architecture diagram of the GitHub repository shivram-aade/movesmart, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shivram-aade/movesmart
- Repository: https://github.com/shivram-aade/movesmart

## Overview

MoveSmart is a passenger-facing transit search, tracking, and ticketing application. Riders search between stops, compare direct or transfer journeys by ETA, fare, seats, and crowding, then follow buses or book a demo ticket. The backend also supplies account features, saved searches, notifications, and ticket documents. The README documents simulation, PDF/QR tickets, maps, and user features; some of those implementations are unsampled, so their internal links are left undocumented rather than inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/App.jsx) (Page router), [`frontend/src/pages/RoutesPage.jsx`](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/RoutesPage.jsx) (Route search), [`frontend/src/api.js`](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/api.js) (API client), [`backend/server.js`](https://github.com/shivram-aade/movesmart/blob/main/backend/server.js) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Passenger app"]
  node_app["Page router<br/>[App.jsx]"]
  node_search["Route search<br/>[RoutesPage.jsx]"]
  node_live["Live tracking<br/>[Live.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_notifyui["Alerts view<br/>[Notifications.jsx]"]
  node_authui["Auth forms<br/>[Auth.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_planner["Stop planner<br/>[PlannerForm.jsx]"]
  node_tripdisplay["Trip details<br/>[TripCard.jsx]"]
  node_map["Bus map<br/>[liveMap.jsx]"]
end

subgraph group_transit["Transit information"]
  node_transitlogic["Trip and ETA engine<br/>[transit.js]"]
  node_timeutil["Timetable calculations<br/>[utils.js]"]
  node_simulator["Bus simulator<br/>[simulate.js]"]
end

subgraph group_accounts["Accounts and alerts"]
  node_authlogic["Authentication<br/>[auth.js]"]
end

subgraph group_booking["Ticketing"]
  node_bookingui["Booking dialog<br/>[Bookmodal.jsx]"]
  node_ticketview["Digital tickets<br/>[tickets.jsx]"]
  node_ticketlogic["Ticket service<br/>[tickets.js]"]
end

subgraph group_infra["Persistence and simulation"]
  node_server["HTTP API<br/>[server.js]"]
  node_mysql[("MySQL pool<br/>[db.js]")]
  node_schema[("Transit and user data<br/>[schema.sql]")]
end

node_rider(("Passenger"))
node_maptiles["OpenStreetMap"]

node_rider -->|"uses"| node_app
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_live
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_notifyui
node_app -->|"routes to"| node_authui
node_search -->|"requests trips"| node_api
node_live -->|"requests buses"| node_api
node_authui -->|"uses"| node_authstate
node_authstate -->|"requests auth"| node_api
node_search -->|"renders"| node_planner
node_search -->|"renders"| node_tripdisplay
node_search -->|"renders"| node_map
node_live -.->|"renders"| node_map
node_search -->|"opens"| node_bookingui
node_bookingui -->|"submits booking"| node_api
node_ticketview -->|"requests tickets"| node_api
node_api -->|"sends API requests"| node_server
node_server -->|"dispatches trips"| node_transitlogic
node_server -->|"dispatches tickets"| node_ticketlogic
node_server -->|"uses auth"| node_authlogic
node_transitlogic -->|"calculates ETAs"| node_timeutil
node_transitlogic -->|"loads transit data"| node_mysql
node_ticketlogic -->|"reads and writes"| node_mysql
node_server -->|"queries account data"| node_mysql
node_simulator -->|"updates bus state"| node_mysql
node_schema -.->|"defines stored tables"| node_mysql
node_map -.->|"displays map tiles"| node_maptiles
node_transitlogic -.->|"uses simulated state"| node_simulator

click node_app "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/App.jsx"
click node_search "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/RoutesPage.jsx"
click node_live "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/Live.jsx"
click node_dashboard "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/Dashboard.jsx"
click node_notifyui "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/Notifications.jsx"
click node_authui "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/Auth.jsx"
click node_api "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/api.js"
click node_authstate "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/AuthContext.jsx"
click node_planner "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/components/PlannerForm.jsx"
click node_tripdisplay "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/components/TripCard.jsx"
click node_map "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/components/liveMap.jsx"
click node_bookingui "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/components/Bookmodal.jsx"
click node_ticketview "https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/tickets.jsx"
click node_server "https://github.com/shivram-aade/movesmart/blob/main/backend/server.js"
click node_transitlogic "https://github.com/shivram-aade/movesmart/blob/main/backend/transit.js"
click node_timeutil "https://github.com/shivram-aade/movesmart/blob/main/backend/utils.js"
click node_authlogic "https://github.com/shivram-aade/movesmart/blob/main/backend/auth.js"
click node_ticketlogic "https://github.com/shivram-aade/movesmart/blob/main/backend/tickets.js"
click node_simulator "https://github.com/shivram-aade/movesmart/blob/main/backend/simulate.js"
click node_mysql "https://github.com/shivram-aade/movesmart/blob/main/backend/db.js"
click node_schema "https://github.com/shivram-aade/movesmart/blob/main/database/schema.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_search,node_live,node_dashboard,node_notifyui,node_authui,node_api,node_authstate,node_planner,node_tripdisplay,node_map toneBlue
class node_transitlogic,node_timeutil,node_simulator toneAmber
class node_authlogic toneMint
class node_bookingui,node_ticketview,node_ticketlogic toneRose
class node_server,node_mysql,node_schema,node_rider,node_maptiles toneIndigo
```

## Components

### Passenger app

- [Page router](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Route search](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/RoutesPage.jsx): `frontend/src/pages/RoutesPage.jsx`
- [Live tracking](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/Live.jsx): `frontend/src/pages/Live.jsx`
- [Dashboard](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Alerts view](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/Notifications.jsx): `frontend/src/pages/Notifications.jsx`
- [Auth forms](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/Auth.jsx): `frontend/src/pages/Auth.jsx`
- [API client](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Auth state](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/AuthContext.jsx): `frontend/src/AuthContext.jsx`
- [Stop planner](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/components/PlannerForm.jsx): `frontend/src/components/PlannerForm.jsx`
- [Trip details](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/components/TripCard.jsx): `frontend/src/components/TripCard.jsx`
- [Bus map](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/components/liveMap.jsx): `frontend/src/components/liveMap.jsx`

### Transit information

- [Trip and ETA engine](https://github.com/shivram-aade/movesmart/blob/main/backend/transit.js): `backend/transit.js`
- [Timetable calculations](https://github.com/shivram-aade/movesmart/blob/main/backend/utils.js): `backend/utils.js`
- [Bus simulator](https://github.com/shivram-aade/movesmart/blob/main/backend/simulate.js): `backend/simulate.js`

### Accounts and alerts

- [Authentication](https://github.com/shivram-aade/movesmart/blob/main/backend/auth.js): `backend/auth.js`

### Ticketing

- [Booking dialog](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/components/Bookmodal.jsx): `frontend/src/components/Bookmodal.jsx`
- [Digital tickets](https://github.com/shivram-aade/movesmart/blob/main/frontend/src/pages/tickets.jsx): `frontend/src/pages/tickets.jsx`
- [Ticket service](https://github.com/shivram-aade/movesmart/blob/main/backend/tickets.js): `backend/tickets.js`

### Persistence and simulation

- [HTTP API](https://github.com/shivram-aade/movesmart/blob/main/backend/server.js): `backend/server.js`
- [MySQL pool](https://github.com/shivram-aade/movesmart/blob/main/backend/db.js): `backend/db.js`
- [Transit and user data](https://github.com/shivram-aade/movesmart/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Passenger**
- **OpenStreetMap**

## Connections

- Passenger → Page router: uses (evidence: `README.md`)
- Page router → Route search: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Live tracking: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Alerts view: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Auth forms: routes to (evidence: `frontend/src/App.jsx`)
- Route search → API client: requests trips (evidence: `frontend/src/pages/RoutesPage.jsx`)
- Live tracking → API client: requests buses (evidence: `frontend/src/pages/Live.jsx`)
- Auth forms → Auth state: uses (evidence: `frontend/src/pages/Auth.jsx`)
- Auth state → API client: requests auth (evidence: `frontend/src/AuthContext.jsx`)
- Route search → Stop planner: renders (evidence: `frontend/src/pages/RoutesPage.jsx`)
- Route search → Trip details: renders (evidence: `frontend/src/pages/RoutesPage.jsx`)
- Route search → Bus map: renders (evidence: `frontend/src/pages/RoutesPage.jsx`)
- Live tracking → Bus map: renders
- Route search → Booking dialog: opens (evidence: `frontend/src/pages/RoutesPage.jsx`)
- Booking dialog → API client: submits booking (evidence: `frontend/src/components/Bookmodal.jsx`)
- Digital tickets → API client: requests tickets (evidence: `frontend/src/pages/tickets.jsx`)
- API client → HTTP API: sends API requests (evidence: `frontend/src/api.js`)
- HTTP API → Trip and ETA engine: dispatches trips (evidence: `backend/server.js`)
- HTTP API → Ticket service: dispatches tickets (evidence: `backend/server.js`)
- HTTP API → Authentication: uses auth (evidence: `backend/server.js`)
- Trip and ETA engine → Timetable calculations: calculates ETAs (evidence: `backend/transit.js`)
- Trip and ETA engine → MySQL pool: loads transit data (evidence: `backend/transit.js`)
- Ticket service → MySQL pool: reads and writes (evidence: `backend/tickets.js`)
- HTTP API → MySQL pool: queries account data (evidence: `backend/server.js`)
- Bus simulator → MySQL pool: updates bus state (evidence: `backend/simulate.js`)
- Transit and user data → MySQL pool: defines stored tables
- Bus map → OpenStreetMap: displays map tiles
- Trip and ETA engine → Bus simulator: uses simulated state
