# abhilash-66/emi-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/abhilash-66/emi-calculator
- Repository: https://github.com/abhilash-66/emi-calculator

## Overview

##### Project type and purpose
- This is a single‐page static web application (EMI Calculator) built purely with HTML, CSS, and JavaScript.
- Purpose: Provide an interactive UI that takes user inputs (loan amount, interest rate, tenure) and instantly computes the Equated Monthly Installment.

##### File structure
- Top‐level files only:
- index.html – the UI shell
- styles.css – presentation layer
- script.js – business logic/EMI calculation
- README.md, LICENSE – documentation and license
- No backend services, no database, no external libraries or build scripts.

##### README for additional insights
- Confirms it’s a responsive, fast, and simple front‐end tool.
- No mention of server‐side or third‐party integrations.

##### Main components and their relationships
a. Components:
- User (browser) – initiates input and views output
- Presentation Layer (HTML + CSS) – renders form and results
- Business Logic Layer (JavaScript) – handles input validation and EMI formula
- Runtime Environment (Browser JS engine) – executes script

b. Interactions:
1. User enters loan parameters via HTML form.
2. Browser loads styles.css to style the form.
3. On form submission, script.js captures inputs, runs EMI calculation, and updates the DOM with results.
4. UI updates are immediately reflected in the browser without page reload.

c. Architectural patterns/design principles:
- Separation of concerns: HTML (structure), CSS (styles), JS (logic)
- Event-driven flow: UI events trigger business logic
- No persistent storage or external dependencies

d. Key technologies:
- HTML5 forms & semantic elements
- CSS3 media queries (responsive design)
- Vanilla JavaScript for calculation and DOM manipulation

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "User's Browser"
        U(["User"]):::user
        subgraph "Presentation Layer"
            HTML["HTML (index.html)"]:::ui
            CSS["CSS (styles.css)"]:::ui
        end
        BL["Business Logic (script.js)"]:::logic
        DU["DOM / UI Output"]:::ui

        U -->|"loan amount, rate, tenure"| HTML
        CSS -->|"styles applied"| HTML
        HTML -->|"input values"| BL
        BL -->|"EMI result"| DU
        DU -->|"render EMI result"| U
    end

    subgraph "Documentation"
        RD["README.md"]:::doc
        LIC["LICENSE"]:::doc
    end

    subgraph "Legend"
        L1["User: grey"]:::user
        L2["UI Components: blue"]:::ui
        L3["Logic Components: green"]:::logic
        L4["Documentation: khaki"]:::doc
    end

    click HTML "https://github.com/abhilash-66/emi-calculator/blob/main/index.html"
    click CSS "https://github.com/abhilash-66/emi-calculator/blob/main/styles.css"
    click BL "https://github.com/abhilash-66/emi-calculator/blob/main/script.js"
    click RD "https://github.com/abhilash-66/emi-calculator/blob/main/README.md"
    click LIC "https://github.com/abhilash-66/emi-calculator/tree/main/LICENSE"

    classDef user fill:#cccccc,stroke:#333,stroke-width:1px
    classDef ui fill:#add8e6,stroke:#333,stroke-width:1px
    classDef logic fill:#90ee90,stroke:#333,stroke-width:1px
    classDef doc fill:#f0e68c,stroke:#333,stroke-width:1px
```
