# congle0707/truyenhub_fe architecture

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

- Interactive diagram: https://gitdiagram.com/congle0707/truyenhub_fe
- Repository: https://github.com/congle0707/truyenhub_fe

## Overview

TruyenHub is a React reading platform for comics and text stories, with authentication, chapter reading, ratings, comments, and an administrator console for managing catalog content. The principal workflow is: a reader enters the routed app, browses or opens a title, selects a chapter, and reads it; authenticated readers can rate and comment. Administrators authenticate separately and manage authors, categories, titles, and chapters. The graph reflects sampled calls and routing; several page/API relationships remain intentionally unwired where source excerpts were not provided.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Experience"]
  node_app["Route App<br/>[App.tsx]"]
  node_auth_page["Auth Page<br/>[AuthPage.tsx]"]
  node_home_page["Home Page<br/>[HomePage.tsx]"]
  node_auth_form["Auth Form<br/>[AuthForm.tsx]"]
end

subgraph group_reading["Reading Community"]
  node_comic_detail["Comic Details"]
  node_story_detail["Story Details"]
  node_comic_read["Comic Reader<br/>[ComicReadPage.tsx]"]
  node_story_read["Story Reader<br/>[StoryReadPage.tsx]"]
  node_comments["Comment Section<br/>[CommentSection.tsx]"]
  node_star_rating["Star Rating<br/>[StarRating.tsx]"]
end

subgraph group_admin["Admin Console"]
  node_admin_layout["Admin Layout<br/>[AdminLayout.tsx]"]
  node_admin_dashboard["Admin Dashboard<br/>[AdminDashboard.tsx]"]
  node_manage_categories["Manage Categories"]
  node_manage_authors["Manage Authors"]
  node_manage_comics["Manage Comics"]
  node_manage_comic_chapters["Comic Chapters"]
  node_manage_stories["Manage Stories"]
  node_manage_story_chapters["Story Chapters"]
end

subgraph group_integration["API Integration"]
  node_auth_api["Auth API<br/>[auth.ts]"]
  node_story_api["Story API<br/>[story.ts]"]
  node_comment_api["Comment API<br/>[comment.ts]"]
  node_comic_api["Comic API<br/>[comic.ts]"]
  node_admin_api["Admin API<br/>[admin.ts]"]
end

node_reader(("Reader"))
node_administrator(("Administrator"))
node_backend["Backend API"]

node_reader -->|"opens app"| node_app
node_administrator -->|"opens console"| node_app
node_app -->|"routes login"| node_auth_page
node_app -->|"routes home"| node_home_page
node_app -->|"routes comics"| node_comic_detail
node_app -->|"routes stories"| node_story_detail
node_app -->|"routes chapters"| node_comic_read
node_app -->|"routes chapters"| node_story_read
node_app -->|"routes admin"| node_admin_layout
node_auth_page -->|"renders form"| node_auth_form
node_auth_form -->|"submits credentials"| node_auth_api
node_auth_api -->|"requests auth"| node_backend
node_story_detail -->|"fetches details"| node_story_api
node_story_detail -->|"renders rating"| node_star_rating
node_story_detail -->|"renders comments"| node_comments
node_comments -->|"loads comments"| node_comment_api
node_manage_authors -->|"manages authors"| node_admin_api
node_admin_api -->|"requests administration"| node_backend

