# rkr2025/ksebcalculator architecture

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

- Interactive diagram: https://gitdiagram.com/rkr2025/ksebcalculator
- Repository: https://github.com/rkr2025/ksebcalculator

## Overview

This repository is a browser-based collection of calculators, planners, and personal utilities. Its best-evidenced end-to-end workflow is the KSEB bill calculator: users enter meter and tariff details, the app calculates a bill, and it renders explanations, charts, insights, and wheeling results. Other HTML pages represent independent tools, but their internal wiring is not shown in the supplied evidence. The graph therefore keeps those capabilities visible without inventing connections; source excerpts establish the calculator’s main calls, while several subsystems are known only from the file tree and SOURCE INDEX.

Main entry points: [`js/main.js`](https://github.com/rkr2025/ksebcalculator/blob/main/js/main.js) (Form orchestration), [`js/render-results.js`](https://github.com/rkr2025/ksebcalculator/blob/main/js/render-results.js) (Results assembly), [`js/calculator.js`](https://github.com/rkr2025/ksebcalculator/blob/main/js/calculator.js) (Bill calculation), [`js/wheeling-calculator.js`](https://github.com/rkr2025/ksebcalculator/blob/main/js/wheeling-calculator.js) (Wheeling calculation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bill["KSEB bill calculator"]
  node_billpage["Bill calculator form<br/>[index.html]"]
  node_main["Form orchestration<br/>[main.js]"]
  node_readings["Reading inputs<br/>[reading-inputs.js]"]
  node_voice["Voice input<br/>[voice-input.js]"]
  node_tariffs["Tariff rates<br/>[tariff-rates.js]"]
  node_calculator["Bill calculation<br/>[calculator.js]"]
  node_wheelingui["Wheeling inputs<br/>[wheeling-ui.js]"]
  node_wheelingcalc["Wheeling calculation"]
  node_results["Results assembly<br/>[render-results.js]"]
  node_tables["Adjustment tables<br/>[render-tables.js]"]
  node_charts["Bill charts<br/>[render-chart.js]"]
  node_insights["Bill insights<br/>[render-insights.js]"]
  node_explanation["Bill explanations"]
  node_wheelingrender["Wheeling display<br/>[render-wheeling.js]"]
  node_printsummary["Print summary"]
  node_quotes["Daily quotes<br/>[quotes.js]"]
  node_quoteservice["Online quotes<br/>[quote-service.js]"]
  node_solar["Solar diary<br/>[solar-diary.html]"]
end

subgraph group_finance["Finance and utilities"]
  node_financepages["Money calculators<br/>[expense.html]"]
  node_utilitypages["Everyday calculators<br/>[date-diff.html]"]
  node_travelpages["Travel tools<br/>[travel.html]"]
end

subgraph group_planning["Planning and productivity"]
  node_planningpages["Planning tools<br/>[daily-planner.html]"]
  node_taskpages["Task boards<br/>[todo.html]"]
  node_calendarpages["Calendar tools"]
  node_habitpages["Goals and habits<br/>[habit.html]"]
end

subgraph group_personal["Personal tools"]
  node_studytools["Study tools<br/>[flashcards.html]"]
  node_healthtools["Health tools<br/>[medicine.html]"]
  node_timepages["Time utilities<br/>[stopwatch.html]"]
  node_diarypage["Life diary<br/>[life-diary.html]"]
  node_diaryapp["Diary app page<br/>[life-diary.html]"]
  node_diaryworker["Offline worker<br/>[sw.js]"]
  node_media["Document conversion<br/>[imagepdf.html]"]
end

node_user(("User"))
node_externalquotes{{"Quote API"}}

node_user -->|"enters readings"| node_billpage
node_billpage -.->|"loads app"| node_main
node_main -->|"calculates bill"| node_calculator
node_main -->|"renders results"| node_results
node_main -->|"gets fallback quote"| node_quotes
node_main -.->|"fetches quote"| node_quoteservice
node_quoteservice -->|"requests quote"| node_externalquotes
node_main -.->|"sets up readings"| node_readings
node_main -.->|"sets up voice input"| node_voice
node_main -.->|"sets up wheeling"| node_wheelingui
node_main -.->|"calculates wheeling"| node_wheelingcalc
node_calculator -->|"uses rates"| node_tariffs
node_wheelingcalc -->|"reuses billing math"| node_calculator
node_wheelingcalc -.->|"uses rates"| node_tariffs
node_results -->|"builds tables"| node_tables
node_results -->|"builds charts"| node_charts
node_results -->|"builds analysis"| node_insights
node_results -->|"builds wheeling display"| node_wheelingrender
node_results -->|"builds explanations"| node_explanation
node_results -->|"builds print summary"| node_printsummary
node_insights -->|"runs what-if bill"| node_calculator
node_solar -->|"hands off readings"| node_main
node_user -.->|"uses tools"| node_financepages
node_user -.->|"uses tools"| node_utilitypages
node_user -.->|"uses tools"| node_travelpages
node_user -.->|"uses tools"| node_planningpages
node_user -.->|"uses tools"| node_taskpages
node_user -.->|"uses tools"| node_calendarpages
node_user -.->|"uses tools"| node_habitpages
node_user -.->|"uses tools"| node_studytools
node_user -.->|"uses tools"| node_healthtools
node_user -.->|"uses tools"| node_timepages
node_user -.->|"opens diary"| node_diarypage
node_user -.->|"uses converter"| node_media
node_diarypage -.->|"opens app"| node_diaryapp
node_diaryapp -.->|"offline support"| node_diaryworker

click node_billpage "https://github.com/rkr2025/ksebcalculator/blob/main/index.html"
click node_main "https://github.com/rkr2025/ksebcalculator/blob/main/js/main.js"
click node_readings "https://github.com/rkr2025/ksebcalculator/blob/main/js/reading-inputs.js"
click node_voice "https://github.com/rkr2025/ksebcalculator/blob/main/js/voice-input.js"
click node_tariffs "https://github.com/rkr2025/ksebcalculator/blob/main/js/tariff-rates.js"
click node_calculator "https://github.com/rkr2025/ksebcalculator/blob/main/js/calculator.js"
click node_wheelingui "https://github.com/rkr2025/ksebcalculator/blob/main/js/wheeling-ui.js"
click node_wheelingcalc "https://github.com/rkr2025/ksebcalculator/blob/main/js/wheeling-calculator.js"
click node_results "https://github.com/rkr2025/ksebcalculator/blob/main/js/render-results.js"
click node_tables "https://github.com/rkr2025/ksebcalculator/blob/main/js/render-tables.js"
click node_charts "https://github.com/rkr2025/ksebcalculator/blob/main/js/render-chart.js"
click node_insights "https://github.com/rkr2025/ksebcalculator/blob/main/js/render-insights.js"
click node_explanation "https://github.com/rkr2025/ksebcalculator/blob/main/js/render-explanation.js"
click node_wheelingrender "https://github.com/rkr2025/ksebcalculator/blob/main/js/render-wheeling.js"
click node_printsummary "https://github.com/rkr2025/ksebcalculator/blob/main/js/render-print-summary.js"
click node_quotes "https://github.com/rkr2025/ksebcalculator/blob/main/js/quotes.js"
click node_quoteservice "https://github.com/rkr2025/ksebcalculator/blob/main/js/quote-service.js"
click node_solar "https://github.com/rkr2025/ksebcalculator/blob/main/solar-diary.html"
click node_financepages "https://github.com/rkr2025/ksebcalculator/blob/main/expense.html"
click node_utilitypages "https://github.com/rkr2025/ksebcalculator/blob/main/date-diff.html"
click node_travelpages "https://github.com/rkr2025/ksebcalculator/blob/main/travel.html"
click node_planningpages "https://github.com/rkr2025/ksebcalculator/blob/main/daily-planner.html"
click node_taskpages "https://github.com/rkr2025/ksebcalculator/blob/main/todo.html"
click node_calendarpages "https://github.com/rkr2025/ksebcalculator/blob/main/countdown-calendar.html"
click node_habitpages "https://github.com/rkr2025/ksebcalculator/blob/main/habit.html"
click node_studytools "https://github.com/rkr2025/ksebcalculator/blob/main/flashcards.html"
click node_healthtools "https://github.com/rkr2025/ksebcalculator/blob/main/medicine.html"
click node_timepages "https://github.com/rkr2025/ksebcalculator/blob/main/stopwatch.html"
click node_diarypage "https://github.com/rkr2025/ksebcalculator/blob/main/life-diary.html"
click node_diaryapp "https://github.com/rkr2025/ksebcalculator/blob/main/life-diary/life-diary.html"
click node_diaryworker "https://github.com/rkr2025/ksebcalculator/blob/main/life-diary/sw.js"
click node_media "https://github.com/rkr2025/ksebcalculator/blob/main/imagepdf.html"

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_billpage,node_main,node_readings,node_voice,node_tariffs,node_calculator,node_wheelingui,node_wheelingcalc,node_results,node_tables,node_charts,node_insights,node_explanation,node_wheelingrender,node_printsummary,node_quotes,node_quoteservice,node_solar,node_user toneBlue
class node_financepages,node_utilitypages,node_travelpages toneAmber
class node_planningpages,node_taskpages,node_calendarpages,node_habitpages,node_externalquotes toneMint
class node_studytools,node_healthtools,node_timepages,node_diarypage,node_diaryapp,node_diaryworker,node_media toneRose
```

## Components

### KSEB bill calculator

- [Bill calculator form](https://github.com/rkr2025/ksebcalculator/blob/main/index.html): `index.html`
- [Form orchestration](https://github.com/rkr2025/ksebcalculator/blob/main/js/main.js): `js/main.js`
- [Reading inputs](https://github.com/rkr2025/ksebcalculator/blob/main/js/reading-inputs.js): `js/reading-inputs.js`
- [Voice input](https://github.com/rkr2025/ksebcalculator/blob/main/js/voice-input.js): `js/voice-input.js`
- [Tariff rates](https://github.com/rkr2025/ksebcalculator/blob/main/js/tariff-rates.js): `js/tariff-rates.js`
- [Bill calculation](https://github.com/rkr2025/ksebcalculator/blob/main/js/calculator.js): `js/calculator.js`
- [Wheeling inputs](https://github.com/rkr2025/ksebcalculator/blob/main/js/wheeling-ui.js): `js/wheeling-ui.js`
- [Wheeling calculation](https://github.com/rkr2025/ksebcalculator/blob/main/js/wheeling-calculator.js): `js/wheeling-calculator.js`
- [Results assembly](https://github.com/rkr2025/ksebcalculator/blob/main/js/render-results.js): `js/render-results.js`
- [Adjustment tables](https://github.com/rkr2025/ksebcalculator/blob/main/js/render-tables.js): `js/render-tables.js`
- [Bill charts](https://github.com/rkr2025/ksebcalculator/blob/main/js/render-chart.js): `js/render-chart.js`
- [Bill insights](https://github.com/rkr2025/ksebcalculator/blob/main/js/render-insights.js): `js/render-insights.js`
- [Bill explanations](https://github.com/rkr2025/ksebcalculator/blob/main/js/render-explanation.js): `js/render-explanation.js`
- [Wheeling display](https://github.com/rkr2025/ksebcalculator/blob/main/js/render-wheeling.js): `js/render-wheeling.js`
- [Print summary](https://github.com/rkr2025/ksebcalculator/blob/main/js/render-print-summary.js): `js/render-print-summary.js`
- [Daily quotes](https://github.com/rkr2025/ksebcalculator/blob/main/js/quotes.js): `js/quotes.js`
- [Online quotes](https://github.com/rkr2025/ksebcalculator/blob/main/js/quote-service.js): `js/quote-service.js`
- [Solar diary](https://github.com/rkr2025/ksebcalculator/blob/main/solar-diary.html): `solar-diary.html`

### Finance and utilities

- [Money calculators](https://github.com/rkr2025/ksebcalculator/blob/main/expense.html): `expense.html`
- [Everyday calculators](https://github.com/rkr2025/ksebcalculator/blob/main/date-diff.html): `date-diff.html`
- [Travel tools](https://github.com/rkr2025/ksebcalculator/blob/main/travel.html): `travel.html`

### Planning and productivity

- [Planning tools](https://github.com/rkr2025/ksebcalculator/blob/main/daily-planner.html): `daily-planner.html`
- [Task boards](https://github.com/rkr2025/ksebcalculator/blob/main/todo.html): `todo.html`
- [Calendar tools](https://github.com/rkr2025/ksebcalculator/blob/main/countdown-calendar.html): `countdown-calendar.html`
- [Goals and habits](https://github.com/rkr2025/ksebcalculator/blob/main/habit.html): `habit.html`

### Personal tools

- [Study tools](https://github.com/rkr2025/ksebcalculator/blob/main/flashcards.html): `flashcards.html`
- [Health tools](https://github.com/rkr2025/ksebcalculator/blob/main/medicine.html): `medicine.html`
- [Time utilities](https://github.com/rkr2025/ksebcalculator/blob/main/stopwatch.html): `stopwatch.html`
- [Life diary](https://github.com/rkr2025/ksebcalculator/blob/main/life-diary.html): `life-diary.html`
- [Diary app page](https://github.com/rkr2025/ksebcalculator/blob/main/life-diary/life-diary.html): `life-diary/life-diary.html`
- [Offline worker](https://github.com/rkr2025/ksebcalculator/blob/main/life-diary/sw.js): `life-diary/sw.js`
- [Document conversion](https://github.com/rkr2025/ksebcalculator/blob/main/imagepdf.html): `imagepdf.html`

### Other components

- **User**
- **Quote API**

## Connections

- User → Bill calculator form: enters readings
- Bill calculator form → Form orchestration: loads app
- Form orchestration → Bill calculation: calculates bill (evidence: `js/main.js`)
- Form orchestration → Results assembly: renders results (evidence: `js/main.js`)
- Form orchestration → Daily quotes: gets fallback quote (evidence: `js/main.js`)
- Form orchestration → Online quotes: fetches quote (evidence: `js/main.js`)
- Online quotes → Quote API: requests quote (evidence: `js/quote-service.js`)
- Form orchestration → Reading inputs: sets up readings (evidence: `js/main.js`)
- Form orchestration → Voice input: sets up voice input (evidence: `js/main.js`)
- Form orchestration → Wheeling inputs: sets up wheeling (evidence: `js/main.js`)
- Form orchestration → Wheeling calculation: calculates wheeling (evidence: `js/main.js`)
- Bill calculation → Tariff rates: uses rates (evidence: `js/calculator.js`)
- Wheeling calculation → Bill calculation: reuses billing math (evidence: `js/wheeling-calculator.js`)
- Wheeling calculation → Tariff rates: uses rates (evidence: `js/wheeling-calculator.js`)
- Results assembly → Adjustment tables: builds tables (evidence: `js/render-results.js`)
- Results assembly → Bill charts: builds charts (evidence: `js/render-results.js`)
- Results assembly → Bill insights: builds analysis (evidence: `js/render-results.js`)
- Results assembly → Wheeling display: builds wheeling display (evidence: `js/render-results.js`)
- Results assembly → Bill explanations: builds explanations (evidence: `js/render-results.js`)
- Results assembly → Print summary: builds print summary (evidence: `js/render-results.js`)
- Bill insights → Bill calculation: runs what-if bill (evidence: `js/render-insights.js`)
- Solar diary → Form orchestration: hands off readings (evidence: `js/main.js`)
- User → Money calculators: uses tools
- User → Everyday calculators: uses tools
- User → Travel tools: uses tools
- User → Planning tools: uses tools
- User → Task boards: uses tools
- User → Calendar tools: uses tools
- User → Goals and habits: uses tools
- User → Study tools: uses tools
- User → Health tools: uses tools
- User → Time utilities: uses tools
- User → Life diary: opens diary
- User → Document conversion: uses converter
- Life diary → Diary app page: opens app
- Diary app page → Offline worker: offline support
