# ggwn021-beep/24ct2---tranlethaominh architecture

> Architecture diagram of the GitHub repository ggwn021-beep/24ct2---tranlethaominh, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ggwn021-beep/24ct2---tranlethaominh
- Repository: https://github.com/ggwn021-beep/24ct2---tranlethaominh

## Overview

This is a hotel room booking and operations application: guests browse rooms, inspect availability, sign in, and submit booking requests; staff confirm payment and manage check-in/check-out, while admins manage rooms and staff and view booking statistics. The Vue router selects the user-facing views, which call an Express API backed by MySQL. The frontend and backend excerpts support the main flows; backend booking-creation details and some view implementations were not sampled, so those relationships are shown only where evidenced.

Main entry points: [`src/router/index.js`](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/router/index.js) (Route Guard), [`server.js`](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/server.js) (Express API), [`src/views/HotelDetailView.vue`](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/HotelDetailView.vue) (Room Detail), [`src/views/HomeView.vue`](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/HomeView.vue) (Room Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Guest Web"]
  node_app["Vue App<br/>[App.vue]"]
  node_router["Route Guard<br/>[index.js]"]
  node_home["Room Catalog<br/>[HomeView.vue]"]
  node_detail["Room Detail"]
  node_booking["Booking Form<br/>[BookingView.vue]"]
  node_login["Sign In<br/>[LoginView.vue]"]
end

subgraph group_ops["Hotel Operations"]
  node_staff["Staff Desk<br/>[StaffDashboard.vue]"]
  node_admin["Admin Desk<br/>[AdminDashboard.vue]"]
end

subgraph group_api["API Services"]
  node_api["Express API<br/>[server.js]"]
end

subgraph group_data["Persistence"]
  node_mysql[("Hotel Database")]
end

node_guest(("Guest"))

node_guest -->|"navigates"| node_router
node_router -->|"renders routes"| node_app
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_detail
node_router -->|"guards route"| node_booking
node_router -->|"routes to"| node_login
node_router -->|"guards route"| node_staff
node_router -->|"guards route"| node_admin
node_home -->|"fetches rooms"| node_api
node_home -->|"opens room"| node_detail
node_detail -->|"fetches room"| node_api
node_detail -->|"passes room"| node_booking
node_booking -->|"submits booking"| node_api
node_login -->|"checks credentials"| node_api
node_staff -->|"manages booking"| node_api
node_admin -->|"manages hotel"| node_api
node_api -->|"queries"| node_mysql

click node_app "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/App.vue"
click node_router "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/router/index.js"
click node_home "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/HomeView.vue"
click node_detail "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/HotelDetailView.vue"
click node_booking "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/BookingView.vue"
click node_login "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/LoginView.vue"
click node_staff "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/StaffDashboard.vue"
click node_admin "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/AdminDashboard.vue"
click node_api "https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/server.js"

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_app,node_router,node_home,node_detail,node_booking,node_login toneBlue
class node_staff,node_admin toneAmber
class node_api toneMint
class node_mysql toneRose
class node_guest toneIndigo
```

## Components

### Guest Web

- [Vue App](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/App.vue): `src/App.vue`
- [Route Guard](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/router/index.js): `src/router/index.js`
- [Room Catalog](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/HomeView.vue): `src/views/HomeView.vue`
- [Room Detail](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/HotelDetailView.vue): `src/views/HotelDetailView.vue`
- [Booking Form](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/BookingView.vue): `src/views/BookingView.vue`
- [Sign In](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/LoginView.vue): `src/views/LoginView.vue`

### Hotel Operations

- [Staff Desk](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/StaffDashboard.vue): `src/views/StaffDashboard.vue`
- [Admin Desk](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/src/views/AdminDashboard.vue): `src/views/AdminDashboard.vue`

### API Services

- [Express API](https://github.com/ggwn021-beep/24ct2---tranlethaominh/blob/main/server.js): `server.js`

### Persistence

- **Hotel Database**

### Other components

- **Guest**

## Connections

- Guest → Route Guard: navigates (evidence: `src/router/index.js`)
- Route Guard → Vue App: renders routes (evidence: `src/main.js`)
- Route Guard → Room Catalog: routes to (evidence: `src/router/index.js`)
- Route Guard → Room Detail: routes to (evidence: `src/router/index.js`)
- Route Guard → Booking Form: guards route (evidence: `src/router/index.js`)
- Route Guard → Sign In: routes to (evidence: `src/router/index.js`)
- Route Guard → Staff Desk: guards route (evidence: `src/router/index.js`)
- Route Guard → Admin Desk: guards route (evidence: `src/router/index.js`)
- Room Catalog → Express API: fetches rooms (evidence: `src/views/HomeView.vue`)
- Room Catalog → Room Detail: opens room (evidence: `src/views/HomeView.vue`)
- Room Detail → Express API: fetches room (evidence: `src/views/HotelDetailView.vue`)
- Room Detail → Booking Form: passes room (evidence: `src/views/HotelDetailView.vue`)
- Booking Form → Express API: submits booking (evidence: `src/views/BookingView.vue`)
- Sign In → Express API: checks credentials (evidence: `src/views/LoginView.vue`)
- Staff Desk → Express API: manages booking (evidence: `src/views/StaffDashboard.vue`)
- Admin Desk → Express API: manages hotel (evidence: `src/views/AdminDashboard.vue`)
- Express API → Hotel Database: queries (evidence: `server.js`)
