# manish-code-7/vtu-cgpa-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/manish-code-7/vtu-cgpa-calculator
- Repository: https://github.com/manish-code-7/vtu-cgpa-calculator

## Overview

##### Project type and purpose
- This is a Spring Boot–based, full-stack web application that demonstrates software quality assurance (SQA) by providing two parallel implementations of a VTU CGPA calculator: one “good” (fully tested, robust, correct) and one “bad” (deliberate logical flaws, poor validation, minimal testing).
- The primary goal is educational: let users compare how SQA practices affect correctness, robustness, and maintainability.

##### File structure
- Top level
- Dockerfile, .dockerignore, pom.xml (build & container config)
- README.md (project overview)
- src/main/java/com/example/vtucgpa/
- VTUCgpaApplication.java (Spring Boot entry point)
- controller/ (HTTP routing for good vs. bad flows)
- service/ (business logic for each flow)
- model/ (request and response DTOs for each flow)
- src/main/resources/templates/
- index.html (landing page with links)
- good-cgpa.html, bad-cgpa.html (Thymeleaf templates for each flow)
- src/test/java/com/example/vtucgpa/
- GoodCGPAServiceTest.java (tests showcasing robust, correct behavior)
- BadCGPAServiceTest.java (tests failing or passing incorrectly to illustrate poor SQA)

##### README for additional insights
- Confirms MVC pattern with separate controllers, services, models, and templates
- Explains the two flows, how to run the app, and the learning outcomes

##### Putting it all together
Path A (Good): GoodCGPAController → GoodCGPAService → GoodCGPASemesterRequest/Result → Thymeleaf good-cgpa.html
Path B (Bad): BadCGPAController → BadCGPAService → BadCGPASemesterRequest/Result → Thymeleaf bad-cgpa.html

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "User & Browser"
        Browser["Web Browser"]:::frontend
        Index["index.html"]:::template
        click Index "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/resources/templates/index.html"
        Browser -->|"GET /"| Index
        Browser -->|"GET /good-cgpa"| GoodCTRL
        Browser -->|"GET /bad-cgpa"| BadCTRL
    end

    subgraph "Spring Boot Application"
        VTUApp["VTUCgpaApplication"]:::app
        click VTUApp "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/VTUCgpaApplication.java"

        GoodCTRL["GoodCGPAController"]:::controller
        click GoodCTRL "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/controller/GoodCGPAController.java"
        BadCTRL["BadCGPAController"]:::controller
        click BadCTRL "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/controller/BadCGPAController.java"

        GoodSvc["GoodCGPAService"]:::service
        click GoodSvc "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/service/GoodCGPAService.java"
        BadSvc["BadCGPAService"]:::service
        click BadSvc "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/service/BadCGPAService.java"

        ReqGood["GoodCGPASemesterRequest"]:::model
        click ReqGood "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/model/GoodCGPASemesterRequest.java"
        ResGood["GoodCGPASemesterResult"]:::model
        click ResGood "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/model/GoodCGPASemesterResult.java"

        ReqBad["BadCGPASemesterRequest"]:::model
        click ReqBad "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/model/BadCGPASemesterRequest.java"
        ResBad["BadCGPASemesterResult"]:::model
        click ResBad "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/java/com/example/vtucgpa/model/BadCGPASemesterResult.java"

        GoodTpl["good-cgpa.html"]:::template
        click GoodTpl "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/resources/templates/good-cgpa.html"
        BadTpl["bad-cgpa.html"]:::template
        click BadTpl "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/main/resources/templates/bad-cgpa.html"

        VTUApp --> GoodCTRL
        VTUApp --> BadCTRL

        GoodCTRL --> ReqGood
        GoodCTRL --> GoodSvc
        GoodSvc --> ReqGood
        GoodSvc --> ResGood
        GoodCTRL --> GoodTpl

        BadCTRL --> ReqBad
        BadCTRL --> BadSvc
        BadSvc --> ReqBad
        BadSvc --> ResBad
        BadCTRL --> BadTpl
    end

    subgraph "Build & Deployment"
        Maven["Maven (pom.xml)"]:::tool
        click Maven "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/pom.xml"
        Docker["Dockerfile"]:::tool
        click Docker "https://github.com/manish-code-7/vtu-cgpa-calculator/tree/main/Dockerfile"
        Container["Docker Container"]:::tool

        Maven -->|"compile/test/package"| Docker
        Docker -->|"build image"| Container
    end

    subgraph "Test Suite"
        GoodTest["GoodCGPAServiceTest"]:::test
        click GoodTest "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/test/java/com/example/vtucgpa/GoodCGPAServiceTest.java"
        BadTest["BadCGPAServiceTest"]:::test
        click BadTest "https://github.com/manish-code-7/vtu-cgpa-calculator/blob/main/src/test/java/com/example/vtucgpa/BadCGPAServiceTest.java"

        GoodTest --> GoodSvc
        BadTest --> BadSvc
    end

    classDef frontend    fill:#E0F7FA,stroke:#006064,color:#006064;
    classDef controller  fill:#BBDEFB,stroke:#0D47A1,color:#0D47A1;
    classDef service     fill:#C8E6C9,stroke:#1B5E20,color:#1B5E20;
    classDef model       fill:#FFF9C4,stroke:#F57F17,color:#F57F17;
    classDef template    fill:#FFE0B2,stroke:#E65100,color:#E65100;
    classDef app         fill:#CFD8DC,stroke:#37474F,color:#37474F;
    classDef tool        fill:#EEEEEE,stroke:#424242,color:#424242;
    classDef test        fill:#F8BBD0,stroke:#880E4F,color:#880E4F;
```
