# amazetbm/wmata_dashboared_alt architecture

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

- Interactive diagram: https://gitdiagram.com/amazetbm/wmata_dashboared_alt
- Repository: https://github.com/amazetbm/wmata_dashboared_alt

## Overview

WMATA Operator Dashboard presents live and historical rail and bus operations data, with an MCP interface for transit queries. The main workflow runs from the dashboard or MCP caller through HTTP-backed API routes to WMATA and MongoDB, then returns data for display or tool results. A 30-second poller separately snapshots live feeds and computes schedule adherence. The README documents additional map, replay, and bus capabilities; unsampled route implementations are represented by their exact directories, with uncertain internal links omitted.

Main entry points: [`client/src/app/components/dashboard/dashboard.component.ts`](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/dashboard/dashboard.component.ts) (Rail dashboard), [`client/src/app/services/wmata.service.ts`](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/services/wmata.service.ts) (HTTP service), [`server/src/middleware/wmata.js`](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/middleware/wmata.js) (WMATA client), [`server/src/routes`](https://github.com/amazetbm/wmata_dashboared_alt/tree/darkmode/server/src/routes) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Operator dashboard"]
  node_angular_app["Angular app<br/>[app.ts]"]
  node_rail_dashboard["Rail dashboard"]
  node_rail_map["Rail map"]
  node_rail_incidents["Rail incidents"]
  node_train_positions["Train positions"]
  node_station_monitor["Station monitor"]
  node_adherence_panel["Adherence history"]
  node_outage_panel["Outage history"]
  node_historical_view["Historical replay"]
  node_health_scorecard["Service scorecard"]
  node_bus_map["Bus map"]
  node_frontend_api["HTTP service<br/>[wmata.service.ts]"]
end

subgraph group_backend["API and polling"]
  node_express_api["Express API<br/>[index.js]"]
  node_api_routes["API routes"]
  node_map_route["Rail map API<br/>[map.js]"]
  node_bus_route["Bus API<br/>[bus.js]"]
  node_prediction_route["Arrival predictions<br/>[predictions.js]"]
  node_poller["Snapshot poller<br/>[poller.js]"]
  node_wmata_client["WMATA client<br/>[wmata.js]"]
end

subgraph group_storage["Snapshot storage"]
  node_mongo[("MongoDB")]
  node_snapshot_models[("Snapshot models")]
end

subgraph group_mcp["MCP interface"]
  node_mcp_server["MCP server<br/>[index.ts]"]
  node_mcp_tools["Transit tools"]
  node_mcp_client["API fetch client<br/>[client.ts]"]
end

node_operator(("Operator"))
node_wmata_service{{"WMATA API"}}
node_mcp_caller(("MCP caller"))

node_operator -->|"opens"| node_angular_app
node_angular_app -->|"routes to"| node_rail_dashboard
node_angular_app -->|"lazy-loads"| node_bus_map
node_rail_dashboard -->|"renders"| node_rail_map
node_rail_dashboard -->|"renders"| node_rail_incidents
node_rail_dashboard -->|"renders"| node_train_positions
node_rail_dashboard -->|"renders"| node_station_monitor
node_rail_dashboard -->|"renders"| node_adherence_panel
node_rail_dashboard -->|"renders"| node_outage_panel
node_rail_dashboard -->|"renders"| node_historical_view
node_rail_dashboard -->|"renders"| node_health_scorecard
node_rail_map -->|"requests data"| node_frontend_api
node_train_positions -->|"requests data"| node_frontend_api
node_station_monitor -->|"requests arrivals"| node_frontend_api
node_adherence_panel -->|"requests history"| node_frontend_api
node_outage_panel -->|"requests outages"| node_frontend_api
node_historical_view -->|"requests history"| node_frontend_api
node_health_scorecard -->|"requests status"| node_frontend_api
node_bus_map -->|"requests bus data"| node_frontend_api
node_frontend_api -->|"calls HTTP endpoints"| node_api_routes
node_express_api -->|"mounts"| node_api_routes
node_express_api -->|"starts"| node_poller
node_api_routes -->|"fetches feeds"| node_wmata_client
node_map_route -->|"fetches rail map"| node_wmata_client
node_prediction_route -->|"fetches arrivals"| node_wmata_client
node_bus_route -->|"fetches bus data"| node_wmata_client
node_poller -->|"fetches feeds"| node_wmata_client
node_wmata_client -->|"requests data"| node_wmata_service
node_poller -->|"writes snapshots"| node_snapshot_models
node_api_routes -->|"reads history"| node_snapshot_models
node_snapshot_models -.->|"persists records"| node_mongo
node_mcp_caller -->|"invokes tools"| node_mcp_server
node_mcp_server -->|"registers tools"| node_mcp_tools
node_mcp_tools -->|"fetches API data"| node_mcp_client
node_mcp_client -.->|"calls endpoints"| node_express_api

click node_angular_app "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/app.ts"
click node_rail_dashboard "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/dashboard/dashboard.component.ts"
click node_rail_map "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/map-panel/map-panel.component.ts"
click node_rail_incidents "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/incidents-panel/incidents-panel.component.ts"
click node_train_positions "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/train-positions-panel/train-positions-panel.component.ts"
click node_station_monitor "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/station-monitor/station-monitor.component.ts"
click node_adherence_panel "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/adherence-panel/adherence-panel.component.ts"
click node_outage_panel "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/outage-panel/outage-panel.component.ts"
click node_historical_view "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/historical-view/historical-view.component.ts"
click node_health_scorecard "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/service-health-scorecard/service-health-scorecard.component.ts"
click node_bus_map "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/bus-map/bus-map.component.ts"
click node_frontend_api "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/services/wmata.service.ts"
click node_express_api "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/index.js"
click node_api_routes "https://github.com/amazetbm/wmata_dashboared_alt/tree/darkmode/server/src/routes"
click node_map_route "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/routes/map.js"
click node_bus_route "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/routes/bus.js"
click node_prediction_route "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/routes/predictions.js"
click node_poller "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/jobs/poller.js"
click node_wmata_client "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/middleware/wmata.js"
click node_snapshot_models "https://github.com/amazetbm/wmata_dashboared_alt/tree/darkmode/server/src/models"
click node_mcp_server "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/mcp/src/index.ts"
click node_mcp_tools "https://github.com/amazetbm/wmata_dashboared_alt/tree/darkmode/mcp/src/tools"
click node_mcp_client "https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/mcp/src/client.ts"

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_angular_app,node_rail_dashboard,node_rail_map,node_rail_incidents,node_train_positions,node_station_monitor,node_adherence_panel,node_outage_panel,node_historical_view,node_health_scorecard,node_bus_map,node_frontend_api toneBlue
class node_express_api,node_api_routes,node_map_route,node_bus_route,node_prediction_route,node_poller,node_wmata_client toneAmber
class node_mongo,node_snapshot_models,node_wmata_service toneMint
class node_mcp_server,node_mcp_tools,node_mcp_client toneRose
class node_operator,node_mcp_caller toneIndigo
```

## Components

### Operator dashboard

- [Angular app](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/app.ts): `client/src/app/app.ts`
- [Rail dashboard](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/dashboard/dashboard.component.ts): `client/src/app/components/dashboard/dashboard.component.ts`
- [Rail map](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/map-panel/map-panel.component.ts): `client/src/app/components/map-panel/map-panel.component.ts`
- [Rail incidents](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/incidents-panel/incidents-panel.component.ts): `client/src/app/components/incidents-panel/incidents-panel.component.ts`
- [Train positions](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/train-positions-panel/train-positions-panel.component.ts): `client/src/app/components/train-positions-panel/train-positions-panel.component.ts`
- [Station monitor](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/station-monitor/station-monitor.component.ts): `client/src/app/components/station-monitor/station-monitor.component.ts`
- [Adherence history](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/adherence-panel/adherence-panel.component.ts): `client/src/app/components/adherence-panel/adherence-panel.component.ts`
- [Outage history](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/outage-panel/outage-panel.component.ts): `client/src/app/components/outage-panel/outage-panel.component.ts`
- [Historical replay](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/historical-view/historical-view.component.ts): `client/src/app/components/historical-view/historical-view.component.ts`
- [Service scorecard](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/service-health-scorecard/service-health-scorecard.component.ts): `client/src/app/components/service-health-scorecard/service-health-scorecard.component.ts`
- [Bus map](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/components/bus-map/bus-map.component.ts): `client/src/app/components/bus-map/bus-map.component.ts`
- [HTTP service](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/client/src/app/services/wmata.service.ts): `client/src/app/services/wmata.service.ts`

### API and polling

- [Express API](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/index.js): `server/src/index.js`
- [API routes](https://github.com/amazetbm/wmata_dashboared_alt/tree/darkmode/server/src/routes): `server/src/routes`
- [Rail map API](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/routes/map.js): `server/src/routes/map.js`
- [Bus API](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/routes/bus.js): `server/src/routes/bus.js`
- [Arrival predictions](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/routes/predictions.js): `server/src/routes/predictions.js`
- [Snapshot poller](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/jobs/poller.js): `server/src/jobs/poller.js`
- [WMATA client](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/server/src/middleware/wmata.js): `server/src/middleware/wmata.js`

### Snapshot storage

- **MongoDB**
- [Snapshot models](https://github.com/amazetbm/wmata_dashboared_alt/tree/darkmode/server/src/models): `server/src/models`

### MCP interface

- [MCP server](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/mcp/src/index.ts): `mcp/src/index.ts`
- [Transit tools](https://github.com/amazetbm/wmata_dashboared_alt/tree/darkmode/mcp/src/tools): `mcp/src/tools`
- [API fetch client](https://github.com/amazetbm/wmata_dashboared_alt/blob/darkmode/mcp/src/client.ts): `mcp/src/client.ts`

### Other components

- **Operator**
- **WMATA API**
- **MCP caller**

## Connections

- Operator → Angular app: opens (evidence: `README.md`)
- Angular app → Rail dashboard: routes to
- Angular app → Bus map: lazy-loads
- Rail dashboard → Rail map: renders (evidence: `client/src/app/components/dashboard/dashboard.component.ts`)
- Rail dashboard → Rail incidents: renders (evidence: `client/src/app/components/dashboard/dashboard.component.ts`)
- Rail dashboard → Train positions: renders (evidence: `client/src/app/components/dashboard/dashboard.component.ts`)
- Rail dashboard → Station monitor: renders (evidence: `client/src/app/components/dashboard/dashboard.component.ts`)
- Rail dashboard → Adherence history: renders (evidence: `client/src/app/components/dashboard/dashboard.component.ts`)
- Rail dashboard → Outage history: renders (evidence: `client/src/app/components/dashboard/dashboard.component.ts`)
- Rail dashboard → Historical replay: renders (evidence: `client/src/app/components/dashboard/dashboard.component.ts`)
- Rail dashboard → Service scorecard: renders (evidence: `client/src/app/components/dashboard/dashboard.component.ts`)
- Rail map → HTTP service: requests data (evidence: `client/src/app/components/map-panel/map-panel.component.ts`)
- Train positions → HTTP service: requests data (evidence: `client/src/app/components/train-positions-panel/train-positions-panel.component.ts`)
- Station monitor → HTTP service: requests arrivals (evidence: `client/src/app/components/station-monitor/station-monitor.component.ts`)
- Adherence history → HTTP service: requests history (evidence: `client/src/app/components/adherence-panel/adherence-panel.component.ts`)
- Outage history → HTTP service: requests outages (evidence: `client/src/app/components/outage-panel/outage-panel.component.ts`)
- Historical replay → HTTP service: requests history (evidence: `client/src/app/components/historical-view/historical-view.component.ts`)
- Service scorecard → HTTP service: requests status (evidence: `client/src/app/components/service-health-scorecard/service-health-scorecard.component.ts`)
- Bus map → HTTP service: requests bus data (evidence: `client/src/app/components/bus-map/bus-map.component.ts`)
- HTTP service → API routes: calls HTTP endpoints (evidence: `client/src/app/services/wmata.service.ts`)
- Express API → API routes: mounts (evidence: `server/src/index.js`)
- Express API → Snapshot poller: starts (evidence: `server/src/index.js`)
- API routes → WMATA client: fetches feeds (evidence: `server/src/routes/bus.js`)
- Rail map API → WMATA client: fetches rail map (evidence: `server/src/routes/map.js`)
- Arrival predictions → WMATA client: fetches arrivals (evidence: `server/src/routes/predictions.js`)
- Bus API → WMATA client: fetches bus data (evidence: `server/src/routes/bus.js`)
- Snapshot poller → WMATA client: fetches feeds (evidence: `server/src/jobs/poller.js`)
- WMATA client → WMATA API: requests data (evidence: `server/src/middleware/wmata.js`)
- Snapshot poller → Snapshot models: writes snapshots (evidence: `server/src/jobs/poller.js`)
- API routes → Snapshot models: reads history (evidence: `server/src/routes/bus.js`)
- Snapshot models → MongoDB: persists records
- MCP caller → MCP server: invokes tools (evidence: `mcp/src/index.ts`)
- MCP server → Transit tools: registers tools (evidence: `mcp/src/index.ts`)
- Transit tools → API fetch client: fetches API data (evidence: `mcp/src/tools/service_history.ts`)
- API fetch client → Express API: calls endpoints
