# battleislife/laravel_project_cuoiki architecture

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

- Interactive diagram: https://gitdiagram.com/battleislife/laravel_project_cuoiki
- Repository: https://github.com/battleislife/laravel_project_cuoiki

## Overview

This Laravel application is a Vietnamese fiction-reading and publishing site with separate user and moderator roles. Readers browse fiction and series, read posted chapters, comment, and like or vote; authors manage fiction, chapters, and series; moderators manage users and content and publish posts. The graph shows documented route dispatch, controller-to-model usage, and startup middleware registration. Views are present in the tree, but the excerpts do not establish their controller wiring; several controller relationships come from the SOURCE INDEX rather than inspected method bodies.

Main entry points: [`routes/web.php`](https://github.com/battleislife/laravel_project_cuoiki/blob/main/routes/web.php) (Web routes), [`app/Models`](https://github.com/battleislife/laravel_project_cuoiki/tree/main/app/Models) (Story data), [`app/Http/Controllers/Moderator/ManagmentController.php`](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Moderator/ManagmentController.php) (Moderator management), [`app/Models/User.php`](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Models/User.php) (User and engagement data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry"]
  node_routes["Web routes<br/>[web.php]"]
  node_startup["App startup<br/>[app.php]"]
  node_user_middleware["User access checks"]
  node_guest_middleware["Guest checks<br/>[CheckUserGuest.php]"]
end

subgraph group_reader["Reader experience"]
  node_user_auth["User authentication<br/>[AuthController.php]"]
  node_home["Home and discovery<br/>[HomeController.php]"]
  node_fiction_read["Fiction browsing"]
  node_chapter_read["Chapter reading"]
  node_series_read["Series browsing"]
  node_comments["Comments"]
  node_interactions["Likes and votes"]
  node_profile["User profile"]
  node_user_data[("User and engagement data<br/>[User.php]")]
end

subgraph group_publishing["Author publishing"]
  node_author_fiction["Fiction authoring"]
  node_author_chapter["Chapter authoring"]
  node_author_series["Series authoring"]
  node_story_data[("Story data")]
end

subgraph group_moderation["Moderation"]
  node_moderator_auth["Moderator authentication"]
  node_moderator_manage["Moderator management"]
  node_moderator_posts["Moderator posts<br/>[PostController.php]"]
  node_moderator_data[("Moderator data<br/>[Moderator.php]")]
end

node_visitor(("Visitor"))

node_visitor -->|"requests pages"| node_routes
node_routes -->|"dispatches auth"| node_user_auth
node_routes -->|"dispatches home"| node_home
node_routes -->|"dispatches fiction"| node_fiction_read
node_routes -->|"dispatches chapters"| node_chapter_read
node_routes -->|"dispatches series"| node_series_read
node_routes -->|"dispatches comments"| node_comments
node_routes -->|"dispatches interactions"| node_interactions
node_routes -->|"dispatches profile"| node_profile
node_routes -->|"dispatches authoring"| node_author_fiction
node_routes -->|"dispatches authoring"| node_author_chapter
node_routes -->|"dispatches authoring"| node_author_series
node_routes -->|"dispatches moderator auth"| node_moderator_auth
node_routes -->|"dispatches management"| node_moderator_manage
node_routes -->|"dispatches posts"| node_moderator_posts
node_startup -->|"loads routes"| node_routes
node_startup -->|"registers middleware"| node_user_middleware
node_startup -->|"registers middleware"| node_guest_middleware
node_user_auth -->|"uses accounts"| node_user_data
node_home -->|"reads accounts"| node_user_data
node_home -->|"reads stories"| node_story_data
node_fiction_read -->|"reads fiction"| node_story_data
node_chapter_read -->|"reads chapters"| node_story_data
node_comments -->|"uses story comments"| node_story_data
node_comments -->|"uses post comments"| node_moderator_data
node_interactions -->|"validates targets"| node_story_data
node_interactions -->|"records votes"| node_user_data
node_profile -->|"reads author stories"| node_story_data
node_author_fiction -->|"manages fiction"| node_story_data
node_author_chapter -->|"manages chapters"| node_story_data
node_author_series -->|"manages series"| node_story_data
node_series_read -->|"reads series"| node_story_data
node_moderator_auth -->|"authenticates moderators"| node_moderator_data
node_moderator_manage -->|"manages moderators"| node_moderator_data
node_moderator_manage -->|"moderates stories"| node_story_data
node_moderator_manage -->|"manages users"| node_user_data
node_moderator_posts -->|"manages posts"| node_moderator_data

click node_routes "https://github.com/battleislife/laravel_project_cuoiki/blob/main/routes/web.php"
click node_startup "https://github.com/battleislife/laravel_project_cuoiki/blob/main/bootstrap/app.php"
click node_user_auth "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/AuthController.php"
click node_home "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/HomeController.php"
click node_fiction_read "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/FictionController.php"
click node_chapter_read "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/ChapterController.php"
click node_series_read "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/SeriesController.php"
click node_comments "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/CommentController.php"
click node_interactions "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/InteractionController.php"
click node_profile "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/ProfileController.php"
click node_user_middleware "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Middleware/AuthenticateUser.php"
click node_guest_middleware "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Middleware/CheckUserGuest.php"
click node_author_fiction "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Author/AuthorFictionController.php"
click node_author_chapter "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Author/AuthorChapterController.php"
click node_author_series "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Author/AuthorSeriesController.php"
click node_story_data "https://github.com/battleislife/laravel_project_cuoiki/tree/main/app/Models"
click node_moderator_auth "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Moderator/ModeratorAuthController.php"
click node_moderator_manage "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Moderator/ManagmentController.php"
click node_moderator_posts "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Moderator/PostController.php"
click node_moderator_data "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Models/Moderator.php"
click node_user_data "https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Models/User.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_routes,node_startup,node_user_middleware,node_guest_middleware toneBlue
class node_user_auth,node_home,node_fiction_read,node_chapter_read,node_series_read,node_comments,node_interactions,node_profile,node_user_data toneAmber
class node_author_fiction,node_author_chapter,node_author_series,node_story_data toneMint
class node_moderator_auth,node_moderator_manage,node_moderator_posts,node_moderator_data toneRose
class node_visitor toneIndigo
```

## Components

### Web entry

- [Web routes](https://github.com/battleislife/laravel_project_cuoiki/blob/main/routes/web.php): `routes/web.php`
- [App startup](https://github.com/battleislife/laravel_project_cuoiki/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [User access checks](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Middleware/AuthenticateUser.php): `app/Http/Middleware/AuthenticateUser.php`
- [Guest checks](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Middleware/CheckUserGuest.php): `app/Http/Middleware/CheckUserGuest.php`

### Reader experience

- [User authentication](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Home and discovery](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/HomeController.php): `app/Http/Controllers/HomeController.php`
- [Fiction browsing](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/FictionController.php): `app/Http/Controllers/FictionController.php`
- [Chapter reading](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/ChapterController.php): `app/Http/Controllers/ChapterController.php`
- [Series browsing](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/SeriesController.php): `app/Http/Controllers/SeriesController.php`
- [Comments](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/CommentController.php): `app/Http/Controllers/CommentController.php`
- [Likes and votes](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/InteractionController.php): `app/Http/Controllers/InteractionController.php`
- [User profile](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/ProfileController.php): `app/Http/Controllers/ProfileController.php`
- [User and engagement data](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Models/User.php): `app/Models/User.php`

### Author publishing

- [Fiction authoring](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Author/AuthorFictionController.php): `app/Http/Controllers/Author/AuthorFictionController.php`
- [Chapter authoring](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Author/AuthorChapterController.php): `app/Http/Controllers/Author/AuthorChapterController.php`
- [Series authoring](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Author/AuthorSeriesController.php): `app/Http/Controllers/Author/AuthorSeriesController.php`
- [Story data](https://github.com/battleislife/laravel_project_cuoiki/tree/main/app/Models): `app/Models`

### Moderation

- [Moderator authentication](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Moderator/ModeratorAuthController.php): `app/Http/Controllers/Moderator/ModeratorAuthController.php`
- [Moderator management](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Moderator/ManagmentController.php): `app/Http/Controllers/Moderator/ManagmentController.php`
- [Moderator posts](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Http/Controllers/Moderator/PostController.php): `app/Http/Controllers/Moderator/PostController.php`
- [Moderator data](https://github.com/battleislife/laravel_project_cuoiki/blob/main/app/Models/Moderator.php): `app/Models/Moderator.php`

### Other components

- **Visitor**

## Connections

- Visitor → Web routes: requests pages (evidence: `routes/web.php`)
- Web routes → User authentication: dispatches auth (evidence: `routes/web.php`)
- Web routes → Home and discovery: dispatches home (evidence: `routes/web.php`)
- Web routes → Fiction browsing: dispatches fiction (evidence: `routes/web.php`)
- Web routes → Chapter reading: dispatches chapters (evidence: `routes/web.php`)
- Web routes → Series browsing: dispatches series (evidence: `routes/web.php`)
- Web routes → Comments: dispatches comments (evidence: `routes/web.php`)
- Web routes → Likes and votes: dispatches interactions (evidence: `routes/web.php`)
- Web routes → User profile: dispatches profile (evidence: `routes/web.php`)
- Web routes → Fiction authoring: dispatches authoring (evidence: `routes/web.php`)
- Web routes → Chapter authoring: dispatches authoring (evidence: `routes/web.php`)
- Web routes → Series authoring: dispatches authoring (evidence: `routes/web.php`)
- Web routes → Moderator authentication: dispatches moderator auth (evidence: `routes/web.php`)
- Web routes → Moderator management: dispatches management (evidence: `routes/web.php`)
- Web routes → Moderator posts: dispatches posts (evidence: `routes/web.php`)
- App startup → Web routes: loads routes (evidence: `bootstrap/app.php`)
- App startup → User access checks: registers middleware (evidence: `bootstrap/app.php`)
- App startup → Guest checks: registers middleware (evidence: `bootstrap/app.php`)
- User authentication → User and engagement data: uses accounts (evidence: `app/Http/Controllers/AuthController.php`)
- Home and discovery → User and engagement data: reads accounts (evidence: `app/Http/Controllers/HomeController.php`)
- Home and discovery → Story data: reads stories (evidence: `app/Http/Controllers/HomeController.php`)
- Fiction browsing → Story data: reads fiction (evidence: `app/Http/Controllers/FictionController.php`)
- Chapter reading → Story data: reads chapters (evidence: `app/Http/Controllers/ChapterController.php`)
- Comments → Story data: uses story comments (evidence: `app/Http/Controllers/CommentController.php`)
- Comments → Moderator data: uses post comments (evidence: `app/Http/Controllers/CommentController.php`)
- Likes and votes → Story data: validates targets (evidence: `app/Http/Controllers/InteractionController.php`)
- Likes and votes → User and engagement data: records votes (evidence: `app/Http/Controllers/InteractionController.php`)
- User profile → Story data: reads author stories (evidence: `app/Http/Controllers/ProfileController.php`)
- Fiction authoring → Story data: manages fiction (evidence: `app/Http/Controllers/Author/AuthorFictionController.php`)
- Chapter authoring → Story data: manages chapters (evidence: `app/Http/Controllers/Author/AuthorChapterController.php`)
- Series authoring → Story data: manages series (evidence: `app/Http/Controllers/Author/AuthorSeriesController.php`)
- Series browsing → Story data: reads series (evidence: `app/Http/Controllers/SeriesController.php`)
- Moderator authentication → Moderator data: authenticates moderators (evidence: `app/Http/Controllers/Moderator/ModeratorAuthController.php`)
- Moderator management → Moderator data: manages moderators (evidence: `app/Http/Controllers/Moderator/ManagmentController.php`)
- Moderator management → Story data: moderates stories (evidence: `app/Http/Controllers/Moderator/ManagmentController.php`)
- Moderator management → User and engagement data: manages users (evidence: `app/Http/Controllers/Moderator/ManagmentController.php`)
- Moderator posts → Moderator data: manages posts (evidence: `app/Http/Controllers/Moderator/PostController.php`)