click node_app "https://github.com/congle0707/truyenhub_fe/blob/main/src/App.tsx"
click node_auth_page "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/AuthPage.tsx"
click node_home_page "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/HomePage.tsx"
click node_comic_detail "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/ComicDetailPage.tsx"
click node_story_detail "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/StoryDetailPage.tsx"
click node_comic_read "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/ComicReadPage.tsx"
click node_story_read "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/StoryReadPage.tsx"
click node_auth_form "https://github.com/congle0707/truyenhub_fe/blob/main/src/components/AuthForm.tsx"
click node_comments "https://github.com/congle0707/truyenhub_fe/blob/main/src/components/CommentSection.tsx"
click node_star_rating "https://github.com/congle0707/truyenhub_fe/blob/main/src/components/StarRating.tsx"
click node_admin_layout "https://github.com/congle0707/truyenhub_fe/blob/main/src/components/admin/AdminLayout.tsx"
click node_admin_dashboard "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/AdminDashboard.tsx"
click node_manage_categories "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageCategoriesPage.tsx"
click node_manage_authors "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageAuthorsPage.tsx"
click node_manage_comics "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageComicsPage.tsx"
click node_manage_comic_chapters "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageComicChaptersPage.tsx"
click node_manage_stories "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageStoriesPage.tsx"
click node_manage_story_chapters "https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageStoryChaptersPage.tsx"
click node_auth_api "https://github.com/congle0707/truyenhub_fe/blob/main/src/api/auth.ts"
click node_story_api "https://github.com/congle0707/truyenhub_fe/blob/main/src/api/story.ts"
click node_comment_api "https://github.com/congle0707/truyenhub_fe/blob/main/src/api/comment.ts"
click node_comic_api "https://github.com/congle0707/truyenhub_fe/blob/main/src/api/comic.ts"
click node_admin_api "https://github.com/congle0707/truyenhub_fe/blob/main/src/api/admin.ts"

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_auth_page,node_home_page,node_auth_form toneBlue
class node_comic_detail,node_story_detail,node_comic_read,node_story_read,node_comments,node_star_rating toneAmber
class node_admin_layout,node_admin_dashboard,node_manage_categories,node_manage_authors,node_manage_comics,node_manage_comic_chapters,node_manage_stories,node_manage_story_chapters,node_backend toneMint
class node_auth_api,node_story_api,node_comment_api,node_comic_api,node_admin_api toneRose
class node_reader,node_administrator toneIndigo
```

## Components

### Public Experience

- [Route App](https://github.com/congle0707/truyenhub_fe/blob/main/src/App.tsx): `src/App.tsx`
- [Auth Page](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/AuthPage.tsx): `src/pages/AuthPage.tsx`
- [Home Page](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/HomePage.tsx): `src/pages/HomePage.tsx`
- [Auth Form](https://github.com/congle0707/truyenhub_fe/blob/main/src/components/AuthForm.tsx): `src/components/AuthForm.tsx`

### Reading Community

- [Comic Details](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/ComicDetailPage.tsx): `src/pages/ComicDetailPage.tsx`
- [Story Details](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/StoryDetailPage.tsx): `src/pages/StoryDetailPage.tsx`
- [Comic Reader](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/ComicReadPage.tsx): `src/pages/ComicReadPage.tsx`
- [Story Reader](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/StoryReadPage.tsx): `src/pages/StoryReadPage.tsx`
- [Comment Section](https://github.com/congle0707/truyenhub_fe/blob/main/src/components/CommentSection.tsx): `src/components/CommentSection.tsx`
- [Star Rating](https://github.com/congle0707/truyenhub_fe/blob/main/src/components/StarRating.tsx): `src/components/StarRating.tsx`

### Admin Console

- [Admin Layout](https://github.com/congle0707/truyenhub_fe/blob/main/src/components/admin/AdminLayout.tsx): `src/components/admin/AdminLayout.tsx`
- [Admin Dashboard](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/AdminDashboard.tsx): `src/pages/admin/AdminDashboard.tsx`
- [Manage Categories](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageCategoriesPage.tsx): `src/pages/admin/ManageCategoriesPage.tsx`
- [Manage Authors](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageAuthorsPage.tsx): `src/pages/admin/ManageAuthorsPage.tsx`
- [Manage Comics](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageComicsPage.tsx): `src/pages/admin/ManageComicsPage.tsx`
- [Comic Chapters](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageComicChaptersPage.tsx): `src/pages/admin/ManageComicChaptersPage.tsx`
- [Manage Stories](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageStoriesPage.tsx): `src/pages/admin/ManageStoriesPage.tsx`
- [Story Chapters](https://github.com/congle0707/truyenhub_fe/blob/main/src/pages/admin/ManageStoryChaptersPage.tsx): `src/pages/admin/ManageStoryChaptersPage.tsx`

### API Integration

- [Auth API](https://github.com/congle0707/truyenhub_fe/blob/main/src/api/auth.ts): `src/api/auth.ts`
- [Story API](https://github.com/congle0707/truyenhub_fe/blob/main/src/api/story.ts): `src/api/story.ts`
- [Comment API](https://github.com/congle0707/truyenhub_fe/blob/main/src/api/comment.ts): `src/api/comment.ts`
- [Comic API](https://github.com/congle0707/truyenhub_fe/blob/main/src/api/comic.ts): `src/api/comic.ts`
- [Admin API](https://github.com/congle0707/truyenhub_fe/blob/main/src/api/admin.ts): `src/api/admin.ts`

### Other components

- **Reader**
- **Administrator**
- **Backend API**

## Connections

- Reader → Route App: opens app
- Administrator → Route App: opens console
- Route App → Auth Page: routes login
- Route App → Home Page: routes home
- Route App → Comic Details: routes comics
- Route App → Story Details: routes stories
- Route App → Comic Reader: routes chapters
- Route App → Story Reader: routes chapters
- Route App → Admin Layout: routes admin
- Auth Page → Auth Form: renders form
- Auth Form → Auth API: submits credentials
- Auth API → Backend API: requests auth
- Story Details → Story API: fetches details
- Story Details → Star Rating: renders rating
- Story Details → Comment Section: renders comments
- Comment Section → Comment API: loads comments
- Manage Authors → Admin API: manages authors
- Admin API → Backend API: requests administration
