# charans1089-bit/ethanolfuelmixcalculator architecture

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

- Interactive diagram: https://gitdiagram.com/charans1089-bit/ethanolfuelmixcalculator
- Repository: https://github.com/charans1089-bit/ethanolfuelmixcalculator

## Overview

SCRK is a browser-based flex-fuel calculator and seasonal blend planner for the FA24 WRX. The main user workflow is to enter fuel and tank details, calculate an E85/93 blend, and save fill telemetry locally; the planner supports seasonal recommendations, calendar tracking, compliance, and achievements. The app also offers fuel/weather lookups, a synthesized sound experience, and data exports. Edges reflect README statements and shown source; the worker’s weather-provider details and some UI wiring were not sampled.

Main entry points: [`worker/fuel-worker.js`](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/worker/fuel-worker.js) (Fuel Proxy), [`app.js`](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/app.js) (Blend Engine), [`index.html`](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/index.html) (Calculator UI), [`blend-planner.html`](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/blend-planner.html) (Planner UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_calculator["Blend Calculator"]
  node_calculator_ui["Calculator UI<br/>[index.html]"]
  node_blend_engine["Blend Engine<br/>[app.js]"]
  node_telemetry["Fill Telemetry<br/>[app.js]"]
  node_local_state[("Browser Storage")]
end

subgraph group_planner["Seasonal Planner"]
  node_seasonal_ui["Planner UI<br/>[blend-planner.html]"]
  node_planner_logic["Planner Logic<br/>[blend-planner.js]"]
  node_planner_export["Planner Exports"]
end

subgraph group_integrations["External Data"]
  node_worker["Fuel Proxy<br/>[fuel-worker.js]"]
  node_weather_api["Weather API"]
  node_fuel_price_api["Fuel Price API"]
  node_nlr["NLR Stations"]
  node_overpass["Overpass Stations"]
end

subgraph group_extras["Additional Features"]
  node_sound_engine["Sound Engine<br/>[sound-engine.js]"]
end

node_driver(("Driver"))

node_driver -->|"enters fuel data"| node_calculator_ui
node_calculator_ui -->|"uses calculator"| node_blend_engine
node_blend_engine -->|"saves fills"| node_telemetry
node_blend_engine -->|"persists state"| node_local_state
node_driver -->|"opens planner"| node_seasonal_ui
node_seasonal_ui -->|"uses planner"| node_planner_logic
node_planner_logic -->|"stores planner data"| node_local_state
node_driver -.->|"exports data"| node_planner_export
node_blend_engine -->|"requests live data"| node_worker
node_worker -->|"fetches weather"| node_weather_api
node_worker -->|"fetches prices"| node_fuel_price_api
node_worker -->|"queries stations"| node_nlr
node_worker -->|"queries stations"| node_overpass
node_driver -.->|"plays synthesis"| node_sound_engine

click node_calculator_ui "https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/index.html"
click node_blend_engine "https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/app.js"
click node_telemetry "https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/app.js"
click node_seasonal_ui "https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/blend-planner.html"
click node_planner_logic "https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/blend-planner.js"
click node_planner_export "https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/blend-planner-export.js"
click node_worker "https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/worker/fuel-worker.js"
click node_sound_engine "https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/sound-engine.js"

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_calculator_ui,node_blend_engine,node_telemetry,node_local_state toneBlue
class node_seasonal_ui,node_planner_logic,node_planner_export toneAmber
class node_worker,node_weather_api,node_fuel_price_api,node_nlr,node_overpass toneMint
class node_sound_engine toneRose
class node_driver toneIndigo
```

## Components

### Blend Calculator

- [Calculator UI](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/index.html): `index.html`
- [Blend Engine](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/app.js): `app.js`
- [Fill Telemetry](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/app.js): `app.js`
- **Browser Storage**

### Seasonal Planner

- [Planner UI](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/blend-planner.html): `blend-planner.html`
- [Planner Logic](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/blend-planner.js): `blend-planner.js`
- [Planner Exports](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/blend-planner-export.js): `blend-planner-export.js`

### External Data

- [Fuel Proxy](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/worker/fuel-worker.js): `worker/fuel-worker.js`
- **Weather API**
- **Fuel Price API**
- **NLR Stations**
- **Overpass Stations**

### Additional Features

- [Sound Engine](https://github.com/charans1089-bit/ethanolfuelmixcalculator/blob/main/sound-engine.js): `sound-engine.js`

### Other components

- **Driver**

## Connections

- Driver → Calculator UI: enters fuel data (evidence: `README.md`)
- Calculator UI → Blend Engine: uses calculator (evidence: `README.md`)
- Blend Engine → Fill Telemetry: saves fills (evidence: `app.js`)
- Blend Engine → Browser Storage: persists state (evidence: `README.md`)
- Driver → Planner UI: opens planner (evidence: `README.md`)
- Planner UI → Planner Logic: uses planner (evidence: `blend-planner.js`)
- Planner Logic → Browser Storage: stores planner data (evidence: `blend-planner.js`)
- Driver → Planner Exports: exports data
- Blend Engine → Fuel Proxy: requests live data (evidence: `README.md`)
- Fuel Proxy → Weather API: fetches weather (evidence: `README.md`)
- Fuel Proxy → Fuel Price API: fetches prices (evidence: `README.md`)
- Fuel Proxy → NLR Stations: queries stations (evidence: `worker/fuel-worker.js`)
- Fuel Proxy → Overpass Stations: queries stations (evidence: `worker/fuel-worker.js`)
- Driver → Sound Engine: plays synthesis
