# itzsaad09/office-and-class-allocation-system architecture

> Architecture diagram of the GitHub repository itzsaad09/office-and-class-allocation-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/itzsaad09/office-and-class-allocation-system
- Repository: https://github.com/itzsaad09/office-and-class-allocation-system

## Overview

##### Project Type and Purpose
- This is a monolithic, desktop‐based Java application (built with NetBeans/Ant) that manages office and class allocation (users, courses, classes, offices).
- The UI is constructed with Java Swing (.form + .java files), and persistence is handled via a local SQL database (project.sql).

##### High-Level Architecture Layers
a. Presentation Layer
- Java Swing forms (SignUp.form/.java, LogIn.form/.java, AdminPage.form/.java, etc.)
- Handles user input, navigation between screens, and displays results or error dialogs.
b. Business Logic Layer
- UI controllers contain the core validation and orchestration logic (e.g., SignUpSuccessful.java invokes Database.registerUser()).
- Central Database.java class encapsulates all JDBC calls (connect, CRUD operations).
c. Data Access Layer
- Database.java opens JDBC connections, prepares SQL statements, executes queries against the RDBMS.
- project.sql defines the schema (tables for users, classes, offices, registrations).
d. Database
- A relational database server (MySQL, PostgreSQL, or similar) running locally or on LAN.

##### Core Components and Their Interactions
- User Action → Swing UI Form → invokes Business Logic in the same class or helper → calls Database.java → executes SQL → returns results/errors → UI displays outcome.
- Build & Deployment → Ant (build.xml) compiles src/, bundles classes, and creates an executable JAR or runs from NetBeans.

##### Architectural Patterns & Principles
- Layered Pattern: clear separation between UI, business logic, and data access.
- Single-process, single-tier desktop application (no microservices or remote APIs).
- JDBC for database abstraction.

##### Detailed Elements
- Build artifact (JAR) output from Ant, and NetBeans metadata (nbproject/) as ancillary.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer (Blue)
    subgraph "Authentication Module" 
        AuthUI["Authentication Forms"]:::ui
    end
    subgraph "Administration Module"
        AdminUI["Administration Forms"]:::ui
    end
    subgraph "Instructor Module"
        InstrUI["Instructor Forms"]:::ui
    end
    subgraph "Student Module"
        StudUI["Student Forms"]:::ui
    end
    subgraph "Course/Class Module"
        CourseUI["Course/Class Forms"]:::ui
    end

    %% Business Logic & Data Access (Green/Orange)
    BL["Business Logic (Controllers & Validation)"]:::logic
    DA["Data Access (Database.java)"]:::data

    %% Database (Gray)
    DB["RDBMS Server\n(project.sql schema)"]:::db

    %% Build System (Purple)
    Build["Build System\n(Ant & NetBeans)"]:::build

    %% Relationships
    AuthUI -->|"user events"| BL
    AdminUI -->|"admin events"| BL
    InstrUI -->|"instructor events"| BL
    StudUI -->|"student events"| BL
    CourseUI -->|"course/class events"| BL

    BL -->|"calls JDBC methods"| DA
    DA -->|"executeQuery()/executeUpdate()"| DB

    Build -->|"compile & package"| BL
    Build -->|"metadata for IDE"| AuthUI

    %% Click Events
    click AuthUI "https://github.com/itzsaad09/office-and-class-allocation-system/tree/main/src/main/"
    click AdminUI "https://github.com/itzsaad09/office-and-class-allocation-system/tree/main/src/main/"
    click InstrUI "https://github.com/itzsaad09/office-and-class-allocation-system/tree/main/src/main/"
    click StudUI "https://github.com/itzsaad09/office-and-class-allocation-system/tree/main/src/main/"
    click CourseUI "https://github.com/itzsaad09/office-and-class-allocation-system/tree/main/src/main/"

    click DA "https://github.com/itzsaad09/office-and-class-allocation-system/blob/main/src/main/Database.java"
    click DB "https://github.com/itzsaad09/office-and-class-allocation-system/blob/main/project.sql"
    click Build "https://github.com/itzsaad09/office-and-class-allocation-system/blob/main/build.xml"
    click Build "https://github.com/itzsaad09/office-and-class-allocation-system/tree/main/nbproject/"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#036,stroke-width:1px
    classDef logic fill:#90EE90,stroke:#060,stroke-width:1px
    classDef data fill:#FFA500,stroke:#A60,stroke-width:1px
    classDef db fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef build fill:#D8BFD8,stroke:#708,stroke-width:1px
```
