# ahmadalmasalkhi/simple-interest-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadalmasalkhi/simple-interest-calculator
- Repository: https://github.com/ahmadalmasalkhi/simple-interest-calculator

## Overview

##### Project type and purpose
- This is a static, single-page web application (no backend or database).
- Purpose: calculate simple interest based on user inputs (principal, rate, time) in the browser.

##### File structure
- index.html: the UI shell and layout.
- script.js: core business logic (compute interest, DOM updates).

##### README for additional insights
- HTML5, CSS3, vanilla JavaScript (ES6), and Bootstrap for styling.
- No external services or data stores—everything runs client-side.

##### Main components
a. User (Browser)
b. UI Layer
­ ­• index.html (Form controls: input field, slider, dropdown, button)
­ ­• style.css (Styling, responsive layout)
c. Logic Layer
­ ­• script.js (“compute()” function, input validation, calculation)
d. Output Display Area (DOM element where results appear)

##### Relationships and data flow
- (You may also show CSS applying styles to the UI/Form and Output Display)

##### Architectural patterns or principles
- Single-page application (SPA) pattern, though no routing.
- Separation of concerns: HTML for structure, CSS for presentation, JS for behavior.
- Event-driven interaction: user triggers compute() via button click.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User
    User["User"]:::user

    %% Browser container
    subgraph "Browser (Client-Side)"
        direction TB
        subgraph "UI Layer"
            direction TB
            HTML["index.html"]:::ui
            CSS["style.css"]:::css
        end
        Script["script.js"]:::logic
        Output["Output Display"]:::output
    end

    %% Connections
    User -->|"enter input & click"| HTML
    HTML -->|"onCompute(values)"| Script
    Script -->|"render(interest, year)"| Output
    CSS -.->|"styles apply to"| HTML
    CSS -.->|"styles apply to"| Output

    %% Click Events
    click HTML "https://github.com/ahmadalmasalkhi/simple-interest-calculator/blob/main/index.html"
    click CSS "https://github.com/ahmadalmasalkhi/simple-interest-calculator/blob/main/style.css"
    click Script "https://github.com/ahmadalmasalkhi/simple-interest-calculator/blob/main/script.js"
    click Output "https://github.com/ahmadalmasalkhi/simple-interest-calculator/blob/main/index.html"

    %% Styles
    classDef user fill:#f39c12,stroke:#e67e22,color:#fff
    classDef ui fill:#3498db,stroke:#2471a3,color:#fff
    classDef css fill:#5dade2,stroke:#2e86c1,color:#fff,stroke-dasharray: 5 5
    classDef logic fill:#27ae60,stroke:#1e8449,color:#fff
    classDef output fill:#e67e22,stroke:#ca6f1e,color:#fff
```
