# pranjalshahi/mortgage-calculator architecture

> Architecture diagram of the GitHub repository pranjalshahi/mortgage-calculator, 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/pranjalshahi/mortgage-calculator
- Repository: https://github.com/pranjalshahi/mortgage-calculator

## Overview

##### Project type and purpose
- There is no backend or database directory—everything lives under `public` and `src`, so it’s a static front‐end application (SPA).

##### File structure
- Top‐level files:
- `.eslintrc.json` – linting rules for code quality
- `package.json` – project dependencies and scripts
- `README.md` – project description
- `public/` folder holds the static HTML (`index.html`) and any other assets served as‐is.
- `src/` folder holds the React app:
- `index.js` – entry point that bootstraps React into the DOM
- `App.js` – root React component containing UI and form logic
- `styles.css` – global CSS
- `utils/calcMortgage.js` – core mortgage calculation logic

##### README for additional insights
- The README is minimal and does not describe architecture. All architectural knowledge must come from the file structure and naming conventions.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Runtime Components
    Browser["Browser"]:::runtime
    subgraph "Host/CDN"
        direction TB
        StaticHost["Static Host/CDN"]:::runtime
    end

    %% Static Assets
    subgraph "public" 
        direction TB
        HTML["index.html"]:::static
        Assets["Static Assets"]:::static
    end

    %% Bundled Assets in Browser
    subgraph "Loaded in Browser"
        direction TB
        BundleJS["Bundle (JS)"]:::static
        StylesCSS["styles.css"]:::static
    end

    %% Source Code Structure
    subgraph "src" 
        direction TB
        IndexJS["index.js"]:::runtime
        AppJS["App.js"]:::runtime
        Utils["utils"]:::runtime
        CalcMort["calcMortgage.js"]:::runtime
    end

    %% Build & Tooling
    subgraph "Build & Config"
        direction TB
        Npm["package.json"]:::build
        ESLint[".eslintrc.json"]:::build
    end

    %% Documentation
    README["README.md"]:::doc

    %% Relationships
    Browser -->|"Request index.html & assets"| StaticHost
    StaticHost -->|"Serve index.html"| Browser
    StaticHost -->|"Serve JS & CSS bundle"| Browser

    Browser -->|"Loads index.html"| HTML
    Browser -->|"Loads bundle & CSS"| BundleJS
    Browser -->|"Loads bundle & CSS"| StylesCSS

    BundleJS -->|"Executes entry point"| IndexJS
    IndexJS -->|"Initializes React"| AppJS
    AppJS -->|"Imports styles"| StylesCSS
    AppJS -->|"Calls calculation"| CalcMort
    CalcMort -->|"Returns result"| AppJS

    Npm -->|"Builds bundle"| BundleJS
    ESLint -->|"Linting step"| IndexJS
    ESLint -->|"Linting step"| AppJS
    ESLint -->|"Linting step"| CalcMort

    README --- Npm

    %% Click Events
    click AppJS "https://github.com/pranjalshahi/mortgage-calculator/blob/main/src/App.js"
    click IndexJS "https://github.com/pranjalshahi/mortgage-calculator/blob/main/src/index.js"
    click CalcMort "https://github.com/pranjalshahi/mortgage-calculator/blob/main/src/utils/calcMortgage.js"
    click StylesCSS "https://github.com/pranjalshahi/mortgage-calculator/blob/main/src/styles.css"
    click HTML "https://github.com/pranjalshahi/mortgage-calculator/blob/main/public/index.html"
    click Assets "https://github.com/pranjalshahi/mortgage-calculator/tree/main/public/"
    click ESLint "https://github.com/pranjalshahi/mortgage-calculator/blob/main/.eslintrc.json"
    click Npm "https://github.com/pranjalshahi/mortgage-calculator/blob/main/package.json"
    click README "https://github.com/pranjalshahi/mortgage-calculator/blob/main/README.md"

    %% Styles
    classDef runtime fill:#cce5ff,stroke:#3399ff,stroke-width:2px
    classDef static fill:#d4edda,stroke:#28a745,stroke-width:2px
    classDef build fill:#fff3cd,stroke:#ffc107,stroke-width:2px
    classDef doc fill:#e2e3e5,stroke:#6c757d,stroke-width:2px
```
