# tonbunheng/tourism-admin architecture

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

- Interactive diagram: https://gitdiagram.com/tonbunheng/tourism-admin
- Repository: https://github.com/tonbunheng/tourism-admin

## Overview

AngkorVerses Admin is a React management portal for tourism-content curation, moderation, operational oversight, and reporting. Staff sign in, pass role-based route guards, and use the protected dashboard to manage domain records; page modules call service modules that communicate with the Laravel API. The README documents further capabilities and access levels, but many page implementations were not sampled, so links for those branches are limited to documented routing or omitted. The graph shows major product areas without claiming unsampled implementation details.

Main entry points: [`src/routes/AppRoutes.jsx`](https://github.com/tonbunheng/tourism-admin/blob/main/src/routes/AppRoutes.jsx) (Routes and RBAC), [`src/services`](https://github.com/tonbunheng/tourism-admin/tree/main/src/services) (API service layer), [`src/services/api.js`](https://github.com/tonbunheng/tourism-admin/blob/main/src/services/api.js) (HTTP client), [`src/services/authService.js`](https://github.com/tonbunheng/tourism-admin/blob/main/src/services/authService.js) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Portal access"]
  node_login["Staff login<br/>[Login.jsx]"]
  node_routes["Routes and RBAC<br/>[AppRoutes.jsx]"]
  node_guards["Route guards<br/>[ProtectedRoute.jsx]"]
  node_admin_shell["Admin workspace<br/>[Main.jsx]"]
end

subgraph group_content["Tourism content"]
  node_places["Places directory"]
  node_categories["Categories<br/>[Categories.jsx]"]
  node_provinces["Provinces directory"]
  node_events["Cultural events"]
  node_tours["Tour packages<br/>[Tours.jsx]"]
  node_guides["Guide directory"]
  node_galleries["Media galleries"]
end

subgraph group_oversight["Operations oversight"]
  node_dashboard["Executive dashboard<br/>[Dashboard.jsx]"]
  node_businesses["Business moderation<br/>[Businesses.jsx]"]
  node_bookings["Booking management<br/>[Bookings.jsx]"]
  node_reviews["Reviews and ratings"]
  node_favorites["Favorites analytics"]
  node_notifications["Notifications center<br/>[Notifications.jsx]"]
  node_users["User management"]
  node_reports["Reports and exports"]
  node_security["Security defense"]
  node_tracking["Live user tracking"]
  node_deletions["Deletion requests"]
  node_settings["System settings"]
  node_profile["Staff profile"]
end

subgraph group_platform["Shared platform"]
  node_service_layer["API service layer"]
  node_auth_service["Authentication service<br/>[authService.js]"]
  node_api["HTTP client<br/>[api.js]"]
  node_alerts["Alert context<br/>[AlertContext.jsx]"]
end

node_staff(("Staff user"))
node_backend["Laravel API"]

node_staff -->|"signs in"| node_login
node_login -->|"authenticates with"| node_auth_service
node_auth_service -->|"requests through"| node_api
node_api -->|"sends API requests"| node_backend
node_routes -->|"guards routes"| node_guards
node_routes -->|"routes to"| node_login
node_routes -->|"wraps protected pages"| node_admin_shell
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_places
node_routes -->|"routes to"| node_categories
node_routes -->|"routes to"| node_provinces
node_routes -->|"routes to"| node_events
node_routes -->|"routes to"| node_tours
node_routes -->|"routes to"| node_guides
node_routes -->|"routes to"| node_galleries
node_routes -->|"routes to"| node_businesses
node_routes -->|"routes to"| node_bookings
node_routes -->|"routes to"| node_reviews
node_routes -->|"routes to"| node_favorites
node_routes -->|"routes to"| node_notifications
node_routes -->|"routes to"| node_users
node_routes -->|"routes to"| node_reports
node_routes -->|"routes to"| node_security
node_routes -->|"routes to"| node_tracking
node_routes -->|"routes to"| node_deletions
node_routes -->|"routes to"| node_settings
node_routes -->|"routes to"| node_profile
node_admin_shell -->|"renders protected content"| node_dashboard
node_places -.->|"uses data services"| node_service_layer
node_categories -->|"calls category service"| node_service_layer
node_bookings -->|"calls booking service"| node_service_layer
node_businesses -->|"calls business service"| node_service_layer
node_tours -->|"calls tour service"| node_service_layer
node_notifications -->|"calls notification service"| node_service_layer
node_service_layer -.->|"issues HTTP calls"| node_api
node_reports -.->|"loads report data"| node_api
node_auth_service -->|"stores session"| node_staff
node_alerts -.->|"provides shared alerts"| node_admin_shell

click node_login "https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/auth/Login.jsx"
click node_routes "https://github.com/tonbunheng/tourism-admin/blob/main/src/routes/AppRoutes.jsx"
click node_guards "https://github.com/tonbunheng/tourism-admin/blob/main/src/routes/ProtectedRoute.jsx"
click node_admin_shell "https://github.com/tonbunheng/tourism-admin/blob/main/src/layouts/Main.jsx"
click node_dashboard "https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/dashboard/Dashboard.jsx"
click node_places "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/places"
click node_categories "https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/categories/Categories.jsx"
click node_provinces "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/provinces"
click node_events "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/events"
click node_tours "https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/tours/Tours.jsx"
click node_guides "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/guides"
click node_galleries "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/galleries"
click node_businesses "https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/businesses/Businesses.jsx"
click node_bookings "https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/bookings/Bookings.jsx"
click node_reviews "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/ratings"
click node_favorites "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/favorites"
click node_notifications "https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/notifications/Notifications.jsx"
click node_users "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/users"
click node_reports "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/reports"
click node_security "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/security"
click node_tracking "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/tracking"
click node_deletions "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/delete"
click node_settings "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/settings"
click node_profile "https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/profiles"
click node_service_layer "https://github.com/tonbunheng/tourism-admin/tree/main/src/services"
click node_auth_service "https://github.com/tonbunheng/tourism-admin/blob/main/src/services/authService.js"
click node_api "https://github.com/tonbunheng/tourism-admin/blob/main/src/services/api.js"
click node_alerts "https://github.com/tonbunheng/tourism-admin/blob/main/src/context/AlertContext.jsx"

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_routes,node_guards,node_admin_shell,node_staff toneBlue
class node_places,node_categories,node_provinces,node_events,node_tours,node_guides,node_galleries toneAmber
class node_dashboard,node_businesses,node_bookings,node_reviews,node_favorites,node_notifications,node_users,node_reports,node_security,node_tracking,node_deletions,node_settings,node_profile,node_backend toneMint
class node_service_layer,node_auth_service,node_api,node_alerts toneRose
```

## Components

### Portal access

- [Staff login](https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/auth/Login.jsx): `src/pages/auth/Login.jsx`
- [Routes and RBAC](https://github.com/tonbunheng/tourism-admin/blob/main/src/routes/AppRoutes.jsx): `src/routes/AppRoutes.jsx`
- [Route guards](https://github.com/tonbunheng/tourism-admin/blob/main/src/routes/ProtectedRoute.jsx): `src/routes/ProtectedRoute.jsx`
- [Admin workspace](https://github.com/tonbunheng/tourism-admin/blob/main/src/layouts/Main.jsx): `src/layouts/Main.jsx`

### Tourism content

- [Places directory](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/places): `src/pages/places`
- [Categories](https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/categories/Categories.jsx): `src/pages/categories/Categories.jsx`
- [Provinces directory](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/provinces): `src/pages/provinces`
- [Cultural events](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/events): `src/pages/events`
- [Tour packages](https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/tours/Tours.jsx): `src/pages/tours/Tours.jsx`
- [Guide directory](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/guides): `src/pages/guides`
- [Media galleries](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/galleries): `src/pages/galleries`

### Operations oversight

- [Executive dashboard](https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/dashboard/Dashboard.jsx): `src/pages/dashboard/Dashboard.jsx`
- [Business moderation](https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/businesses/Businesses.jsx): `src/pages/businesses/Businesses.jsx`
- [Booking management](https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/bookings/Bookings.jsx): `src/pages/bookings/Bookings.jsx`
- [Reviews and ratings](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/ratings): `src/pages/ratings`
- [Favorites analytics](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/favorites): `src/pages/favorites`
- [Notifications center](https://github.com/tonbunheng/tourism-admin/blob/main/src/pages/notifications/Notifications.jsx): `src/pages/notifications/Notifications.jsx`
- [User management](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/users): `src/pages/users`
- [Reports and exports](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/reports): `src/pages/reports`
- [Security defense](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/security): `src/pages/security`
- [Live user tracking](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/tracking): `src/pages/tracking`
- [Deletion requests](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/delete): `src/pages/delete`
- [System settings](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/settings): `src/pages/settings`
- [Staff profile](https://github.com/tonbunheng/tourism-admin/tree/main/src/pages/profiles): `src/pages/profiles`

### Shared platform

- [API service layer](https://github.com/tonbunheng/tourism-admin/tree/main/src/services): `src/services`
- [Authentication service](https://github.com/tonbunheng/tourism-admin/blob/main/src/services/authService.js): `src/services/authService.js`
- [HTTP client](https://github.com/tonbunheng/tourism-admin/blob/main/src/services/api.js): `src/services/api.js`
- [Alert context](https://github.com/tonbunheng/tourism-admin/blob/main/src/context/AlertContext.jsx): `src/context/AlertContext.jsx`

### Other components

- **Staff user**
- **Laravel API**

## Connections

- Staff user → Staff login: signs in (evidence: `README.md`)
- Staff login → Authentication service: authenticates with (evidence: `src/services/authService.js`)
- Authentication service → HTTP client: requests through (evidence: `src/services/authService.js`)
- HTTP client → Laravel API: sends API requests (evidence: `README.md`)
- Routes and RBAC → Route guards: guards routes (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Staff login: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Admin workspace: wraps protected pages (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Executive dashboard: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Places directory: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Categories: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Provinces directory: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Cultural events: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Tour packages: routes to (evidence: `README.md`)
- Routes and RBAC → Guide directory: routes to (evidence: `README.md`)
- Routes and RBAC → Media galleries: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Business moderation: routes to (evidence: `README.md`)
- Routes and RBAC → Booking management: routes to (evidence: `README.md`)
- Routes and RBAC → Reviews and ratings: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Favorites analytics: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Notifications center: routes to (evidence: `README.md`)
- Routes and RBAC → User management: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Reports and exports: routes to (evidence: `README.md`)
- Routes and RBAC → Security defense: routes to (evidence: `README.md`)
- Routes and RBAC → Live user tracking: routes to (evidence: `README.md`)
- Routes and RBAC → Deletion requests: routes to (evidence: `README.md`)
- Routes and RBAC → System settings: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Routes and RBAC → Staff profile: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Admin workspace → Executive dashboard: renders protected content (evidence: `src/layouts/Main.jsx`)
- Places directory → API service layer: uses data services
- Categories → API service layer: calls category service (evidence: `src/pages/categories/Categories.jsx`)
- Booking management → API service layer: calls booking service (evidence: `src/pages/bookings/Bookings.jsx`)
- Business moderation → API service layer: calls business service (evidence: `src/pages/businesses/Businesses.jsx`)
- Tour packages → API service layer: calls tour service (evidence: `src/pages/tours/Tours.jsx`)
- Notifications center → API service layer: calls notification service (evidence: `src/pages/notifications/Notifications.jsx`)
- API service layer → HTTP client: issues HTTP calls (evidence: `src/services/reviewService.js`)
- Reports and exports → HTTP client: loads report data
- Authentication service → Staff user: stores session (evidence: `src/services/authService.js`)
- Alert context → Admin workspace: provides shared alerts
