# akshat-kumawat20/student-management-system architecture

> Architecture diagram of the GitHub repository akshat-kumawat20/student-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-03-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akshat-kumawat20/student-management-system
- Repository: https://github.com/akshat-kumawat20/student-management-system

## Overview

This is a **monolithic, server-rendered full-stack web application**:
- **Backend**: Spring Boot 3.x (Java 17), Spring MVC, Spring Data JPA, Spring Security
- **Frontend**: Thymeleaf templates rendered on the server + static CSS
- **Database**: MySQL
- **Domain**: Student Management (CRUD + search + pagination + CSV export + image upload + auth)

- Request flow: Browser → Spring MVC controllers → service/data access → MySQL
- Security boundaries: unauthenticated vs authenticated endpoints
- Server-side rendering: controllers returning Thymeleaf views
- Supporting features: file/image upload handling, CSV export response

##### File structure analysis (map folders/files to architectural blocks)
From the tree, the system decomposes into these concrete components:

##### Entry point / Application bootstrap
- `MyprojectApplication.java`
Spring Boot main application: component scanning + auto-configuration.

##### Web layer (MVC controllers)
- `HelloController.java` (likely a simple route)
- `controller/StudentController.java`
Owns HTTP endpoints for students (list/search/pagination, add/edit/delete, upload photo, CSV download).

##### Configuration layer
- `config/SecurityConfig.java`
Spring Security filter chain, login/logout, protected routes.
- `config/WebConfig.java`
MVC config (view resolvers, resource handlers, maybe upload path mappings).

##### Persistence layer (JPA)
- `entity/Student.java`
JPA entity mapping of student table/columns (and likely photo path/filename fields).
- `repository/StudentRepository.java`
Spring Data repository (CRUD + query methods for search/pagination).

##### Views & static assets (server-rendered UI)
- `resources/templates/*.html`
Thymeleaf views: `students.html`, `add-student.html`, `edit-student.html`, `login.html`.
- `resources/static/css/style.css`
Static styling served directly.

##### Runtime configuration
- `resources/application.properties`
DB URL/user/pass, JPA settings, multipart upload limits, etc.

##### Build/test tooling
- `pom.xml` + Maven wrapper
- `MyprojectApplicationTests.java`
- README mentions JaCoCo coverage (even if config isn’t visible in tree).

**Important architectural note**: There is no explicit `service` package in the tree. That strongly suggests the controller may call the repository directly (simple layered architecture: Controller → Repository), unless services are defined elsewhere not shown.

##### Spring Boot Web App (Monolith)
- Sub-labels: Spring MVC, Thymeleaf, Spring Security, Spring Data JPA
##### File Storage for uploaded photos
5. (Optional) **CSV Export** (not a separate system, but show as an output path: controller returns `text/csv` / attachment)

- Browser → Spring Boot: HTTP(S)
- Spring Boot → MySQL: JDBC / JPA
- Spring Boot → File storage: read/write uploaded images
- Spring Boot → Browser: HTML (Thymeleaf) + CSS/static resources + CSV download responses

**Web/MVC**
- `StudentController`
- `HelloController`

**Security**
- `SecurityConfig` (and conceptually: Security Filter Chain, Authentication Provider)
- Login page: `login.html`

**View layer**
- Thymeleaf templates: `students.html`, `add-student.html`, `edit-student.html`, `login.html`
- Static assets: `style.css`

**Persistence**
- `StudentRepository` (Spring Data JPA)
- `Student` entity

**Configuration**
- `WebConfig`
- `application.properties` (externalized config feeding DB + upload settings)

- Controllers → Thymeleaf templates (return view names + model)
- Controllers → Repository (CRUD/search/page)
- Repository → MySQL (via JPA/Hibernate)
- Controllers → File Storage (upload photo / resolve photo URL)
- Security Filter Chain intercepts Browser → Controllers (show as a gate in front of controller routes)

