# quituan/cnpm architecture

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

- Interactive diagram: https://gitdiagram.com/quituan/cnpm
- Repository: https://github.com/quituan/cnpm

## Overview

PC 24/7 is a computer-repair booking and operations application. Customers browse services and request appointments; staff-facing pages support technician order handling and administration, including inventory and revenue reporting. Authentication and registration provide role-based access, while customer and technician pages expose order tracking and chat interfaces. The excerpts show direct PHP-to-MySQL access and some login routing; the README is empty, and unsampled code limits certainty about page inclusion and several feature integrations.

Main entry points: [`login.php`](https://github.com/quituan/cnpm/blob/main/login.php) (Sign in), [`database.sql`](https://github.com/quituan/cnpm/blob/main/database.sql) (Application database), [`booking.php`](https://github.com/quituan/cnpm/blob/main/booking.php) (Appointment request), [`index.php`](https://github.com/quituan/cnpm/blob/main/index.php) (Service catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_home["Service catalog<br/>[index.php]"]
  node_booking["Appointment request<br/>[booking.php]"]
  node_customer_orders["Customer order tracking<br/>[khachhang.php]"]
end

subgraph group_identity["Identity and access"]
  node_login["Sign in<br/>[login.php]"]
  node_registration["Customer registration<br/>[register.php]"]
  node_session_guard["Session and role checks<br/>[auth.php]"]
  node_logout["Sign out<br/>[logout.php]"]
end

subgraph group_operations["Repair operations"]
  node_technician["Technician order desk<br/>[kythuat.php]"]
  node_admin["Admin management<br/>[admin.php]"]
  node_dashboard["Dashboard entry<br/>[dashboard.php]"]
end

subgraph group_data["Persistence"]
  node_database[("Application database<br/>[database.sql]")]
  node_db_connection["MySQL connection<br/>[connect.php]"]
end

node_visitor(("Visitor / customer"))

node_visitor -->|"browses"| node_home
node_visitor -->|"requests appointment"| node_booking
node_visitor -->|"signs in"| node_login
node_login -->|"reads accounts"| node_database
node_registration -->|"creates account"| node_database
node_login -->|"routes admin"| node_admin
node_login -->|"routes technician"| node_technician
node_login -->|"routes customer"| node_home
node_home -->|"opens connection"| node_db_connection
node_booking -->|"inserts booking"| node_database
node_booking -->|"opens connection"| node_db_connection
node_visitor -.->|"tracks orders"| node_customer_orders
node_customer_orders -.->|"chat interface"| node_technician
node_technician -.->|"reads and updates orders"| node_database
node_admin -.->|"manages records"| node_database
node_session_guard -->|"redirects unauthenticated"| node_login
node_visitor -.->|"registers"| node_registration
node_logout -->|"redirects after sign-out"| node_login

click node_home "https://github.com/quituan/cnpm/blob/main/index.php"
click node_booking "https://github.com/quituan/cnpm/blob/main/booking.php"
click node_customer_orders "https://github.com/quituan/cnpm/blob/main/khachhang.php"
click node_login "https://github.com/quituan/cnpm/blob/main/login.php"
click node_registration "https://github.com/quituan/cnpm/blob/main/register.php"
click node_session_guard "https://github.com/quituan/cnpm/blob/main/auth.php"
click node_logout "https://github.com/quituan/cnpm/blob/main/logout.php"
click node_technician "https://github.com/quituan/cnpm/blob/main/kythuat.php"
click node_admin "https://github.com/quituan/cnpm/blob/main/admin.php"
click node_dashboard "https://github.com/quituan/cnpm/blob/main/dashboard.php"
click node_database "https://github.com/quituan/cnpm/blob/main/database.sql"
click node_db_connection "https://github.com/quituan/cnpm/blob/main/connect.php"

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_home,node_booking,node_customer_orders toneBlue
class node_login,node_registration,node_session_guard,node_logout toneAmber
class node_technician,node_admin,node_dashboard toneMint
class node_database,node_db_connection toneRose
class node_visitor toneIndigo
```

## Components

### Customer experience

- [Service catalog](https://github.com/quituan/cnpm/blob/main/index.php): `index.php`
- [Appointment request](https://github.com/quituan/cnpm/blob/main/booking.php): `booking.php`
- [Customer order tracking](https://github.com/quituan/cnpm/blob/main/khachhang.php): `khachhang.php`

### Identity and access

- [Sign in](https://github.com/quituan/cnpm/blob/main/login.php): `login.php`
- [Customer registration](https://github.com/quituan/cnpm/blob/main/register.php): `register.php`
- [Session and role checks](https://github.com/quituan/cnpm/blob/main/auth.php): `auth.php`
- [Sign out](https://github.com/quituan/cnpm/blob/main/logout.php): `logout.php`

### Repair operations

- [Technician order desk](https://github.com/quituan/cnpm/blob/main/kythuat.php): `kythuat.php`
- [Admin management](https://github.com/quituan/cnpm/blob/main/admin.php): `admin.php`
- [Dashboard entry](https://github.com/quituan/cnpm/blob/main/dashboard.php): `dashboard.php`

### Persistence

- [Application database](https://github.com/quituan/cnpm/blob/main/database.sql): `database.sql`
- [MySQL connection](https://github.com/quituan/cnpm/blob/main/connect.php): `connect.php`

### Other components

- **Visitor / customer**

## Connections

- Visitor / customer → Service catalog: browses (evidence: `index.php`)
- Visitor / customer → Appointment request: requests appointment (evidence: `booking.php`)
- Visitor / customer → Sign in: signs in (evidence: `login.php`)
- Sign in → Application database: reads accounts (evidence: `login.php`)
- Customer registration → Application database: creates account (evidence: `register.php`)
- Sign in → Admin management: routes admin (evidence: `login.php`)
- Sign in → Technician order desk: routes technician (evidence: `login.php`)
- Sign in → Service catalog: routes customer (evidence: `login.php`)
- Service catalog → MySQL connection: opens connection (evidence: `index.php`)
- Appointment request → Application database: inserts booking (evidence: `booking.php`)
- Appointment request → MySQL connection: opens connection (evidence: `booking.php`)
- Visitor / customer → Customer order tracking: tracks orders
- Customer order tracking → Technician order desk: chat interface
- Technician order desk → Application database: reads and updates orders
- Admin management → Application database: manages records
- Session and role checks → Sign in: redirects unauthenticated (evidence: `auth.php`)
- Visitor / customer → Customer registration: registers
- Sign out → Sign in: redirects after sign-out (evidence: `logout.php`)
