# minhthang1472/appdoctruyen architecture

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

- Interactive diagram: https://gitdiagram.com/minhthang1472/appdoctruyen
- Repository: https://github.com/minhthang1472/appdoctruyen

## Overview

NovelPortal is a mobile novel-reading and publishing product. Readers browse ranked or discovered stories, open a novel, read and download chapters, and manage a library and reading history; creators manage novels and chapters through the studio. The React Native app calls an Express API backed by MongoDB models. Authentication, ratings/comments, VIP chapter unlocking, notifications, translation, profiles, and subscriptions are represented as product capabilities, though some implementation details were not sampled. Edges are limited to relationships visible in excerpts or SOURCE INDEX references.

Main entry points: [`frontend/App.js`](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/App.js) (Navigation), [`frontend/src/utils/api.js`](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/utils/api.js) (HTTP client), [`backend/server.js`](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/server.js) (API server), [`backend/routes/novelRoutes.js`](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/novelRoutes.js) (Novel service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Mobile app"]
  node_app["Navigation<br/>[App.js]"]
  node_discovery["Browse stories<br/>[DiscoveryScreen.js]"]
  node_home["Home feed<br/>[HomeScreen.js]"]
  node_ranking["Rankings<br/>[RankingScreen.js]"]
  node_detail["Novel details"]
  node_reading["Chapter reading<br/>[ReadingScreen.js]"]
  node_library["Library<br/>[LibraryScreen.js]"]
  node_profile["Profile and history<br/>[ProfileScreen.js]"]
  node_studio["Creator studio<br/>[StudioScreen.js]"]
  node_novel_editor["Novel editing"]
  node_chapter_editor["Chapter editing"]
  node_offline["Offline downloads"]
  node_auth_ui["Account screens<br/>[SignupScreen.js]"]
  node_subscription["Subscriptions"]
  node_notifications_ui["Notifications"]
end

subgraph group_api["API services"]
  node_server["API server<br/>[server.js]"]
  node_auth_routes["Authentication<br/>[authRoutes.js]"]
  node_novel_routes["Novel service<br/>[novelRoutes.js]"]
  node_chapter_routes["Chapter service<br/>[chapterRoutes.js]"]
  node_user_routes["User service<br/>[userRoutes.js]"]
  node_notification_routes["Notification service"]
  node_translation["Translation service<br/>[translateRoutes.js]"]
end

subgraph group_domain["Novel data"]
  node_novel_model[("Novel records<br/>[Novel.js]")]
  node_chapter_model[("Chapter records<br/>[Chapter.js]")]
  node_user_model[("User records<br/>[User.js]")]
  node_review_model[("Reviews<br/>[Review.js]")]
  node_comment_model[("Comments<br/>[Comment.js]")]
  node_notification_model[("Notifications<br/>[Notification.js]")]
end

subgraph group_shared["App support"]
  node_api_client["HTTP client<br/>[api.js]"]
  node_language["Language preferences<br/>[LanguageContext.js]"]
  node_theme["Color theme<br/>[colors.js]"]
end

node_reader(("Reader"))
node_external_translator{{"Translation provider"}}

node_reader -->|"opens"| node_app
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_ranking
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_reading
node_app -->|"routes to"| node_library
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_studio
node_app -->|"routes to"| node_novel_editor
node_app -->|"routes to"| node_chapter_editor
node_app -->|"routes to"| node_offline
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_subscription
node_app -->|"routes to"| node_notifications_ui
node_discovery -->|"requests data"| node_api_client
node_home -->|"requests data"| node_api_client
node_ranking -->|"requests data"| node_api_client
node_detail -->|"requests data"| node_api_client
node_reading -->|"requests data"| node_api_client
node_library -->|"requests data"| node_api_client
node_profile -->|"requests data"| node_api_client
node_studio -.->|"requests data"| node_api_client
node_novel_editor -->|"submits novels"| node_api_client
node_chapter_editor -->|"submits chapters"| node_api_client
node_offline -->|"downloads chapters"| node_api_client
node_auth_ui -.->|"authenticates"| node_api_client
node_subscription -.->|"requests service"| node_api_client
node_notifications_ui -.->|"requests service"| node_api_client
node_app -->|"provides language"| node_language
node_app -->|"uses colors"| node_theme
node_api_client -.->|"sends HTTP"| node_server
node_server -->|"mounts routes"| node_novel_routes
node_server -->|"mounts routes"| node_chapter_routes
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"mounts routes"| node_user_routes
node_server -->|"mounts routes"| node_notification_routes
node_server -->|"mounts routes"| node_translation
node_novel_routes -->|"reads writes"| node_novel_model
node_novel_routes -->|"reads writes"| node_review_model
node_novel_routes -->|"reads writes"| node_comment_model
node_novel_routes -->|"deletes chapters"| node_chapter_model
node_novel_routes -->|"looks up uploader"| node_user_model
node_chapter_routes -->|"reads writes"| node_chapter_model
node_chapter_routes -->|"checks novel"| node_novel_model
node_chapter_routes -->|"checks access"| node_user_model
node_auth_routes -->|"authenticates users"| node_user_model
node_user_routes -->|"reads writes"| node_user_model

click node_app "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/App.js"
click node_discovery "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/DiscoveryScreen.js"
click node_home "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/HomeScreen.js"
click node_ranking "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/RankingScreen.js"
click node_detail "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/NovelDetailScreen.js"
click node_reading "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/ReadingScreen.js"
click node_library "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/LibraryScreen.js"
click node_profile "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/ProfileScreen.js"
click node_studio "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/StudioScreen.js"
click node_novel_editor "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/CreateNovelScreen.js"
click node_chapter_editor "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/CreateChapterScreen.js"
click node_offline "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/DownloadedSeriesScreen.js"
click node_auth_ui "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/SignupScreen.js"
click node_subscription "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/SubscriptionScreen.js"
click node_notifications_ui "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/NotificationsScreen.js"
click node_api_client "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/utils/api.js"
click node_language "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/context/LanguageContext.js"
click node_theme "https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/theme/colors.js"
click node_server "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/server.js"
click node_auth_routes "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/authRoutes.js"
click node_novel_routes "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/novelRoutes.js"
click node_chapter_routes "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/chapterRoutes.js"
click node_user_routes "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/userRoutes.js"
click node_notification_routes "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/notificationRoutes.js"
click node_translation "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/translateRoutes.js"
click node_novel_model "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Novel.js"
click node_chapter_model "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Chapter.js"
click node_user_model "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/User.js"
click node_review_model "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Review.js"
click node_comment_model "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Comment.js"
click node_notification_model "https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Notification.js"

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_discovery,node_home,node_ranking,node_detail,node_reading,node_library,node_profile,node_studio,node_novel_editor,node_chapter_editor,node_offline,node_auth_ui,node_subscription,node_notifications_ui toneBlue
class node_server,node_auth_routes,node_novel_routes,node_chapter_routes,node_user_routes,node_notification_routes,node_translation toneAmber
class node_novel_model,node_chapter_model,node_user_model,node_review_model,node_comment_model,node_notification_model toneMint
class node_api_client,node_language,node_theme toneRose
class node_reader,node_external_translator toneIndigo
```

## Components

### Mobile app

- [Navigation](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/App.js): `frontend/App.js`
- [Browse stories](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/DiscoveryScreen.js): `frontend/src/screens/DiscoveryScreen.js`
- [Home feed](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/HomeScreen.js): `frontend/src/screens/HomeScreen.js`
- [Rankings](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/RankingScreen.js): `frontend/src/screens/RankingScreen.js`
- [Novel details](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/NovelDetailScreen.js): `frontend/src/screens/NovelDetailScreen.js`
- [Chapter reading](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/ReadingScreen.js): `frontend/src/screens/ReadingScreen.js`
- [Library](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/LibraryScreen.js): `frontend/src/screens/LibraryScreen.js`
- [Profile and history](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/ProfileScreen.js): `frontend/src/screens/ProfileScreen.js`
- [Creator studio](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/StudioScreen.js): `frontend/src/screens/StudioScreen.js`
- [Novel editing](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/CreateNovelScreen.js): `frontend/src/screens/CreateNovelScreen.js`
- [Chapter editing](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/CreateChapterScreen.js): `frontend/src/screens/CreateChapterScreen.js`
- [Offline downloads](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/DownloadedSeriesScreen.js): `frontend/src/screens/DownloadedSeriesScreen.js`
- [Account screens](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/SignupScreen.js): `frontend/src/screens/SignupScreen.js`
- [Subscriptions](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/SubscriptionScreen.js): `frontend/src/screens/SubscriptionScreen.js`
- [Notifications](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/screens/NotificationsScreen.js): `frontend/src/screens/NotificationsScreen.js`

### API services

- [API server](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Novel service](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/novelRoutes.js): `backend/routes/novelRoutes.js`
- [Chapter service](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/chapterRoutes.js): `backend/routes/chapterRoutes.js`
- [User service](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/userRoutes.js): `backend/routes/userRoutes.js`
- [Notification service](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/notificationRoutes.js): `backend/routes/notificationRoutes.js`
- [Translation service](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/routes/translateRoutes.js): `backend/routes/translateRoutes.js`

### Novel data

- [Novel records](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Novel.js): `backend/models/Novel.js`
- [Chapter records](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Chapter.js): `backend/models/Chapter.js`
- [User records](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/User.js): `backend/models/User.js`
- [Reviews](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Review.js): `backend/models/Review.js`
- [Comments](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Comment.js): `backend/models/Comment.js`
- [Notifications](https://github.com/minhthang1472/appdoctruyen/blob/main/backend/models/Notification.js): `backend/models/Notification.js`

### App support

- [HTTP client](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`
- [Language preferences](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/context/LanguageContext.js): `frontend/src/context/LanguageContext.js`
- [Color theme](https://github.com/minhthang1472/appdoctruyen/blob/main/frontend/src/theme/colors.js): `frontend/src/theme/colors.js`

### Other components

- **Reader**
- **Translation provider**

## Connections

- Reader → Navigation: opens (evidence: `frontend/App.js`)
- Navigation → Browse stories: routes to (evidence: `frontend/App.js`)
- Navigation → Home feed: routes to (evidence: `frontend/App.js`)
- Navigation → Rankings: routes to (evidence: `frontend/App.js`)
- Navigation → Novel details: routes to (evidence: `frontend/App.js`)
- Navigation → Chapter reading: routes to (evidence: `frontend/App.js`)
- Navigation → Library: routes to (evidence: `frontend/App.js`)
- Navigation → Profile and history: routes to (evidence: `frontend/App.js`)
- Navigation → Creator studio: routes to (evidence: `frontend/App.js`)
- Navigation → Novel editing: routes to (evidence: `frontend/App.js`)
- Navigation → Chapter editing: routes to (evidence: `frontend/App.js`)
- Navigation → Offline downloads: routes to (evidence: `frontend/App.js`)
- Navigation → Account screens: routes to (evidence: `frontend/App.js`)
- Navigation → Subscriptions: routes to (evidence: `frontend/App.js`)
- Navigation → Notifications: routes to (evidence: `frontend/App.js`)
- Browse stories → HTTP client: requests data (evidence: `frontend/src/screens/DiscoveryScreen.js`)
- Home feed → HTTP client: requests data (evidence: `frontend/src/screens/HomeScreen.js`)
- Rankings → HTTP client: requests data (evidence: `frontend/src/screens/RankingScreen.js`)
- Novel details → HTTP client: requests data (evidence: `frontend/src/screens/NovelDetailScreen.js`)
- Chapter reading → HTTP client: requests data (evidence: `frontend/src/screens/ReadingScreen.js`)
- Library → HTTP client: requests data (evidence: `frontend/src/screens/LibraryScreen.js`)
- Profile and history → HTTP client: requests data (evidence: `frontend/src/screens/ProfileScreen.js`)
- Creator studio → HTTP client: requests data
- Novel editing → HTTP client: submits novels (evidence: `frontend/src/screens/CreateNovelScreen.js`)
- Chapter editing → HTTP client: submits chapters (evidence: `frontend/src/screens/CreateChapterScreen.js`)
- Offline downloads → HTTP client: downloads chapters (evidence: `frontend/src/screens/DownloadedSeriesScreen.js`)
- Account screens → HTTP client: authenticates (evidence: `frontend/src/screens/SignupScreen.js`)
- Subscriptions → HTTP client: requests service
- Notifications → HTTP client: requests service
- Navigation → Language preferences: provides language (evidence: `frontend/App.js`)
- Navigation → Color theme: uses colors (evidence: `frontend/App.js`)
- HTTP client → API server: sends HTTP
- API server → Novel service: mounts routes (evidence: `backend/server.js`)
- API server → Chapter service: mounts routes (evidence: `backend/server.js`)
- API server → Authentication: mounts routes (evidence: `backend/server.js`)
- API server → User service: mounts routes (evidence: `backend/server.js`)
- API server → Notification service: mounts routes (evidence: `backend/server.js`)
- API server → Translation service: mounts routes (evidence: `backend/server.js`)
- Novel service → Novel records: reads writes (evidence: `backend/routes/novelRoutes.js`)
- Novel service → Reviews: reads writes (evidence: `backend/routes/novelRoutes.js`)
- Novel service → Comments: reads writes (evidence: `backend/routes/novelRoutes.js`)
- Novel service → Chapter records: deletes chapters (evidence: `backend/routes/novelRoutes.js`)
- Novel service → User records: looks up uploader (evidence: `backend/routes/novelRoutes.js`)
- Chapter service → Chapter records: reads writes (evidence: `backend/routes/chapterRoutes.js`)
- Chapter service → Novel records: checks novel (evidence: `backend/routes/chapterRoutes.js`)
- Chapter service → User records: checks access (evidence: `backend/routes/chapterRoutes.js`)
- Authentication → User records: authenticates users (evidence: `backend/routes/authRoutes.js`)
- User service → User records: reads writes (evidence: `backend/routes/userRoutes.js`)
