# quockhanh4551190031/boarding-home-project-intern-react-frontend architecture

> Architecture diagram of the GitHub repository quockhanh4551190031/boarding-home-project-intern-react-frontend, 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/quockhanh4551190031/boarding-home-project-intern-react-frontend
- Repository: https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend

## Overview

This is a React frontend for a boarding-room rental platform, with tenant-facing room discovery, landlord listing management, community features, and admin tools. The main workflow routes users to room search and detail views; landlords manage houses, rooms, and images, while tenants can favorite rooms, chat, and participate in the forum. Authentication state supports protected and role-specific areas. The README identifies a separate backend; sampled API code shows HTTP calls, and the chat hook shows a WebSocket connection. Unsampled feature internals are represented only where the source index supports their connections.

Main entry points: [`src/App.tsx`](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/App.tsx) (Route application), [`src/api/roomApi.ts`](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/roomApi.ts) (Room operations), [`src/api/axiosClient.ts`](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/axiosClient.ts) (HTTP client), [`src/pages/dashboard/LandlordRoomsPage.tsx`](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/dashboard/LandlordRoomsPage.tsx) (Room management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and access"]
  node_app["Route application<br/>[App.tsx]"]
  node_mainlayout["Main layout<br/>[MainLayout.tsx]"]
  node_dashboardlayout["Dashboard layout"]
  node_authguard["Access guards<br/>[ProtectedRoute.tsx]"]
  node_authstate["Auth state<br/>[authStore.ts]"]
  node_authapi["HTTP client<br/>[axiosClient.ts]"]
end

subgraph group_rental["Room rental"]
  node_home["Room discovery<br/>[HomePage.tsx]"]
  node_roomdetail["Room details<br/>[RoomDetailPage.tsx]"]
  node_roomapi["Room operations<br/>[roomApi.ts]"]
  node_roomtypes["Room data<br/>[room.ts]"]
  node_favorites["Saved rooms<br/>[FavoritesPage.tsx]"]
  node_landlordhouses["House management"]
  node_landlordrooms["Room management"]
  node_imageupload["Room image manager"]
end

subgraph group_community["Community features"]
  node_forum["Forum feed<br/>[ForumPage.tsx]"]
  node_postdetail["Post discussion<br/>[PostDetailPage.tsx]"]
  node_forumapi["Forum operations<br/>[forumApi.ts]"]
  node_chat["Direct messaging<br/>[ChatPage.tsx]"]
  node_chatsocket["Live chat socket<br/>[useChatSocket.ts]"]
  node_chatapi["Chat operations<br/>[chatApi.ts]"]
  node_chatbot["Room assistant<br/>[ChatbotWidget.tsx]"]
end

subgraph group_management["Account and administration"]
  node_admin["Admin console<br/>[AdminUsersPage.tsx]"]
  node_adminapi["Admin operations<br/>[adminApi.ts]"]
  node_profile["User profile<br/>[ProfilePage.tsx]"]
end

node_user(("Visitor or user"))
node_backend{{"Platform backend"}}

node_user -->|"opens"| node_app
node_app -->|"routes through"| node_mainlayout
node_app -->|"routes through"| node_dashboardlayout
node_app -->|"guards routes"| node_authguard
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_roomdetail
node_app -->|"routes to"| node_favorites
node_app -->|"routes to"| node_landlordhouses
node_app -->|"routes to"| node_landlordrooms
node_app -->|"routes to"| node_forum
node_app -->|"routes to"| node_postdetail
node_app -->|"routes to"| node_chat
node_app -->|"renders"| node_chatbot
node_app -->|"routes to"| node_admin
node_authguard -->|"checks"| node_authstate
node_authapi -->|"reads and updates"| node_authstate
node_home -.->|"searches rooms"| node_roomapi
node_roomdetail -->|"loads room"| node_roomapi
node_landlordhouses -.->|"manages houses"| node_roomapi
node_landlordrooms -->|"manages rooms"| node_roomapi
node_landlordrooms -->|"opens manager"| node_imageupload
node_imageupload -->|"adds or deletes images"| node_roomapi
node_roomapi -->|"uses data types"| node_roomtypes
node_roomapi -->|"sends requests"| node_authapi
node_authapi -.->|"calls API"| node_backend
node_forum -->|"loads and creates posts"| node_forumapi
node_postdetail -->|"manages discussion"| node_forumapi
node_chat -->|"loads conversations"| node_chatapi
node_chat -->|"starts live messaging"| node_chatsocket
node_chatsocket -.->|"publishes and subscribes"| node_backend
node_chatbot -.->|"requests assistance"| node_backend
node_admin -->|"manages users"| node_adminapi
node_adminapi -->|"sends requests"| node_authapi
node_profile -.->|"loads profile"| node_backend

click node_app "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/App.tsx"
click node_mainlayout "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/layouts/MainLayout.tsx"
click node_dashboardlayout "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/layouts/DashboardLayout.tsx"
click node_authguard "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/components/ProtectedRoute.tsx"
click node_authstate "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/store/authStore.ts"
click node_authapi "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/axiosClient.ts"
click node_home "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/HomePage.tsx"
click node_roomdetail "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/RoomDetailPage.tsx"
click node_roomapi "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/roomApi.ts"
click node_roomtypes "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/types/room.ts"
click node_favorites "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/FavoritesPage.tsx"
click node_landlordhouses "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/dashboard/LandLordHousesPage.tsx"
click node_landlordrooms "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/dashboard/LandlordRoomsPage.tsx"
click node_imageupload "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/components/RoomImageManager.tsx"
click node_forum "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/ForumPage.tsx"
click node_postdetail "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/PostDetailPage.tsx"
click node_forumapi "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/forumApi.ts"
click node_chat "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/ChatPage.tsx"
click node_chatsocket "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/hooks/useChatSocket.ts"
click node_chatapi "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/chatApi.ts"
click node_chatbot "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/components/ChatbotWidget.tsx"
click node_admin "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/dashboard/AdminUsersPage.tsx"
click node_adminapi "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/adminApi.ts"
click node_profile "https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/ProfilePage.tsx"

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_mainlayout,node_dashboardlayout,node_authguard,node_authstate,node_authapi,node_user toneBlue
class node_home,node_roomdetail,node_roomapi,node_roomtypes,node_favorites,node_landlordhouses,node_landlordrooms,node_imageupload toneAmber
class node_forum,node_postdetail,node_forumapi,node_chat,node_chatsocket,node_chatapi,node_chatbot toneMint
class node_admin,node_adminapi,node_profile toneRose
class node_backend toneIndigo
```

## Components

### Application and access

- [Route application](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/App.tsx): `src/App.tsx`
- [Main layout](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/layouts/MainLayout.tsx): `src/layouts/MainLayout.tsx`
- [Dashboard layout](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/layouts/DashboardLayout.tsx): `src/layouts/DashboardLayout.tsx`
- [Access guards](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/components/ProtectedRoute.tsx): `src/components/ProtectedRoute.tsx`
- [Auth state](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/store/authStore.ts): `src/store/authStore.ts`
- [HTTP client](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/axiosClient.ts): `src/api/axiosClient.ts`

### Room rental

- [Room discovery](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/HomePage.tsx): `src/pages/HomePage.tsx`
- [Room details](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/RoomDetailPage.tsx): `src/pages/RoomDetailPage.tsx`
- [Room operations](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/roomApi.ts): `src/api/roomApi.ts`
- [Room data](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/types/room.ts): `src/types/room.ts`
- [Saved rooms](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/FavoritesPage.tsx): `src/pages/FavoritesPage.tsx`
- [House management](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/dashboard/LandLordHousesPage.tsx): `src/pages/dashboard/LandLordHousesPage.tsx`
- [Room management](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/dashboard/LandlordRoomsPage.tsx): `src/pages/dashboard/LandlordRoomsPage.tsx`
- [Room image manager](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/components/RoomImageManager.tsx): `src/components/RoomImageManager.tsx`

### Community features

- [Forum feed](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/ForumPage.tsx): `src/pages/ForumPage.tsx`
- [Post discussion](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/PostDetailPage.tsx): `src/pages/PostDetailPage.tsx`
- [Forum operations](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/forumApi.ts): `src/api/forumApi.ts`
- [Direct messaging](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/ChatPage.tsx): `src/pages/ChatPage.tsx`
- [Live chat socket](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/hooks/useChatSocket.ts): `src/hooks/useChatSocket.ts`
- [Chat operations](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/chatApi.ts): `src/api/chatApi.ts`
- [Room assistant](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/components/ChatbotWidget.tsx): `src/components/ChatbotWidget.tsx`

### Account and administration

- [Admin console](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/dashboard/AdminUsersPage.tsx): `src/pages/dashboard/AdminUsersPage.tsx`
- [Admin operations](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/api/adminApi.ts): `src/api/adminApi.ts`
- [User profile](https://github.com/quockhanh4551190031/boarding-home-project-intern-react-frontend/blob/main/src/pages/ProfilePage.tsx): `src/pages/ProfilePage.tsx`

### Other components

- **Visitor or user**
- **Platform backend**

## Connections

- Visitor or user → Route application: opens (evidence: `src/App.tsx`)
- Route application → Main layout: routes through (evidence: `src/App.tsx`)
- Route application → Dashboard layout: routes through (evidence: `src/App.tsx`)
- Route application → Access guards: guards routes (evidence: `src/App.tsx`)
- Route application → Room discovery: routes to (evidence: `src/App.tsx`)
- Route application → Room details: routes to (evidence: `src/App.tsx`)
- Route application → Saved rooms: routes to (evidence: `src/App.tsx`)
- Route application → House management: routes to (evidence: `src/App.tsx`)
- Route application → Room management: routes to (evidence: `src/App.tsx`)
- Route application → Forum feed: routes to (evidence: `src/App.tsx`)
- Route application → Post discussion: routes to (evidence: `src/App.tsx`)
- Route application → Direct messaging: routes to (evidence: `src/App.tsx`)
- Route application → Room assistant: renders (evidence: `src/App.tsx`)
- Route application → Admin console: routes to (evidence: `src/App.tsx`)
- Access guards → Auth state: checks (evidence: `src/components/ProtectedRoute.tsx`)
- HTTP client → Auth state: reads and updates (evidence: `src/api/axiosClient.ts`)
- Room discovery → Room operations: searches rooms
- Room details → Room operations: loads room (evidence: `src/pages/RoomDetailPage.tsx`)
- House management → Room operations: manages houses
- Room management → Room operations: manages rooms (evidence: `src/pages/dashboard/LandlordRoomsPage.tsx`)
- Room management → Room image manager: opens manager (evidence: `src/pages/dashboard/LandlordRoomsPage.tsx`)
- Room image manager → Room operations: adds or deletes images (evidence: `src/components/RoomImageManager.tsx`)
- Room operations → Room data: uses data types (evidence: `src/api/roomApi.ts`)
- Room operations → HTTP client: sends requests (evidence: `src/api/roomApi.ts`)
- HTTP client → Platform backend: calls API (evidence: `README.md`)
- Forum feed → Forum operations: loads and creates posts (evidence: `src/pages/ForumPage.tsx`)
- Post discussion → Forum operations: manages discussion (evidence: `src/pages/PostDetailPage.tsx`)
- Direct messaging → Chat operations: loads conversations (evidence: `src/pages/ChatPage.tsx`)
- Direct messaging → Live chat socket: starts live messaging (evidence: `src/pages/ChatPage.tsx`)
- Live chat socket → Platform backend: publishes and subscribes
- Room assistant → Platform backend: requests assistance
- Admin console → Admin operations: manages users (evidence: `src/pages/dashboard/AdminUsersPage.tsx`)
- Admin operations → HTTP client: sends requests (evidence: `src/api/adminApi.ts`)
- User profile → Platform backend: loads profile