##### Architectural patterns / principles to call out
- **Monolith** with **layered MVC**: Controller (web) + Repository (data access) + Entity (domain/persistence model) + Views (Thymeleaf).
- **Server-side rendering**: Thymeleaf templates are first-class UI components, not a SPA.
- **Security as a cross-cutting concern**: Spring Security filter chain in front of endpoints.
- **Convention-over-configuration**: Spring Boot auto-config (DB, MVC, Security).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% =========================
    %% PAGE 1: Container / Context
    %% =========================
    subgraph "Container View (Deployment-Level)"
        direction TB

        U["User / Browser"]:::external

        subgraph "Spring Boot Student Management System (Monolith)"
            direction TB
            APP["Spring Boot Web App\n(Spring MVC + Thymeleaf + Security + Data JPA)"]:::app
        end

        DB[("MySQL Database")]:::db
        FS[("Upload Directory / Local Disk\n(Student Photos)\n(implementation-defined)")]:::filestore

        U -->|"HTTP(S):requests"| APP
        APP -->|"HTML(Thymeleaf)+CSS(static)"| U
        APP -->|"CSV:Content-Disposition:attachment"| U
        APP -->|"JPA/Hibernate(JDBC)"| DB
        APP -->|"read/write:multipartphotos"| FS
    end

    %% =========================
    %% PAGE 2: Component View (Inside Spring Boot)
    %% =========================
    subgraph "Component View (Inside Spring Boot Web App)"
        direction TB

        BOOT["MyprojectApplication\n(Spring Boot Bootstrap)"]:::app

        subgraph "Security Boundary (Cross-Cutting)"
            direction TB
            SEC["SecurityConfig\n(Security Filter Chain)"]:::security
            AUTH["Authentication\n(Login/Logout)"]:::security
            SEC -->|"builds"| AUTH
        end

        subgraph "Web / MVC Layer"
            direction TB
            HC["HelloController"]:::controller
            SC["StudentController\n(CRUD+Search+Pagination+Upload+CSV)\n(noexplicitservice-layer)"]:::controller
        end

        subgraph "View Layer (Server-Side Rendering)"
            direction TB
            TPL1["students.html"]:::template
            TPL2["add-student.html"]:::template
            TPL3["edit-student.html"]:::template
            TPL4["login.html"]:::template
            CSS["style.css"]:::static
        end

        subgraph "Persistence Layer (Spring Data JPA)"
            direction TB
            REPO["StudentRepository"]:::repo
            ENT["Student (JPA Entity)"]:::entity
        end

        subgraph "Configuration"
            direction TB
            WCFG["WebConfig\n(MVC+Resources+Multipart)"]:::config
            PROPS["application.properties\n(DB/JPA/Multipart/etc.)"]:::config
        end

        %% External dependencies (referenced from component view)
        DB2[("MySQL Database")]:::db
        FS2[("Upload Directory / Local Disk\n(Student Photos)")]:::filestore

        %% Security gate in front of controllers
        U2["Browser Requests"]:::external
        U2 -->|"HTTP(S)"| SEC
        SEC -->|"authorizesroutes"| HC
        SEC -->|"authorizesroutes"| SC

        %% MVC -> Views (dashed = renders/returns)
        HC -.->|"returnsview"| TPL1
        SC -.->|"renderslist/search/page"| TPL1
        SC -.->|"rendersform"| TPL2
        SC -.->|"rendersform"| TPL3
        SEC -.->|"servesloginpage"| TPL4
        TPL1 -.->|"uses"| CSS
        TPL2 -.->|"uses"| CSS
        TPL3 -.->|"uses"| CSS
        TPL4 -.->|"uses"| CSS

        %% Controllers -> Repository -> DB
        SC -->|"CRUD+query(Pageable/search)"| REPO
        REPO -->|"mapsviaJPA"| ENT
        REPO -->|"JDBC"| DB2

        %% Upload storage interactions
        SC -->|"multipartupload:writephoto"| FS2
        SC -->|"resolvephoto:read"| FS2

        %% CSV export (as response path)
        SC -->|"streamstext/csv"| U2

        %% Config relationships (dashed)
        WCFG -.->|"configuresmvc/resources"| HC
        WCFG -.->|"configuresmvc/resources"| SC
        PROPS -.->|"configures"| WCFG
        PROPS -.->|"configures"| REPO

        %% Bootstrap ties (informational)
        BOOT -.->|"component-scan/autoconfig"| SEC
        BOOT -.->|"component-scan/autoconfig"| HC
        BOOT -.->|"component-scan/autoconfig"| SC
        BOOT -.->|"autoconfigdata-jpa"| REPO
    end

    %% =========================
    %% Click events (from mapping)
    %% =========================
    click BOOT "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/java/com/example/myproject/MyprojectApplication.java"
    click HC "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/java/com/example/myproject/HelloController.java"
    click SC "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/java/com/example/myproject/controller/StudentController.java"
    click SEC "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/java/com/example/myproject/config/SecurityConfig.java"
    click WCFG "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/java/com/example/myproject/config/WebConfig.java"
    click ENT "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/java/com/example/myproject/entity/Student.java"
    click REPO "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/java/com/example/myproject/repository/StudentRepository.java"
    click TPL1 "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/resources/templates/students.html"
    click TPL2 "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/resources/templates/add-student.html"
    click TPL3 "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/resources/templates/edit-student.html"
    click TPL4 "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/resources/templates/login.html"
    click CSS "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/resources/static/css/style.css"
    click PROPS "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/main/resources/application.properties"

    %% Additional mapped project artifacts (shown as off-to-bottom nodes to keep vertical)
    subgraph "Build & Test Tooling"
        direction TB
        POM["pom.xml\n(Maven Build Config)"]:::tooling
        TESTS["MyprojectApplicationTests\n(Spring Boot Context Test)"]:::tooling
    end
    BOOT -.->|"builtby"| POM
    BOOT -.->|"verifiedby"| TESTS

    click POM "https://github.com/akshat-kumawat20/student-management-system/blob/main/pom.xml"
    click TESTS "https://github.com/akshat-kumawat20/student-management-system/blob/main/src/test/java/com/example/myproject/MyprojectApplicationTests.java"

    %% =========================
    %% Styles
    %% =========================
    classDef external fill:#ffffff,stroke:#6b7280,stroke-width:1.5,color:#111827
    classDef app fill:#dbeafe,stroke:#1d4ed8,stroke-width:2,color:#0f172a
    classDef controller fill:#bfdbfe,stroke:#1e40af,stroke-width:2,color:#0f172a
    classDef security fill:#fecaca,stroke:#b91c1c,stroke-width:2,color:#7f1d1d
    classDef repo fill:#c7d2fe,stroke:#4338ca,stroke-width:2,color:#0f172a
    classDef entity fill:#ddd6fe,stroke:#6d28d9,stroke-width:2,color:#0f172a
    classDef db fill:#bbf7d0,stroke:#15803d,stroke-width:2,color:#052e16
    classDef filestore fill:#fed7aa,stroke:#c2410c,stroke-width:2,color:#431407
    classDef template fill:#e5e7eb,stroke:#374151,stroke-width:1.5,color:#111827
    classDef static fill:#e5e7eb,stroke:#4b5563,stroke-width:1.5,color:#111827
    classDef config fill:#fef3c7,stroke:#b45309,stroke-width:2,color:#451a03
    classDef tooling fill:#f3f4f6,stroke:#6b7280,stroke-width:1.5,color:#111827
```
