# ddjar/kindergarten_manager architecture

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

- Interactive diagram: https://gitdiagram.com/ddjar/kindergarten_manager
- Repository: https://github.com/ddjar/kindergarten_manager

## Overview

##### Main System Components

a) Presentation Layer (Frontend)
- JSP Views (organized by functionality)
- User Management (login.jsp, registration.jsp)
- Course Management (class.jsp, addClass.jsp)
- Payment System (TuitionPayment.jsp)
- Profile Management (profileParent.jsp, profileChild.jsp)
- Administrative Views (admin.jsp, dashboard.jsp)

b) Application Layer (Controllers)
- Create distinct controller groups:
- Authentication Controllers (controller.login)
- Course Management (controller.course)
- Payment Processing (controller.payment)
- Profile Management (controller.updateProfile)
- Administrative Functions (controller.list)
- File Management (controller.file)

c) Business Layer (Models)
- Core Domain Models:
- User Management (model.User)
- Class Management (model.Class)
- Payment Processing (model.tuition)
- Child Management (model.child)
- Announcement System (model.announcement)

d) Data Access Layer
- Database Connection (model.DBUnitil)
- Individual Data Access Objects (various *DB.java classes)

e) External Services
- VNPay Payment Integration (com.vnpay)
- Email Service (using javax.mail)

##### Interaction Flows

- User requests → Controllers → Models → Database
- Payment flows: Frontend → Payment Controller → VNPay Integration
- Authentication flows: Login → Filter → Protected Resources
- File upload paths: Frontend → File Controllers → Storage

##### Cross-Cutting Concerns

Aspects:
- Security Filters (controller.filter)
- Input Validation (validation package)
- Static Resources (css, js, lib folders)

##### Technical Stack Indicators

Technology badges for:
- Java EE
- JSP
- MSSQL (based on JDBC driver)
- Bootstrap
- jQuery
- VNPay Integration

##### Key Design Patterns

Implementation of:
- MVC Architecture
- DAO Pattern
- Filter Pattern
- Factory Pattern (where applicable)

##### Deployment Context

A section showing:
- Web Container (Servlet Container)
- Database Server
- Static File Storage
- External Service Connections

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef controller fill:#2ecc71,stroke:#27ae60,color:white
    classDef model fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#e74c3c,stroke:#c0392b,color:white
    classDef security fill:#9b59b6,stroke:#8e44ad,color:white
    classDef database fill:#34495e,stroke:#2c3e50,color:white
    classDef static fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Frontend Layer
    subgraph Frontend
        JSP["JSP Views"]
        Auth_Views["Authentication Views"]
        Course_Views["Course Views"]
        Payment_Views["Payment Views"]
        Profile_Views["Profile Views"]
        Admin_Views["Admin Views"]
        Static["Static Resources"]:::static
        
        JSP --> Auth_Views & Course_Views & Payment_Views & Profile_Views & Admin_Views
    end

    %% Controllers Layer
    subgraph Controllers
        Auth_Ctrl["Authentication Controllers"]:::controller
        Course_Ctrl["Course Controllers"]:::controller
        Payment_Ctrl["Payment Controllers"]:::controller
        Profile_Ctrl["Profile Controllers"]:::controller
        Admin_Ctrl["Admin Controllers"]:::controller
        File_Ctrl["File Controllers"]:::controller
    end

    %% Business Layer
    subgraph Models
        User["User Model"]:::model
        Class["Class Model"]:::model
        Payment["Payment Model"]:::model
        Child["Child Model"]:::model
        Announcement["Announcement Model"]:::model
    end

    %% External Services
    VNPay["VNPay Integration"]:::external
    Email["Email Service"]:::external

    %% Security
    Security["Security Filters"]:::security

    %% Database
    DB["Database"]:::database
    DAO["Data Access Objects"]:::database

    %% Relationships
    Auth_Views --> Auth_Ctrl
    Course_Views --> Course_Ctrl
    Payment_Views --> Payment_Ctrl
    Profile_Views --> Profile_Ctrl
    Admin_Views --> Admin_Ctrl

    Auth_Ctrl --> Security
    Security --> User
    Course_Ctrl --> Class
    Payment_Ctrl --> Payment
    Payment_Ctrl --> VNPay
    Profile_Ctrl --> User
    Admin_Ctrl --> User
    File_Ctrl --> Static

    User & Class & Payment & Child & Announcement --> DAO
    DAO --> DB

    Auth_Ctrl --> Email

    %% Click Events
    click Auth_Views "https://github.com/DDJar/Kindergarten_Manager/blob/master/web/login.jsp"
    click Course_Views "https://github.com/DDJar/Kindergarten_Manager/blob/master/web/class.jsp"
    click Payment_Views "https://github.com/DDJar/Kindergarten_Manager/blob/master/web/TuitionPayment.jsp"
    click Profile_Views "https://github.com/DDJar/Kindergarten_Manager/blob/master/web/profileParent.jsp"
    click Admin_Views "https://github.com/DDJar/Kindergarten_Manager/blob/master/web/admin.jsp"
    click Static "https://github.com/DDJar/Kindergarten_Manager/tree/master/web/css"
    click Auth_Ctrl "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/controller/login"
    click Course_Ctrl "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/controller/course"
    click Payment_Ctrl "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/controller/payment"
    click Profile_Ctrl "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/controller/updateProfile"
    click Admin_Ctrl "https://github.com/DDJar/Kindergarten_Manager/blob/master/src/java/controller/list/AdminList.java"
    click File_Ctrl "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/controller/file"
    click User "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/model/User"
    click Class "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/model/Class"
    click Payment "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/model/tuition"
    click Child "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/model/child"
    click Announcement "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/model/announcement"
    click Security "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/controller/filter"
    click DAO "https://github.com/DDJar/Kindergarten_Manager/blob/master/src/java/model/DBUnitil/DatabaseInfo.java"
    click VNPay "https://github.com/DDJar/Kindergarten_Manager/tree/master/src/java/com/vnpay"
```
