# wanchanch/excuse architecture

> Architecture diagram of the GitHub repository wanchanch/excuse, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wanchanch/excuse
- Repository: https://github.com/wanchanch/excuse

## Overview

This is a Java/JSP school excuse-management web application. Students and teachers register or log in, then submit, view, search, and update excuse requests; teachers and administrators can review requests, while administrators also manage user records. Servlets handle role-aware requests, DAOs perform JDBC operations, and model classes carry user and excuse data. The excerpts show several controller-to-DAO calls and database connection setup; other servlet and JSP relationships are based only on the source index and tree, so uncertain links are omitted or dashed.

Main entry points: [`src/com/dao/ExcuseDao.java`](https://github.com/wanchanch/excuse/blob/master/src/com/dao/ExcuseDao.java) (Excuse DAO), [`src/com/controller/LoginServlet.java`](https://github.com/wanchanch/excuse/blob/master/src/com/controller/LoginServlet.java) (Role login), [`src/com/dao/UserDao.java`](https://github.com/wanchanch/excuse/blob/master/src/com/dao/UserDao.java) (User DAO), [`src/com/controller/ListExcuse.java`](https://github.com/wanchanch/excuse/blob/master/src/com/controller/ListExcuse.java) (Student excuse list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and profiles"]
  node_login["Role login<br/>[LoginServlet.java]"]
  node_registration["Registration"]
  node_profile["Personal profile"]
  node_profileview["Profile view"]
end

subgraph group_excuses["Excuse workflow"]
  node_excusecreate["Submit excuse<br/>[InsertServlet.java]"]
  node_studentlist["Student excuse list<br/>[ListExcuse.java]"]
  node_teacherlist["Teacher excuse list"]
  node_adminlist["Admin excuse list"]
  node_search["Excuse search"]
  node_update["Update excuse<br/>[ModifyServlet.java]"]
  node_approval["Review decision<br/>[CheckServlet.java]"]
  node_excuseviews["Excuse pages"]
end

subgraph group_people["User administration"]
  node_useradmin["User administration"]
  node_usersearch["User search"]
  node_userpages["User pages"]
end

subgraph group_data["Data access"]
  node_excusedao["Excuse DAO<br/>[ExcuseDao.java]"]
  node_userdao["User DAO<br/>[UserDao.java]"]
  node_excusemodel["Excuse model<br/>[Excuse.java]"]
  node_usermodel["User model<br/>[User.java]"]
  node_connections["JDBC connection<br/>[Utils.java]"]
end

node_student(("Student"))
node_teacher(("Teacher"))
node_admin(("Administrator"))
node_db[("MySQL database")]

node_student -->|"signs in"| node_login
node_teacher -->|"signs in"| node_login
node_admin -->|"signs in"| node_login
node_student -.->|"registers"| node_registration
node_teacher -.->|"registers"| node_registration
node_login -->|"checks credentials"| node_userdao
node_login -->|"forwards"| node_studentlist
node_login -.->|"forwards"| node_teacherlist
node_login -.->|"forwards"| node_adminlist
node_registration -->|"creates account"| node_userdao
node_registration -->|"forwards"| node_login
node_student -.->|"submits request"| node_excusecreate
node_excusecreate -.->|"inserts request"| node_excusedao
node_studentlist -->|"loads requests"| node_excusedao
node_studentlist -->|"forwards"| node_excuseviews
node_teacherlist -.->|"loads requests"| node_excusedao
node_adminlist -.->|"loads requests"| node_excusedao
node_search -->|"searches requests"| node_excusedao
node_search -->|"forwards"| node_studentlist
node_search -->|"forwards"| node_teacherlist
node_search -->|"forwards"| node_adminlist
node_student -.->|"edits request"| node_update
node_update -->|"updates request"| node_excusedao
node_update -->|"forwards"| node_studentlist
node_teacher -.->|"reviews request"| node_approval
node_approval -->|"sets decision"| node_excusedao
node_admin -.->|"manages users"| node_useradmin
node_useradmin -.->|"manages accounts"| node_userdao
node_usersearch -.->|"searches users"| node_userdao
node_usersearch -.->|"forwards"| node_userpages
node_student -.->|"opens profile"| node_profile
node_teacher -.->|"opens profile"| node_profile
node_profile -->|"loads profile"| node_userdao
node_profile -->|"forwards"| node_profileview
node_excusedao -->|"maps records"| node_excusemodel
node_userdao -->|"maps records"| node_usermodel
node_excusedao -->|"opens connection"| node_connections
node_userdao -->|"opens connection"| node_connections
node_connections -->|"connects"| node_db
node_excusedao -.->|"queries and writes"| node_db
node_userdao -.->|"queries and writes"| node_db

click node_login "https://github.com/wanchanch/excuse/blob/master/src/com/controller/LoginServlet.java"
click node_registration "https://github.com/wanchanch/excuse/blob/master/src/com/controller/RegisterServlet.java"
click node_profile "https://github.com/wanchanch/excuse/blob/master/src/com/controller/PersonalServlet.java"
click node_profileview "https://github.com/wanchanch/excuse/blob/master/web/PersonalStudent.jsp"
click node_excusecreate "https://github.com/wanchanch/excuse/blob/master/src/com/controller/InsertServlet.java"
click node_studentlist "https://github.com/wanchanch/excuse/blob/master/src/com/controller/ListExcuse.java"
click node_teacherlist "https://github.com/wanchanch/excuse/blob/master/src/com/controller/TeacherListServlet.java"
click node_adminlist "https://github.com/wanchanch/excuse/blob/master/src/com/controller/AdminListServlet.java"
click node_search "https://github.com/wanchanch/excuse/blob/master/src/com/controller/SelectExcuseByCondition.java"
click node_update "https://github.com/wanchanch/excuse/blob/master/src/com/controller/ModifyServlet.java"
click node_approval "https://github.com/wanchanch/excuse/blob/master/src/com/controller/CheckServlet.java"
click node_excuseviews "https://github.com/wanchanch/excuse/tree/master/web"
click node_useradmin "https://github.com/wanchanch/excuse/tree/master/src/com/controller"
click node_usersearch "https://github.com/wanchanch/excuse/blob/master/src/com/controller/SelectStudentByCondition.java"
click node_userpages "https://github.com/wanchanch/excuse/tree/master/web"
click node_excusedao "https://github.com/wanchanch/excuse/blob/master/src/com/dao/ExcuseDao.java"
click node_userdao "https://github.com/wanchanch/excuse/blob/master/src/com/dao/UserDao.java"
click node_excusemodel "https://github.com/wanchanch/excuse/blob/master/src/com/model/Excuse.java"
click node_usermodel "https://github.com/wanchanch/excuse/blob/master/src/com/model/User.java"
click node_connections "https://github.com/wanchanch/excuse/blob/master/src/com/utils/Utils.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_login,node_registration,node_profile,node_profileview toneBlue
class node_excusecreate,node_studentlist,node_teacherlist,node_adminlist,node_search,node_update,node_approval,node_excuseviews,node_db toneAmber
class node_useradmin,node_usersearch,node_userpages toneMint
class node_excusedao,node_userdao,node_excusemodel,node_usermodel,node_connections toneRose
class node_student,node_teacher,node_admin toneIndigo
```

## Components

### Access and profiles

- [Role login](https://github.com/wanchanch/excuse/blob/master/src/com/controller/LoginServlet.java): `src/com/controller/LoginServlet.java`
- [Registration](https://github.com/wanchanch/excuse/blob/master/src/com/controller/RegisterServlet.java): `src/com/controller/RegisterServlet.java`
- [Personal profile](https://github.com/wanchanch/excuse/blob/master/src/com/controller/PersonalServlet.java): `src/com/controller/PersonalServlet.java`
- [Profile view](https://github.com/wanchanch/excuse/blob/master/web/PersonalStudent.jsp): `web/PersonalStudent.jsp`

### Excuse workflow

- [Submit excuse](https://github.com/wanchanch/excuse/blob/master/src/com/controller/InsertServlet.java): `src/com/controller/InsertServlet.java`
- [Student excuse list](https://github.com/wanchanch/excuse/blob/master/src/com/controller/ListExcuse.java): `src/com/controller/ListExcuse.java`
- [Teacher excuse list](https://github.com/wanchanch/excuse/blob/master/src/com/controller/TeacherListServlet.java): `src/com/controller/TeacherListServlet.java`
- [Admin excuse list](https://github.com/wanchanch/excuse/blob/master/src/com/controller/AdminListServlet.java): `src/com/controller/AdminListServlet.java`
- [Excuse search](https://github.com/wanchanch/excuse/blob/master/src/com/controller/SelectExcuseByCondition.java): `src/com/controller/SelectExcuseByCondition.java`
- [Update excuse](https://github.com/wanchanch/excuse/blob/master/src/com/controller/ModifyServlet.java): `src/com/controller/ModifyServlet.java`
- [Review decision](https://github.com/wanchanch/excuse/blob/master/src/com/controller/CheckServlet.java): `src/com/controller/CheckServlet.java`
- [Excuse pages](https://github.com/wanchanch/excuse/tree/master/web): `web`

### User administration

- [User administration](https://github.com/wanchanch/excuse/tree/master/src/com/controller): `src/com/controller`
- [User search](https://github.com/wanchanch/excuse/blob/master/src/com/controller/SelectStudentByCondition.java): `src/com/controller/SelectStudentByCondition.java`
- [User pages](https://github.com/wanchanch/excuse/tree/master/web): `web`

### Data access

- [Excuse DAO](https://github.com/wanchanch/excuse/blob/master/src/com/dao/ExcuseDao.java): `src/com/dao/ExcuseDao.java`
- [User DAO](https://github.com/wanchanch/excuse/blob/master/src/com/dao/UserDao.java): `src/com/dao/UserDao.java`
- [Excuse model](https://github.com/wanchanch/excuse/blob/master/src/com/model/Excuse.java): `src/com/model/Excuse.java`
- [User model](https://github.com/wanchanch/excuse/blob/master/src/com/model/User.java): `src/com/model/User.java`
- [JDBC connection](https://github.com/wanchanch/excuse/blob/master/src/com/utils/Utils.java): `src/com/utils/Utils.java`

### Other components

- **Student**
- **Teacher**
- **Administrator**
- **MySQL database**

## Connections

- Student → Role login: signs in (evidence: `src/com/controller/LoginServlet.java`)
- Teacher → Role login: signs in (evidence: `src/com/controller/LoginServlet.java`)
- Administrator → Role login: signs in (evidence: `src/com/controller/LoginServlet.java`)
- Student → Registration: registers
- Teacher → Registration: registers
- Role login → User DAO: checks credentials (evidence: `src/com/controller/LoginServlet.java`)
- Role login → Student excuse list: forwards (evidence: `src/com/controller/LoginServlet.java`)
- Role login → Teacher excuse list: forwards
- Role login → Admin excuse list: forwards
- Registration → User DAO: creates account (evidence: `src/com/controller/RegisterServlet.java`)
- Registration → Role login: forwards (evidence: `src/com/controller/RegisterServlet.java`)
- Student → Submit excuse: submits request
- Submit excuse → Excuse DAO: inserts request (evidence: `src/com/controller/InsertServlet.java`)
- Student excuse list → Excuse DAO: loads requests (evidence: `src/com/controller/ListExcuse.java`)
- Student excuse list → Excuse pages: forwards (evidence: `src/com/controller/ListExcuse.java`)
- Teacher excuse list → Excuse DAO: loads requests (evidence: `src/com/controller/TeacherListServlet.java`)
- Admin excuse list → Excuse DAO: loads requests (evidence: `src/com/controller/AdminListServlet.java`)
- Excuse search → Excuse DAO: searches requests (evidence: `src/com/controller/SelectExcuseByCondition.java`)
- Excuse search → Student excuse list: forwards (evidence: `src/com/controller/SelectExcuseByCondition.java`)
- Excuse search → Teacher excuse list: forwards (evidence: `src/com/controller/SelectExcuseByCondition.java`)
- Excuse search → Admin excuse list: forwards (evidence: `src/com/controller/SelectExcuseByCondition.java`)
- Student → Update excuse: edits request
- Update excuse → Excuse DAO: updates request (evidence: `src/com/controller/ModifyServlet.java`)
- Update excuse → Student excuse list: forwards (evidence: `src/com/controller/ModifyServlet.java`)
- Teacher → Review decision: reviews request
- Review decision → Excuse DAO: sets decision (evidence: `src/com/controller/CheckServlet.java`)
- Administrator → User administration: manages users
- User administration → User DAO: manages accounts (evidence: `src/com/controller/LoginServlet.java`)
- User search → User DAO: searches users (evidence: `src/com/controller/SelectStudentByCondition.java`)
- User search → User pages: forwards
- Student → Personal profile: opens profile
- Teacher → Personal profile: opens profile
- Personal profile → User DAO: loads profile (evidence: `src/com/controller/PersonalServlet.java`)
- Personal profile → Profile view: forwards (evidence: `src/com/controller/PersonalServlet.java`)
- Excuse DAO → Excuse model: maps records (evidence: `src/com/dao/ExcuseDao.java`)
- User DAO → User model: maps records (evidence: `src/com/dao/UserDao.java`)
- Excuse DAO → JDBC connection: opens connection (evidence: `src/com/dao/ExcuseDao.java`)
- User DAO → JDBC connection: opens connection (evidence: `src/com/dao/UserDao.java`)
- JDBC connection → MySQL database: connects (evidence: `src/com/utils/Utils.java`)
- Excuse DAO → MySQL database: queries and writes
- User DAO → MySQL database: queries and writes
