# sri26mei10009-spec/vityarthi-project architecture

> Architecture diagram of the GitHub repository sri26mei10009-spec/vityarthi-project, 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/sri26mei10009-spec/vityarthi-project
- Repository: https://github.com/sri26mei10009-spec/vityarthi-project

## Overview

This is a small interactive electricity-bill calculator. The user selects a menu action, supplies consumption, and receives a total plus a per-slab cost breakdown; invalid input is reported and returns control to the menu loop. The main script owns the interactions and calls validation and calculation, while the calculator reads tariff constants. The graph reflects the documented CLI workflow and sampled source; no persistent storage or external service is present.

Main entry points: [`main.py`](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/main.py) (Application loop), [`program/calculator.py`](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/calculator.py) (Slab calculator), [`program/menu.py`](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/menu.py) (Menu prompt), [`program/validators.py`](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/validators.py) (Input validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["CLI application"]
  node_main["Application loop<br/>[main.py]"]
  node_menu["Menu prompt<br/>[menu.py]"]
  node_validator["Input validation<br/>[validators.py]"]
end

subgraph group_billing["Billing logic"]
  node_calculator["Slab calculator<br/>[calculator.py]"]
  node_constants["Tariff constants<br/>[constants.py]"]
end

node_user(("User"))

node_user -->|"chooses action"| node_menu
node_main -->|"calls"| node_menu
node_menu -->|"returns choice"| node_main
node_user -->|"enters units"| node_validator
node_main -->|"calls"| node_validator
node_validator -->|"returns units"| node_main
node_main -->|"calls"| node_calculator
node_calculator -->|"reads rates"| node_constants
node_calculator -->|"returns total and breakdown"| node_main
node_main -->|"displays bill or errors"| node_user

click node_main "https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/main.py"
click node_menu "https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/menu.py"
click node_validator "https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/validators.py"
click node_calculator "https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/calculator.py"
click node_constants "https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/constants.py"

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_main,node_menu,node_validator,node_user toneBlue
class node_calculator,node_constants toneAmber
```

## Components

### CLI application

- [Application loop](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/main.py): `main.py`
- [Menu prompt](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/menu.py): `program/menu.py`
- [Input validation](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/validators.py): `program/validators.py`

### Billing logic

- [Slab calculator](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/calculator.py): `program/calculator.py`
- [Tariff constants](https://github.com/sri26mei10009-spec/vityarthi-project/blob/main/program/constants.py): `program/constants.py`

### Other components

- **User**

## Connections

- User → Menu prompt: chooses action
- Application loop → Menu prompt: calls
- Menu prompt → Application loop: returns choice
- User → Input validation: enters units
- Application loop → Input validation: calls
- Input validation → Application loop: returns units
- Application loop → Slab calculator: calls
- Slab calculator → Tariff constants: reads rates
- Slab calculator → Application loop: returns total and breakdown
- Application loop → User: displays bill or errors
