# hayusuf1/java-hotel-system architecture

> Architecture diagram of the GitHub repository hayusuf1/java-hotel-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hayusuf1/java-hotel-system
- Repository: https://github.com/hayusuf1/java-hotel-system

## Overview

HotelSystem is a Java Swing hotel-operations desktop application. Users authenticate and are routed by role to an administrative dashboard or employee self-service; staff can manage bookings, rooms, customers, employees, attendance, payroll and financial records, with reports and PDF exports. The source shows role-based navigation, employee-search navigation, and direct JDBC query activity, but the README is empty and most form-to-form routing is unsampled. Dashed edges mark plausible but unverified integrations; the graph does not assume that every screen is reachable from the dashboard.

Main entry points: [`hotel.sql`](https://github.com/hayusuf1/java-hotel-system/blob/main/hotel.sql) (Hotel database), [`login.java`](https://github.com/hayusuf1/java-hotel-system/blob/main/login.java) (Sign in), [`EmpSearch.java`](https://github.com/hayusuf1/java-hotel-system/blob/main/EmpSearch.java) (Employee menu), [`employee.java`](https://github.com/hayusuf1/java-hotel-system/blob/main/employee.java) (Employee records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login["Sign in<br/>[login.java]"]
  node_roles["Role state<br/>[roles.java]"]
  node_dashboard["Admin dashboard<br/>[main.java]"]
  node_selfservice["Employee menu<br/>[EmpSearch.java]"]
end

subgraph group_hotel["Hotel operations"]
  node_booking["Room booking<br/>[bookroom.java]"]
  node_checkout["Guest checkout<br/>[checkout.java]"]
  node_rooms["Room management<br/>[rooms.java]"]
  node_roomedit["Room editing<br/>[addroom.java]"]
  node_customers["Customer records<br/>[customers.java]"]
  node_customerreport["Customer reports<br/>[custsreport.java]"]
end

subgraph group_workforce["Workforce management"]
  node_employees["Employee records<br/>[employee.java]"]
  node_employeeedit["Employee editing<br/>[addemp.java]"]
  node_attendance["Attendance records<br/>[empattandance.java]"]
  node_attreport["Attendance reports<br/>[attreport.java]"]
  node_selfattendance["Personal attendance<br/>[employeeatt.java]"]
  node_salary["Salary records<br/>[empsalary.java]"]
  node_payroll["Salary payment<br/>[paysalary.java]"]
end

subgraph group_finance["Finance and reporting"]
  node_expenses["Other expenses<br/>[otherexpenses.java]"]
  node_expenseedit["Expense entry<br/>[otherexpense.java]"]
  node_profit["Profit and loss<br/>[profitloss.java]"]
  node_salaryreport["Salary reports<br/>[salaryreport.java]"]
end

subgraph group_persistence["Persistence"]
  node_dbconnection["JDBC connection<br/>[connection.java]"]
  node_database[("Hotel database<br/>[hotel.sql]")]
end

node_user(("Hotel user"))

node_user -->|"signs in"| node_login
node_login -->|"checks role"| node_roles
node_login -->|"opens admin"| node_dashboard
node_login -->|"opens employee"| node_selfservice
node_selfservice -->|"opens attendance"| node_selfattendance
node_employees -->|"references search"| node_selfservice
node_dashboard -.->|"queries"| node_database
node_booking -.->|"updates records"| node_database
node_checkout -.->|"updates records"| node_database
node_rooms -.->|"reads records"| node_database
node_customers -.->|"reads records"| node_database
node_employees -.->|"queries"| node_database
node_attendance -.->|"maintains records"| node_database
node_salary -.->|"queries"| node_database
node_payroll -.->|"queries"| node_database
node_expenses -.->|"queries"| node_database
node_profit -.->|"queries"| node_database

click node_login "https://github.com/hayusuf1/java-hotel-system/blob/main/login.java"
click node_roles "https://github.com/hayusuf1/java-hotel-system/blob/main/roles.java"
click node_dashboard "https://github.com/hayusuf1/java-hotel-system/blob/main/main.java"
click node_selfservice "https://github.com/hayusuf1/java-hotel-system/blob/main/EmpSearch.java"
click node_booking "https://github.com/hayusuf1/java-hotel-system/blob/main/bookroom.java"
click node_checkout "https://github.com/hayusuf1/java-hotel-system/blob/main/checkout.java"
click node_rooms "https://github.com/hayusuf1/java-hotel-system/blob/main/rooms.java"
click node_roomedit "https://github.com/hayusuf1/java-hotel-system/blob/main/addroom.java"
click node_customers "https://github.com/hayusuf1/java-hotel-system/blob/main/customers.java"
click node_customerreport "https://github.com/hayusuf1/java-hotel-system/blob/main/custsreport.java"
click node_employees "https://github.com/hayusuf1/java-hotel-system/blob/main/employee.java"
click node_employeeedit "https://github.com/hayusuf1/java-hotel-system/blob/main/addemp.java"
click node_attendance "https://github.com/hayusuf1/java-hotel-system/blob/main/empattandance.java"
click node_attreport "https://github.com/hayusuf1/java-hotel-system/blob/main/attreport.java"
click node_selfattendance "https://github.com/hayusuf1/java-hotel-system/blob/main/employeeatt.java"
click node_salary "https://github.com/hayusuf1/java-hotel-system/blob/main/empsalary.java"
click node_payroll "https://github.com/hayusuf1/java-hotel-system/blob/main/paysalary.java"
click node_expenses "https://github.com/hayusuf1/java-hotel-system/blob/main/otherexpenses.java"
click node_expenseedit "https://github.com/hayusuf1/java-hotel-system/blob/main/otherexpense.java"
click node_profit "https://github.com/hayusuf1/java-hotel-system/blob/main/profitloss.java"
click node_salaryreport "https://github.com/hayusuf1/java-hotel-system/blob/main/salaryreport.java"
click node_dbconnection "https://github.com/hayusuf1/java-hotel-system/blob/main/connection.java"
click node_database "https://github.com/hayusuf1/java-hotel-system/blob/main/hotel.sql"

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_roles,node_dashboard,node_selfservice,node_user toneBlue
class node_booking,node_checkout,node_rooms,node_roomedit,node_customers,node_customerreport toneAmber
class node_employees,node_employeeedit,node_attendance,node_attreport,node_selfattendance,node_salary,node_payroll toneMint
class node_expenses,node_expenseedit,node_profit,node_salaryreport toneRose
class node_dbconnection,node_database toneIndigo
```

## Components

### Access and navigation

- [Sign in](https://github.com/hayusuf1/java-hotel-system/blob/main/login.java): `login.java`
- [Role state](https://github.com/hayusuf1/java-hotel-system/blob/main/roles.java): `roles.java`
- [Admin dashboard](https://github.com/hayusuf1/java-hotel-system/blob/main/main.java): `main.java`
- [Employee menu](https://github.com/hayusuf1/java-hotel-system/blob/main/EmpSearch.java): `EmpSearch.java`

### Hotel operations

- [Room booking](https://github.com/hayusuf1/java-hotel-system/blob/main/bookroom.java): `bookroom.java`
- [Guest checkout](https://github.com/hayusuf1/java-hotel-system/blob/main/checkout.java): `checkout.java`
- [Room management](https://github.com/hayusuf1/java-hotel-system/blob/main/rooms.java): `rooms.java`
- [Room editing](https://github.com/hayusuf1/java-hotel-system/blob/main/addroom.java): `addroom.java`
- [Customer records](https://github.com/hayusuf1/java-hotel-system/blob/main/customers.java): `customers.java`
- [Customer reports](https://github.com/hayusuf1/java-hotel-system/blob/main/custsreport.java): `custsreport.java`

### Workforce management

- [Employee records](https://github.com/hayusuf1/java-hotel-system/blob/main/employee.java): `employee.java`
- [Employee editing](https://github.com/hayusuf1/java-hotel-system/blob/main/addemp.java): `addemp.java`
- [Attendance records](https://github.com/hayusuf1/java-hotel-system/blob/main/empattandance.java): `empattandance.java`
- [Attendance reports](https://github.com/hayusuf1/java-hotel-system/blob/main/attreport.java): `attreport.java`
- [Personal attendance](https://github.com/hayusuf1/java-hotel-system/blob/main/employeeatt.java): `employeeatt.java`
- [Salary records](https://github.com/hayusuf1/java-hotel-system/blob/main/empsalary.java): `empsalary.java`
- [Salary payment](https://github.com/hayusuf1/java-hotel-system/blob/main/paysalary.java): `paysalary.java`

### Finance and reporting

- [Other expenses](https://github.com/hayusuf1/java-hotel-system/blob/main/otherexpenses.java): `otherexpenses.java`
- [Expense entry](https://github.com/hayusuf1/java-hotel-system/blob/main/otherexpense.java): `otherexpense.java`
- [Profit and loss](https://github.com/hayusuf1/java-hotel-system/blob/main/profitloss.java): `profitloss.java`
- [Salary reports](https://github.com/hayusuf1/java-hotel-system/blob/main/salaryreport.java): `salaryreport.java`

### Persistence

- [JDBC connection](https://github.com/hayusuf1/java-hotel-system/blob/main/connection.java): `connection.java`
- [Hotel database](https://github.com/hayusuf1/java-hotel-system/blob/main/hotel.sql): `hotel.sql`

### Other components

- **Hotel user**

## Connections

- Hotel user → Sign in: signs in
- Sign in → Role state: checks role (evidence: `login.java`)
- Sign in → Admin dashboard: opens admin (evidence: `login.java`)
- Sign in → Employee menu: opens employee (evidence: `login.java`)
- Employee menu → Personal attendance: opens attendance (evidence: `EmpSearch.java`)
- Employee records → Employee menu: references search (evidence: `employee.java`)
- Admin dashboard → Hotel database: queries
- Room booking → Hotel database: updates records
- Guest checkout → Hotel database: updates records
- Room management → Hotel database: reads records
- Customer records → Hotel database: reads records
- Employee records → Hotel database: queries
- Attendance records → Hotel database: maintains records
- Salary records → Hotel database: queries
- Salary payment → Hotel database: queries
- Other expenses → Hotel database: queries
- Profit and loss → Hotel database: queries
