# ongmingzhi/travel_project architecture

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

- Interactive diagram: https://gitdiagram.com/ongmingzhi/travel_project
- Repository: https://github.com/ongmingzhi/travel_project

## Overview

This is a PHP travel-exploration web app: signed-in users browse countries, then cities, then hotels, and can bookmark hotels. Administrators have a separate management dashboard for destination and user records. Sampled pages show session-based access checks and PDO queries against a local MySQL `traveldb`; the tree and page labels support the broader CRUD and bookmark branches, but README documentation and most handlers are unavailable, so their internal wiring is not expanded beyond clear page-to-page navigation.

Main entry points: [`index.php`](https://github.com/ongmingzhi/travel_project/blob/main/index.php) (Travel home), [`manage.php`](https://github.com/ongmingzhi/travel_project/blob/main/manage.php) (Admin dashboard), [`login.php`](https://github.com/ongmingzhi/travel_project/blob/main/login.php) (Sign in), [`countries.php`](https://github.com/ongmingzhi/travel_project/blob/main/countries.php) (Country browser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Accounts and sessions"]
  node_header["Shared header<br/>[header.php]"]
  node_login["Sign in<br/>[login.php]"]
  node_register["Register<br/>[register.php]"]
  node_logout["Sign out<br/>[logout.php]"]
end

subgraph group_browse["Travel discovery"]
  node_home["Travel home<br/>[index.php]"]
  node_countries["Country browser<br/>[countries.php]"]
  node_cities["City browser<br/>[cities.php]"]
  node_hotels["Hotel listings<br/>[hotels.php]"]
  node_bookmarks["Saved hotels<br/>[bookmarks.php]"]
  node_bookmark_edit["Bookmark actions<br/>[bookmarks-edit.php]"]
  node_bookmark_add["Add bookmark<br/>[bookmarks-add.php]"]
end

subgraph group_admin["Administration"]
  node_manage["Admin dashboard<br/>[manage.php]"]
  node_country_admin["Country management<br/>[countries-add.php]"]
  node_city_admin["City management<br/>[cities-add.php]"]
  node_hotel_admin["Hotel management<br/>[hotels-add.php]"]
  node_user_admin["User management<br/>[users.php]"]
  node_user_edit["User actions<br/>[users-add.php]"]
end

subgraph group_data["Persistence"]
  node_database[("Travel database")]
end

node_visitor(("Visitor"))

node_visitor -->|"signs in"| node_login
node_visitor -->|"registers"| node_register
node_login -->|"reads user"| node_database
node_login -->|"redirects on success"| node_home
node_register -->|"creates account"| node_database
node_home -->|"redirects if signed out"| node_login
node_home -->|"opens destinations"| node_countries
node_home -->|"admin link"| node_manage
node_home -->|"sign-out link"| node_logout
node_countries -->|"reads countries"| node_database
node_countries -->|"opens country cities"| node_cities
node_cities -->|"reads cities"| node_database
node_cities -->|"opens city hotels"| node_hotels
node_hotels -->|"reads city and hotels"| node_database
node_hotels -->|"adds hotel bookmark"| node_bookmark_add
node_bookmark_add -->|"writes bookmark"| node_database
node_bookmarks -->|"reads bookmarks"| node_database
node_bookmarks -->|"manages saved items"| node_bookmark_edit
node_bookmark_edit -->|"updates bookmark"| node_database
node_manage -->|"manages countries"| node_country_admin
node_manage -->|"manages cities"| node_city_admin
node_manage -->|"manages hotels"| node_hotel_admin
node_manage -->|"manages users"| node_user_admin
node_country_admin -->|"writes countries"| node_database
node_city_admin -->|"writes cities"| node_database
node_hotel_admin -->|"writes hotels"| node_database
node_user_admin -->|"reads and soft-deletes"| node_database
node_user_admin -->|"adds users"| node_user_edit
node_user_edit -->|"writes users"| node_database
node_header -->|"provides shared DB access"| node_database
node_logout -->|"redirects"| node_login

click node_header "https://github.com/ongmingzhi/travel_project/blob/main/header.php"
click node_login "https://github.com/ongmingzhi/travel_project/blob/main/login.php"
click node_register "https://github.com/ongmingzhi/travel_project/blob/main/register.php"
click node_logout "https://github.com/ongmingzhi/travel_project/blob/main/logout.php"
click node_home "https://github.com/ongmingzhi/travel_project/blob/main/index.php"
click node_countries "https://github.com/ongmingzhi/travel_project/blob/main/countries.php"
click node_cities "https://github.com/ongmingzhi/travel_project/blob/main/cities.php"
click node_hotels "https://github.com/ongmingzhi/travel_project/blob/main/hotels.php"
click node_bookmarks "https://github.com/ongmingzhi/travel_project/blob/main/bookmarks.php"
click node_bookmark_edit "https://github.com/ongmingzhi/travel_project/blob/main/bookmarks-edit.php"
click node_bookmark_add "https://github.com/ongmingzhi/travel_project/blob/main/bookmarks-add.php"
click node_manage "https://github.com/ongmingzhi/travel_project/blob/main/manage.php"
click node_country_admin "https://github.com/ongmingzhi/travel_project/blob/main/countries-add.php"
click node_city_admin "https://github.com/ongmingzhi/travel_project/blob/main/cities-add.php"
click node_hotel_admin "https://github.com/ongmingzhi/travel_project/blob/main/hotels-add.php"
click node_user_admin "https://github.com/ongmingzhi/travel_project/blob/main/users.php"
click node_user_edit "https://github.com/ongmingzhi/travel_project/blob/main/users-add.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_header,node_login,node_register,node_logout toneBlue
class node_home,node_countries,node_cities,node_hotels,node_bookmarks,node_bookmark_edit,node_bookmark_add toneAmber
class node_manage,node_country_admin,node_city_admin,node_hotel_admin,node_user_admin,node_user_edit toneMint
class node_database toneRose
class node_visitor toneIndigo
```

## Components

### Accounts and sessions

- [Shared header](https://github.com/ongmingzhi/travel_project/blob/main/header.php): `header.php`
- [Sign in](https://github.com/ongmingzhi/travel_project/blob/main/login.php): `login.php`
- [Register](https://github.com/ongmingzhi/travel_project/blob/main/register.php): `register.php`
- [Sign out](https://github.com/ongmingzhi/travel_project/blob/main/logout.php): `logout.php`

### Travel discovery

- [Travel home](https://github.com/ongmingzhi/travel_project/blob/main/index.php): `index.php`
- [Country browser](https://github.com/ongmingzhi/travel_project/blob/main/countries.php): `countries.php`
- [City browser](https://github.com/ongmingzhi/travel_project/blob/main/cities.php): `cities.php`
- [Hotel listings](https://github.com/ongmingzhi/travel_project/blob/main/hotels.php): `hotels.php`
- [Saved hotels](https://github.com/ongmingzhi/travel_project/blob/main/bookmarks.php): `bookmarks.php`
- [Bookmark actions](https://github.com/ongmingzhi/travel_project/blob/main/bookmarks-edit.php): `bookmarks-edit.php`
- [Add bookmark](https://github.com/ongmingzhi/travel_project/blob/main/bookmarks-add.php): `bookmarks-add.php`

### Administration

- [Admin dashboard](https://github.com/ongmingzhi/travel_project/blob/main/manage.php): `manage.php`
- [Country management](https://github.com/ongmingzhi/travel_project/blob/main/countries-add.php): `countries-add.php`
- [City management](https://github.com/ongmingzhi/travel_project/blob/main/cities-add.php): `cities-add.php`
- [Hotel management](https://github.com/ongmingzhi/travel_project/blob/main/hotels-add.php): `hotels-add.php`
- [User management](https://github.com/ongmingzhi/travel_project/blob/main/users.php): `users.php`
- [User actions](https://github.com/ongmingzhi/travel_project/blob/main/users-add.php): `users-add.php`

### Persistence

- **Travel database**

### Other components

- **Visitor**

## Connections

- Visitor → Sign in: signs in
- Visitor → Register: registers
- Sign in → Travel database: reads user
- Sign in → Travel home: redirects on success
- Register → Travel database: creates account
- Travel home → Sign in: redirects if signed out
- Travel home → Country browser: opens destinations
- Travel home → Admin dashboard: admin link
- Travel home → Sign out: sign-out link
- Country browser → Travel database: reads countries
- Country browser → City browser: opens country cities
- City browser → Travel database: reads cities
- City browser → Hotel listings: opens city hotels
- Hotel listings → Travel database: reads city and hotels
- Hotel listings → Add bookmark: adds hotel bookmark
- Add bookmark → Travel database: writes bookmark
- Saved hotels → Travel database: reads bookmarks
- Saved hotels → Bookmark actions: manages saved items
- Bookmark actions → Travel database: updates bookmark
- Admin dashboard → Country management: manages countries
- Admin dashboard → City management: manages cities
- Admin dashboard → Hotel management: manages hotels
- Admin dashboard → User management: manages users
- Country management → Travel database: writes countries
- City management → Travel database: writes cities
- Hotel management → Travel database: writes hotels
- User management → Travel database: reads and soft-deletes
- User management → User actions: adds users
- User actions → Travel database: writes users
- Shared header → Travel database: provides shared DB access
- Sign out → Sign in: redirects
