# hjain5164/student_management_system architecture

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

- Interactive diagram: https://gitdiagram.com/hjain5164/student_management_system
- Repository: https://github.com/hjain5164/student_management_system

## Overview

##### Main Components
- User Interfaces – There are three modules (Admin/Owner, Faculty, and Student) which are handled by separate JSP pages (e.g., admin_home.jsp, student_home.jsp, faculty_home.jsp, etc.) under both the “build/web” and “web” directories. These pages are what the end users interact with.
- Backend Controllers/Servlets – The Java source files in the “src/java” directory (like login.java, register_course.java, enrollStudent.java, update_attendance.java, and so on) implement the application’s business logic and handle requests sent from the UI.
- Database – The application relies on a MySQL database. Although the actual database schema is not displayed here, the README instructs that the databases should be created as provided in some files, implying database-related scripts or configurations are available externally.
- Build & Deployment – The build process using Ant is indicated by files such as build.xml, and the final deployment artifact is the WAR file found in “dist/Student_Management_System.war”. There is also configuration for the GlassFish server indicated (e.g., glassfish-web.xml).
- External Libraries – Libraries such as “commons-fileupload”, “commons-io”, and the MySQL Connector (com.mysql.jdbc.jar) found in the “WEB-INF/lib” directory, indicate additional functionality such as file uploads, I/O utilities, and database connectivity.

- The external libraries act as parts of the backend system—handle file uploads, input/output management, and database connectivity. You might annotate or group these as “External Dependencies.”

##### Important Architectural Patterns
- MVC (Model-View-Controller) Pattern – The separation is evident between the JSP pages (View), Java classes (Controller/Model handling logic and data), and the underlying database (Model).
- Build and Deployment Infrastructure – The Ant build scripts and folder structure underline a standardized way of building, testing, and deploying the project.
- Modular design with three distinct modules representing different user roles.

##### Technologies and Frameworks
- Web Technology: JSP, Servlets, HTML, CSS, JavaScript
- Backend: Java (located under “src/java”) with MVC implementations
- Database: MySQL
- Build Tools: Ant (build.xml and nbproject files)
- Server: GlassFish (as per glassfish-web.xml)
- External Libraries: Apache Commons FileUpload, Commons IO, MySQL Connector

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    A["Web Browser"]:::client

    subgraph "Presentation Layer"
        adminJSP["Admin Module (JSPs)"]:::admin
        facultyJSP["Faculty Module (JSPs)"]:::faculty
        studentJSP["Student Module (JSPs)"]:::student
    end

    A -->|"HTTP_Request"| adminJSP
    A -->|"HTTP_Request"| facultyJSP
    A -->|"HTTP_Request"| studentJSP

    %% Server Layer with Controllers
    subgraph "Server Layer (GlassFish)"
        servletsContainer["Servlet Container (GlassFish)"]:::backend
        subgraph "Controllers"
            login["Login.java"]:::backend
            registerCourse["Register Course.java"]:::backend
            enrollStudent["EnrollStudent.java"]:::backend
            updateAttendance["Update Attendance.java"]:::backend
        end
        servletsContainer --> login
        servletsContainer --> registerCourse
        servletsContainer --> enrollStudent
        servletsContainer --> updateAttendance
    end

    adminJSP -->|"Submit_Request"| servletsContainer
    facultyJSP -->|"Submit_Request"| servletsContainer
    studentJSP -->|"Submit_Request"| servletsContainer

    %% Data Layer
    database["MySQL Database"]:::db
    login -->|"DB_Query"| database
    registerCourse -->|"DB_Query"| database
    enrollStudent -->|"DB_Query"| database
    updateAttendance -->|"DB_Query"| database

    %% External Dependencies
    extLib["External Libraries"]:::backend
    extLib ---|"Provides"| servletsContainer

    %% Build and Deployment Infrastructure
    subgraph "Build & Deployment"
        antBuild["Ant Build (build.xml & nbproject)"]:::backend
        warArtifact["Deployment Artifact (WAR)"]:::backend
        glassFishConfig["GlassFish Configuration"]:::backend
    end

    antBuild -->|"Build_Process"| warArtifact
    antBuild -->|"Reads_Config"| glassFishConfig
    warArtifact -->|"Deploys_to"| servletsContainer

    %% Click Events for User Interfaces
    click adminJSP "https://github.com/hjain5164/student_management_system/blob/master/build/web/admin_home.jsp"
    click facultyJSP "https://github.com/hjain5164/student_management_system/blob/master/build/web/faculty_home.jsp"
    click studentJSP "https://github.com/hjain5164/student_management_system/blob/master/build/web/student_home.jsp"

    %% Click Events for Controllers
    click login "https://github.com/hjain5164/student_management_system/blob/master/src/java/login.java"
    click registerCourse "https://github.com/hjain5164/student_management_system/blob/master/src/java/register_course.java"
    click enrollStudent "https://github.com/hjain5164/student_management_system/blob/master/src/java/enrollStudent.java"
    click updateAttendance "https://github.com/hjain5164/student_management_system/blob/master/src/java/update_attendance.java"

    %% Click Events for Build & Deployment
    click antBuild "https://github.com/hjain5164/student_management_system/blob/master/build.xml"
    click warArtifact "https://github.com/hjain5164/student_management_system/blob/master/dist/Student_Management_System.war"
    click glassFishConfig "https://github.com/hjain5164/student_management_system/blob/master/build/web/WEB-INF/glassfish-web.xml"

    %% Click Event for External Libraries
    click extLib "https://github.com/hjain5164/student_management_system/tree/master/build/web/WEB-INF/lib"

    %% Styles
    classDef client fill:#fef9c3,stroke:#f39c12,stroke-width:2px;
    classDef admin fill:#cce5ff,stroke:#007bff,stroke-width:2px;
    classDef faculty fill:#d4edda,stroke:#28a745,stroke-width:2px;
    classDef student fill:#ffe5b4,stroke:#fd7e14,stroke-width:2px;
    classDef backend fill:#f8d7da,stroke:#dc3545,stroke-width:2px;
    classDef db fill:#d1ecf1,stroke:#17a2b8,stroke-width:2px;
```
