# truc350/quanlyktxnlu architecture

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

- Interactive diagram: https://gitdiagram.com/truc350/quanlyktxnlu
- Repository: https://github.com/truc350/quanlyktxnlu

## Overview

##### Main Components
- Application Entry Point: The Main.java in src/gop1 serves as the starting point of the application.
- Model Layer: Files such as Model.java, Student.java, and Room.java are responsible for data representation and business data logic.
- Controller Layer: Classes like Controller.java and StudentController.java encapsulate application logic and mediate between the model and view. They manage operations such as student registration and room management.
- View Layer: A variety of view components (e.g., AdminRoomManagerView.java, StudentView.java, PaymentDetailsView.java, and pages in src/view like PageLogin.java, PageChooseRoom.java) build the graphical interface and user interaction elements.
- Supporting Components: Other UI elements such as dialogs (ExitDialog.java) and specialized forms (PasswordView.java, UpdateInforView.java) help further refine user interactions and administrative functions.
- Resource Files: The src/img directory hints at assets used in the GUI, while configuration files (like .iml and .gitignore) help manage the project project environment (though not directly part of the runtime architecture).

##### Relationships and Interactions
- The Main.java launches the application and likely initializes the MVC components.
- The View components capture user input and then hand off events to the Controller layer.
- The Controller then interacts with the Model to fetch/update domain data (e.g., student and room info).
- After processing, the Controller updates the View, which then displays the updated interface.
- There is a clear separation between different UI flows – one set of classes for administrative functions (e.g., AdminRoomManagerView, DormitoryDetailsView) and another for student functionalities (e.g., StudentView, StudentApprovalView).

##### Architectural Patterns
- MVC (Model-View-Controller): The separation between the UI (View), application logic (Controller), and business data (Model) forms the backbone of this design.
- Single Responsibility: Classes are divided based on functionality (for example, distinct views for login, registration, and room management), ensuring each component primarily handles one concern.

