# havish06/evroute architecture

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

- Interactive diagram: https://gitdiagram.com/havish06/evroute
- Repository: https://github.com/havish06/evroute

## Overview

This is a browser-based EV trip planning and route intelligence application. Drivers choose a route, vehicle and trip conditions; the app calculates route options with energy and charging estimates, then supports map-based analysis, what-if range exploration and drive-mode telemetry. The main workflow is visible in App, PlanMode and the routing service excerpts. The README is empty, so additional capabilities are represented only where the file tree and indexed module references support them; unsampled implementation details and relationships are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/havish06/evroute/blob/main/src/App.tsx) (App coordinator), [`src/components/modes/PlanMode.tsx`](https://github.com/havish06/evroute/blob/main/src/components/modes/PlanMode.tsx) (Plan mode), [`src/services/astarRouter.ts`](https://github.com/havish06/evroute/blob/main/src/services/astarRouter.ts) (A* route engine), [`src/services/osmRoutingService.ts`](https://github.com/havish06/evroute/blob/main/src/services/osmRoutingService.ts) (OSM routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_trip["Trip planning"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_plan["Plan mode<br/>[PlanMode.tsx]"]
  node_tripinput["Trip setup<br/>[TripInputPanel.tsx]"]
  node_map["Route map<br/>[RouteMap.tsx]"]
  node_routeinfo["Route options"]
  node_analysis["Route analysis"]
  node_elevation["Elevation profile"]
  node_energyview["EV energy panel<br/>[EvEnergyPanel.tsx]"]
  node_charger["Charging details"]
end

subgraph group_routing["Routing and energy"]
  node_astar["A* route engine<br/>[astarRouter.ts]"]
  node_physics["Energy physics<br/>[physicsEngine.ts]"]
  node_predictor["ML energy predictor"]
  node_optimizer["Charging optimizer"]
  node_osm["OSM routing"]
  node_isochrone["Range isochrones"]
  node_engineview["Engine simulator<br/>[EngineMode.tsx]"]
end

subgraph group_drive["Drive intelligence"]
  node_driveview["Drive mode<br/>[DriveMode.tsx]"]
  node_telemetryview["Live telemetry"]
  node_learningview["Model learning"]
  node_mlinsights["ML insights"]
  node_learning[("Telemetry learning")]
  node_weather["Weather service<br/>[weatherService.ts]"]
end

subgraph group_data["Route and vehicle data"]
  node_routes["Route presets<br/>[sampleRoutes.ts]"]
  node_vehicles["Vehicle catalog<br/>[vehicles.ts]"]
  node_roaddata["OSM road geometries"]
end

node_driver(("Driver"))
node_externalweather(("Weather provider"))
node_osrm(("OSRM service"))

node_driver -->|"configures trip"| node_app
node_app -->|"shows mode"| node_plan
node_plan -->|"renders setup"| node_tripinput
node_plan -->|"renders map"| node_map
node_plan -->|"renders options"| node_routeinfo
node_plan -.->|"opens analysis"| node_analysis
node_analysis -->|"renders profile"| node_elevation
node_plan -.->|"shows energy"| node_energyview
node_plan -.->|"shows stations"| node_charger
node_app -->|"computes routes"| node_astar
node_astar -.->|"estimates energy"| node_physics
node_astar -.->|"predicts consumption"| node_predictor
node_astar -.->|"optimizes charging"| node_optimizer
node_astar -->|"gets road geometry"| node_osm
node_routes -->|"reconciles edges"| node_osm
node_osm -->|"reads geometry"| node_roaddata
node_osm -->|"requests route data"| node_osrm
node_app -->|"selects preset"| node_routes
node_app -->|"selects vehicle"| node_vehicles
node_app -->|"refreshes weather"| node_weather
node_weather -.->|"fetches conditions"| node_externalweather
node_app -.->|"switches mode"| node_driveview
node_driveview -->|"renders route"| node_map
node_app -->|"records observation"| node_learning
node_predictor -.->|"uses calibration"| node_learning
node_learningview -->|"reads learning data"| node_learning
node_driveview -.->|"shows telemetry"| node_telemetryview
node_app -->|"opens insights"| node_mlinsights
node_app -->|"shows engine mode"| node_engineview
node_engineview -.->|"inspects routing"| node_astar
node_app -->|"opens range view"| node_isochrone

click node_app "https://github.com/havish06/evroute/blob/main/src/App.tsx"
click node_plan "https://github.com/havish06/evroute/blob/main/src/components/modes/PlanMode.tsx"
click node_tripinput "https://github.com/havish06/evroute/blob/main/src/components/TripInputPanel.tsx"
click node_map "https://github.com/havish06/evroute/blob/main/src/components/RouteMap.tsx"
click node_routeinfo "https://github.com/havish06/evroute/blob/main/src/components/RouteInfoFloatingCard.tsx"
click node_analysis "https://github.com/havish06/evroute/blob/main/src/components/RouteAnalysisDrawer.tsx"
click node_elevation "https://github.com/havish06/evroute/blob/main/src/components/ElevationProfile.tsx"
click node_energyview "https://github.com/havish06/evroute/blob/main/src/components/EvEnergyPanel.tsx"
click node_charger "https://github.com/havish06/evroute/blob/main/src/components/ChargingStationCard.tsx"
click node_astar "https://github.com/havish06/evroute/blob/main/src/services/astarRouter.ts"
click node_physics "https://github.com/havish06/evroute/blob/main/src/services/physicsEngine.ts"
click node_predictor "https://github.com/havish06/evroute/blob/main/src/services/mlEnergyPredictor.ts"
click node_optimizer "https://github.com/havish06/evroute/blob/main/src/services/multiStopChargingOptimizer.ts"
click node_osm "https://github.com/havish06/evroute/blob/main/src/services/osmRoutingService.ts"
click node_isochrone "https://github.com/havish06/evroute/blob/main/src/services/rangeIsochroneService.ts"
click node_engineview "https://github.com/havish06/evroute/blob/main/src/components/modes/EngineMode.tsx"
click node_driveview "https://github.com/havish06/evroute/blob/main/src/components/modes/DriveMode.tsx"
click node_telemetryview "https://github.com/havish06/evroute/blob/main/src/components/LiveTelemetryPanel.tsx"
click node_learningview "https://github.com/havish06/evroute/blob/main/src/components/ModelLearningModal.tsx"
click node_mlinsights "https://github.com/havish06/evroute/blob/main/src/components/MLInsightsModal.tsx"
click node_learning "https://github.com/havish06/evroute/blob/main/src/services/telemetryLearningLoop.ts"
click node_weather "https://github.com/havish06/evroute/blob/main/src/services/weatherService.ts"
click node_routes "https://github.com/havish06/evroute/blob/main/src/data/sampleRoutes.ts"
click node_vehicles "https://github.com/havish06/evroute/blob/main/src/data/vehicles.ts"
click node_roaddata "https://github.com/havish06/evroute/blob/main/src/data/osmRoadGeometries.json"

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_plan,node_tripinput,node_map,node_routeinfo,node_analysis,node_elevation,node_energyview,node_charger toneBlue
class node_astar,node_physics,node_predictor,node_optimizer,node_osm,node_isochrone,node_engineview toneAmber
class node_driveview,node_telemetryview,node_learningview,node_mlinsights,node_learning,node_weather toneMint
class node_routes,node_vehicles,node_roaddata toneRose
class node_driver,node_externalweather,node_osrm toneIndigo
```

## Components

### Trip planning

- [App coordinator](https://github.com/havish06/evroute/blob/main/src/App.tsx): `src/App.tsx`
- [Plan mode](https://github.com/havish06/evroute/blob/main/src/components/modes/PlanMode.tsx): `src/components/modes/PlanMode.tsx`
- [Trip setup](https://github.com/havish06/evroute/blob/main/src/components/TripInputPanel.tsx): `src/components/TripInputPanel.tsx`
- [Route map](https://github.com/havish06/evroute/blob/main/src/components/RouteMap.tsx): `src/components/RouteMap.tsx`
- [Route options](https://github.com/havish06/evroute/blob/main/src/components/RouteInfoFloatingCard.tsx): `src/components/RouteInfoFloatingCard.tsx`
- [Route analysis](https://github.com/havish06/evroute/blob/main/src/components/RouteAnalysisDrawer.tsx): `src/components/RouteAnalysisDrawer.tsx`
- [Elevation profile](https://github.com/havish06/evroute/blob/main/src/components/ElevationProfile.tsx): `src/components/ElevationProfile.tsx`
- [EV energy panel](https://github.com/havish06/evroute/blob/main/src/components/EvEnergyPanel.tsx): `src/components/EvEnergyPanel.tsx`
- [Charging details](https://github.com/havish06/evroute/blob/main/src/components/ChargingStationCard.tsx): `src/components/ChargingStationCard.tsx`

### Routing and energy

- [A* route engine](https://github.com/havish06/evroute/blob/main/src/services/astarRouter.ts): `src/services/astarRouter.ts`
- [Energy physics](https://github.com/havish06/evroute/blob/main/src/services/physicsEngine.ts): `src/services/physicsEngine.ts`
- [ML energy predictor](https://github.com/havish06/evroute/blob/main/src/services/mlEnergyPredictor.ts): `src/services/mlEnergyPredictor.ts`
- [Charging optimizer](https://github.com/havish06/evroute/blob/main/src/services/multiStopChargingOptimizer.ts): `src/services/multiStopChargingOptimizer.ts`
- [OSM routing](https://github.com/havish06/evroute/blob/main/src/services/osmRoutingService.ts): `src/services/osmRoutingService.ts`
- [Range isochrones](https://github.com/havish06/evroute/blob/main/src/services/rangeIsochroneService.ts): `src/services/rangeIsochroneService.ts`
- [Engine simulator](https://github.com/havish06/evroute/blob/main/src/components/modes/EngineMode.tsx): `src/components/modes/EngineMode.tsx`

### Drive intelligence

- [Drive mode](https://github.com/havish06/evroute/blob/main/src/components/modes/DriveMode.tsx): `src/components/modes/DriveMode.tsx`
- [Live telemetry](https://github.com/havish06/evroute/blob/main/src/components/LiveTelemetryPanel.tsx): `src/components/LiveTelemetryPanel.tsx`
- [Model learning](https://github.com/havish06/evroute/blob/main/src/components/ModelLearningModal.tsx): `src/components/ModelLearningModal.tsx`
- [ML insights](https://github.com/havish06/evroute/blob/main/src/components/MLInsightsModal.tsx): `src/components/MLInsightsModal.tsx`
- [Telemetry learning](https://github.com/havish06/evroute/blob/main/src/services/telemetryLearningLoop.ts): `src/services/telemetryLearningLoop.ts`
- [Weather service](https://github.com/havish06/evroute/blob/main/src/services/weatherService.ts): `src/services/weatherService.ts`

### Route and vehicle data

- [Route presets](https://github.com/havish06/evroute/blob/main/src/data/sampleRoutes.ts): `src/data/sampleRoutes.ts`
- [Vehicle catalog](https://github.com/havish06/evroute/blob/main/src/data/vehicles.ts): `src/data/vehicles.ts`
- [OSM road geometries](https://github.com/havish06/evroute/blob/main/src/data/osmRoadGeometries.json): `src/data/osmRoadGeometries.json`

### Other components

- **Driver**
- **Weather provider**
- **OSRM service**

## Connections

- Driver → App coordinator: configures trip (evidence: `src/App.tsx`)
- App coordinator → Plan mode: shows mode (evidence: `src/App.tsx`)
- Plan mode → Trip setup: renders setup (evidence: `src/components/modes/PlanMode.tsx`)
- Plan mode → Route map: renders map (evidence: `src/components/modes/PlanMode.tsx`)
- Plan mode → Route options: renders options (evidence: `src/components/modes/PlanMode.tsx`)
- Plan mode → Route analysis: opens analysis (evidence: `src/components/modes/PlanMode.tsx`)
- Route analysis → Elevation profile: renders profile (evidence: `src/components/RouteAnalysisDrawer.tsx`)
- Plan mode → EV energy panel: shows energy (evidence: `src/components/modes/PlanMode.tsx`)
- Plan mode → Charging details: shows stations (evidence: `src/components/modes/PlanMode.tsx`)
- App coordinator → A* route engine: computes routes (evidence: `src/App.tsx`)
- A* route engine → Energy physics: estimates energy
- A* route engine → ML energy predictor: predicts consumption (evidence: `src/services/astarRouter.ts`)
- A* route engine → Charging optimizer: optimizes charging (evidence: `src/services/astarRouter.ts`)
- A* route engine → OSM routing: gets road geometry (evidence: `src/services/astarRouter.ts`)
- Route presets → OSM routing: reconciles edges (evidence: `src/data/sampleRoutes.ts`)
- OSM routing → OSM road geometries: reads geometry (evidence: `src/services/osmRoutingService.ts`)
- OSM routing → OSRM service: requests route data (evidence: `src/services/osmRoutingService.ts`)
- App coordinator → Route presets: selects preset (evidence: `src/App.tsx`)
- App coordinator → Vehicle catalog: selects vehicle (evidence: `src/App.tsx`)
- App coordinator → Weather service: refreshes weather (evidence: `src/App.tsx`)
- Weather service → Weather provider: fetches conditions
- App coordinator → Drive mode: switches mode (evidence: `src/App.tsx`)
- Drive mode → Route map: renders route (evidence: `src/components/modes/DriveMode.tsx`)
- App coordinator → Telemetry learning: records observation (evidence: `src/App.tsx`)
- ML energy predictor → Telemetry learning: uses calibration (evidence: `src/services/mlEnergyPredictor.ts`)
- Model learning → Telemetry learning: reads learning data (evidence: `src/components/ModelLearningModal.tsx`)
- Drive mode → Live telemetry: shows telemetry
- App coordinator → ML insights: opens insights (evidence: `src/App.tsx`)
- App coordinator → Engine simulator: shows engine mode (evidence: `src/App.tsx`)
- Engine simulator → A* route engine: inspects routing (evidence: `src/components/modes/EngineMode.tsx`)
- App coordinator → Range isochrones: opens range view (evidence: `src/App.tsx`)
