# dhanush-ns/sgpa-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/dhanush-ns/sgpa-calculator
- Repository: https://github.com/dhanush-ns/sgpa-calculator

## Overview

##### Main Components
- User Interface (UI): Represented by the index.html file. This is where the user interacts with the application by entering personal details and subject information.
- Calculation Logic: This is implemented in the grade_calculator.js file. It receives the input from the UI, validates it, performs the calculation, and then returns the results.
- Browser/Client: The web browser where the application is loaded (as indicated by instructions to open the developer tools for output viewing).

##### Relationships and Data Flow
- The User accesses the Application via a browser; the index.html is loaded into the browser.
- The index.html file loads the grade_calculator.js file, which contains the logic for input validation and calculation.
- User input flows from the UI components (HTML input fields) into grade_calculator.js.
- After processing, the calculation results (SGPA and total marks) are output directly in the browser (likely via the console or dynamically in the HTML content).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client-Side Environment"
        UI["index.html (UI)"]:::ui
        CE["grade_calculator.js (Calculation Engine)"]:::calculation
        Console["Developer Tools Console"]:::console
    end

    User("User"):::user

    User -->|"providesInput"| UI
    UI -->|"triggersCalculation"| CE
    CE -->|"returnsResult"| UI
    CE -->|"logsOutput"| Console

    click UI "https://github.com/dhanush-ns/sgpa-calculator/blob/main/index.html"
    click CE "https://github.com/dhanush-ns/sgpa-calculator/blob/main/grade_calculator.js"

    classDef user fill:#ffcc00,stroke:#333,stroke-width:2px
    classDef ui fill:#b3e5fc,stroke:#333,stroke-width:2px
    classDef calculation fill:#c8e6c9,stroke:#333,stroke-width:2px
    classDef console fill:#f8bbd0,stroke:#333,stroke-width:2px
```