##### Relevant Technologies
- Java (the language in which the application is built).
- Likely Java Swing or a similar GUI toolkit for the construction of views.
- The project structure (including IntelliJ project files like QLKTX.iml) suggests it is built and maintained within an IDE that supports Java projects.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Point
    subgraph "Entry Point"
        main["Main (Entry Point)"]:::entry
    end

    %% Controller Layer
    subgraph "Controller Layer"
        ctrl["Controller"]:::controller
        studCtrl["Student Controller"]:::controller
    end

    %% Model Layer
    subgraph "Model Layer"
        model["Model (Generic)"]:::model
        studData["Student Data"]:::model
        roomData["Room Data"]:::model
    end

    %% View Layer
    subgraph "View Layer"
        subgraph "Administrative Views"
            adminRoom["AdminRoomManagerView"]:::view
            dormDetails["DormitoryDetailsView"]:::view
            payment["PaymentDetailsView"]:::view
        end
        subgraph "Student & Registration Views"
            studentView["StudentView"]:::view
            studentApproval["StudentApprovalView"]:::view
            pageLogin["PageLogin"]:::view
            pageFill["PageFillInformatinDK"]:::view
            pageChoose["PageChooseRoom"]:::view
            home["Home"]:::view
            myMainPanel["MyMainPanel"]:::view
            myPanelHome["MyPanelHome"]:::view
            panelChoose["PanelChooseStudentOrManager"]:::view
            panelHeader["PanelHeaderOfHome"]:::view
            svLogin["SVLoginOrSignIn"]:::view
            gdsvDangKi["GDSVDangKi"]:::view
            hdsvDangKi["HĐSVDangKi"]:::view
            mdsvDangKi["MDSVDangKi"]:::view
            svDangKiTheHien["SVDangKiTheHien"]:::view
        end
        subgraph "Supporting Components"
            exitDialog["ExitDialog"]:::view
            passwordView["PasswordView"]:::view
            updateInfor["UpdateInforView"]:::view
            biography["BiographyView"]:::view
        end
        subgraph "Resources"
            assets["GUI Assets"]:::view
        end
    end

    %% Interactions from Entry Point
    main -->|"initiates"| ctrl
    main -->|"initiates"| studCtrl

    %% View to Controller interactions (User actions)
    adminRoom -->|"request"| ctrl
    dormDetails -->|"request"| ctrl
    payment -->|"request"| ctrl

    studentView -->|"request"| studCtrl
    studentApproval -->|"request"| studCtrl
    pageLogin -->|"request"| studCtrl
    pageFill -->|"request"| studCtrl
    pageChoose -->|"request"| studCtrl
    home -->|"request"| studCtrl
    myMainPanel -->|"request"| studCtrl
    myPanelHome -->|"request"| studCtrl
    panelChoose -->|"request"| studCtrl
    panelHeader -->|"request"| studCtrl
    svLogin -->|"request"| studCtrl
    gdsvDangKi -->|"request"| studCtrl
    hdsvDangKi -->|"request"| studCtrl
    mdsvDangKi -->|"request"| studCtrl
    svDangKiTheHien -->|"request"| studCtrl

    exitDialog -->|"request"| ctrl
    passwordView -->|"request"| ctrl
    updateInfor -->|"request"| ctrl
    biography -->|"request"| ctrl

    %% Controller to Model interactions
    ctrl -->|"process"| model
    ctrl -->|"process"| studData
    ctrl -->|"process"| roomData
    studCtrl -->|"process"| studData

    %% Model to Controller responses
    model -->|"response"| ctrl
    studData -->|"response"| studCtrl
    roomData -->|"response"| ctrl

    %% Controller to View updates
    ctrl -->|"update"| adminRoom
    ctrl -->|"update"| dormDetails
    ctrl -->|"update"| payment
    ctrl -->|"update"| exitDialog
    ctrl -->|"update"| passwordView
    ctrl -->|"update"| updateInfor
    ctrl -->|"update"| biography

    studCtrl -->|"update"| studentView
    studCtrl -->|"update"| studentApproval
    studCtrl -->|"update"| pageLogin
    studCtrl -->|"update"| pageFill
    studCtrl -->|"update"| pageChoose
    studCtrl -->|"update"| home
    studCtrl -->|"update"| myMainPanel
    studCtrl -->|"update"| myPanelHome
    studCtrl -->|"update"| panelChoose
    studCtrl -->|"update"| panelHeader
    studCtrl -->|"update"| svLogin
    studCtrl -->|"update"| gdsvDangKi
    studCtrl -->|"update"| hdsvDangKi
    studCtrl -->|"update"| mdsvDangKi
    studCtrl -->|"update"| svDangKiTheHien

    %% Class Definitions for Styling
    classDef entry fill:#FFA500,stroke:#000,stroke-width:2px;
    classDef controller fill:#FFFF99,stroke:#000,stroke-width:2px;
    classDef model fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef view fill:#ADD8E6,stroke:#000,stroke-width:2px;

    %% Click Events
    click main "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/Main.java"
    click model "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/Model.java"
    click studData "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/Student.java"
    click roomData "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/Room.java"
    click ctrl "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/Controller.java"
    click studCtrl "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/StudentController.java"
    click adminRoom "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/AdminRoomManagerView.java"
    click dormDetails "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/DormitoryDetailsView.java"
    click payment "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/PaymentDetailsView.java"
    click studentView "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/StudentView.java"
    click studentApproval "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/StudentApprovalView.java"
    click exitDialog "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/ExitDialog.java"
    click passwordView "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/PasswordView.java"
    click updateInfor "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/UpdateInforView.java"
    click biography "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/BiographyView.java"
    click gdsvDangKi "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/GDSVDangKi.java"
    click hdsvDangKi "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/HĐSVDangKi.java"
    click mdsvDangKi "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/MDSVDangKi.java"
    click svDangKiTheHien "https://github.com/truc350/quanlyktxnlu/blob/main/src/gop1/SVDangKiTheHien.java"
    click pageLogin "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/PageLogin.java"
    click pageFill "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/PageFillInformatinDK.java"
    click pageChoose "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/PageChooseRoom.java"
    click home "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/Home.java"
    click myMainPanel "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/MyMainPanel.java"
    click myPanelHome "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/MyPanelHome.java"
    click panelChoose "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/PanelChooseStudentOrManager.java"
    click panelHeader "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/PanelHeaderOfHome.java"
    click svLogin "https://github.com/truc350/quanlyktxnlu/blob/main/src/view/SVLoginOrSignIn.java"
    click assets "https://github.com/truc350/quanlyktxnlu/tree/main/src/img"
```
