# iamtejasrg/bill-splitter architecture

> Architecture diagram of the GitHub repository iamtejasrg/bill-splitter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iamtejasrg/bill-splitter
- Repository: https://github.com/iamtejasrg/bill-splitter

## Overview

##### Project type and purpose
- From the file tree and README, this is a lightweight, front-end–only “Bill Splitter” web application.
- It consists of a single HTML entry point, a CSS stylesheet, and a JavaScript module that implements the core calculation logic.

##### File structure
- index.html – the host page; defines the UI layout (form fields for bill total, tip %, number of people)
- styles.css – presentation layer, controls the look-and-feel of the form and output
- index.js – client-side logic; listens for input events, computes split amounts, updates the DOM

##### README for additional insights
- The README simply titles the project “BILL-SPLITTER,” confirming its narrow scope: a UI + calculation tool.
- No back-end services, databases, or external APIs are mentioned.

##### Elements
- Browser
- UI Layer (index.html + styles.css)
- Logic Layer (index.js)
- From “User” → “UI Layer” (input events)
- From “UI Layer” → “Logic Layer” (event handling)
- From “Logic Layer” → “UI Layer” (DOM updates)
- e.g., blue rectangle for static assets, green for code logic, yellow for the browser runtime
– Annotations for the data flow (e.g., “calculateTip()”, “renderResults()”).

##### Putting it all together
[ User ]
↓
[ Browser Runtime ] ── contains ──→ { UI Layer (HTML/CSS) }
↓                                ↑
(events)                           (DOM update)
↓                                ←── { Logic Layer (index.js) }

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::user
    Browser["Browser Runtime"]:::browser

    subgraph "UI Layer"
        HTML["index.html"]:::ui
        CSS["styles.css"]:::ui
    end

    Logic["index.js"]:::logic
    README["README.md"]:::doc

    User -->|"interacts with"| Browser
    Browser -->|"hosts UI"| HTML
    Browser -->|"loads styles"| CSS
    HTML -->|"input events"| Logic
    Logic -->|"update DOM"| HTML

    click HTML "https://github.com/iamtejasrg/bill-splitter/blob/main/index.html"
    click CSS "https://github.com/iamtejasrg/bill-splitter/blob/main/styles.css"
    click Logic "https://github.com/iamtejasrg/bill-splitter/blob/main/index.js"
    click README "https://github.com/iamtejasrg/bill-splitter/blob/main/README.md"

    classDef user fill:#fff8dc,stroke:#333,stroke-width:1px
    classDef browser fill:#fff0b3,stroke:#333,stroke-width:1px
    classDef ui fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef logic fill:#d4edda,stroke:#333,stroke-width:1px
    classDef doc fill:#f8f9fa,stroke:#333,stroke-width:1px
```
