# chenphxx/phxxblog architecture

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

- Interactive diagram: https://gitdiagram.com/chenphxx/phxxblog
- Repository: https://github.com/chenphxx/phxxblog

## Overview

phxxblog is a personal blog with a Vue reader/admin interface and a FastAPI backend. Visitors browse published posts, archives, search, comments, and diary entries; signed-in users and administrators manage content and site features. The backend assembles module routes, applies authentication and permissions, and persists domain data in MySQL. The README documents the frontend-to-backend development proxy; some feature-specific wiring is not shown in the sampled excerpts, so those connections are omitted or marked unverified.

Main entry points: [`backend/app/core/database.py`](https://github.com/chenphxx/phxxblog/blob/main/backend/app/core/database.py) (MySQL persistence), [`backend/app/modules/posts/router.py`](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/posts/router.py) (Post management), [`backend/app/main.py`](https://github.com/chenphxx/phxxblog/blob/main/backend/app/main.py) (FastAPI entry), [`frontend/src/App.vue`](https://github.com/chenphxx/phxxblog/blob/main/frontend/src/App.vue) (Blog interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_web_app["Blog interface<br/>[App.vue]"]
  node_web_router["Page routing<br/>[index.ts]"]
  node_api_client["API client<br/>[index.ts]"]
end

subgraph group_backend["API runtime"]
  node_backend_entry["FastAPI entry<br/>[main.py]"]
  node_module_router["Module routing<br/>[router.py]"]
  node_module_registry["Feature registry<br/>[registry.py]"]
  node_access_control["Identity and access<br/>[deps.py]"]
  node_database[("MySQL persistence<br/>[database.py]")]
end

subgraph group_content["Content features"]
  node_post_api["Post management<br/>[router.py]"]
  node_post_queries["Post queries<br/>[post_query.py]"]
  node_diary_api["Diary management<br/>[router.py]"]
  node_import_flow["Archive import<br/>[import_pipeline.py]"]
  node_comments_api["Comments<br/>[router.py]"]
  node_taxonomy_api["Categories and tags"]
  node_search_api["Search"]
  node_media_api["Media uploads"]
end

subgraph group_operations["Administration"]
  node_stats_api["Analytics and stats<br/>[router.py]"]
  node_admin_api["Admin dashboard<br/>[router.py]"]
  node_settings_api["Site settings<br/>[router.py]"]
  node_module_admin["Feature controls<br/>[router.py]"]
  node_syndication["RSS and SEO"]
  node_operation_logs["Operation logs<br/>[log.py]"]
end

node_visitor(("Visitor"))
node_administrator(("Administrator"))

node_visitor -->|"browses"| node_web_app
node_administrator -->|"manages site"| node_web_app
node_web_app -->|"loads routes"| node_web_router
node_web_app -.->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_backend_entry
node_backend_entry -->|"mounts routes"| node_module_router
node_backend_entry -->|"builds registry"| node_module_registry
node_module_router -->|"uses registry"| node_module_registry
node_backend_entry -->|"checks schema"| node_database
node_post_api -->|"queries posts"| node_post_queries
node_post_api -->|"reads and writes"| node_database
node_post_api -->|"imports archives"| node_import_flow
node_diary_api -->|"imports diaries"| node_import_flow
node_import_flow -->|"records imports"| node_operation_logs
node_comments_api -->|"reads and writes"| node_database
node_stats_api -->|"queries metrics"| node_database
node_admin_api -.->|"displays trends"| node_stats_api
node_module_admin -->|"manages features"| node_module_registry
node_post_api -->|"logs actions"| node_operation_logs
node_diary_api -->|"reads and writes"| node_database
node_taxonomy_api -.->|"stores taxonomy"| node_database
node_search_api -.->|"searches content"| node_database
node_media_api -.->|"tracks media"| node_database
node_settings_api -.->|"stores settings"| node_database
node_syndication -.->|"publishes content"| node_database

click node_web_app "https://github.com/chenphxx/phxxblog/blob/main/frontend/src/App.vue"
click node_web_router "https://github.com/chenphxx/phxxblog/blob/main/frontend/src/router/index.ts"
click node_api_client "https://github.com/chenphxx/phxxblog/blob/main/frontend/src/api/index.ts"
click node_backend_entry "https://github.com/chenphxx/phxxblog/blob/main/backend/app/main.py"
click node_module_router "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/router.py"
click node_module_registry "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/registry.py"
click node_access_control "https://github.com/chenphxx/phxxblog/blob/main/backend/app/core/deps.py"
click node_database "https://github.com/chenphxx/phxxblog/blob/main/backend/app/core/database.py"
click node_post_api "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/posts/router.py"
click node_post_queries "https://github.com/chenphxx/phxxblog/blob/main/backend/app/services/post_query.py"
click node_diary_api "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/diary/router.py"
click node_import_flow "https://github.com/chenphxx/phxxblog/blob/main/backend/app/services/import_pipeline.py"
click node_comments_api "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/comments/router.py"
click node_taxonomy_api "https://github.com/chenphxx/phxxblog/tree/main/backend/app/modules/taxonomy"
click node_search_api "https://github.com/chenphxx/phxxblog/tree/main/backend/app/modules/search"
click node_media_api "https://github.com/chenphxx/phxxblog/tree/main/backend/app/modules/media"
click node_stats_api "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/stats/router.py"
click node_admin_api "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/dashboard/router.py"
click node_settings_api "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/settings/router.py"
click node_module_admin "https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/modules/router.py"
click node_syndication "https://github.com/chenphxx/phxxblog/tree/main/backend/app/modules/rss"
click node_operation_logs "https://github.com/chenphxx/phxxblog/blob/main/backend/app/services/log.py"

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_web_app,node_web_router,node_api_client toneBlue
class node_backend_entry,node_module_router,node_module_registry,node_access_control,node_database toneAmber
class node_post_api,node_post_queries,node_diary_api,node_import_flow,node_comments_api,node_taxonomy_api,node_search_api,node_media_api toneMint
class node_stats_api,node_admin_api,node_settings_api,node_module_admin,node_syndication,node_operation_logs toneRose
class node_visitor,node_administrator toneIndigo
```

## Components

### Web interface

- [Blog interface](https://github.com/chenphxx/phxxblog/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Page routing](https://github.com/chenphxx/phxxblog/blob/main/frontend/src/router/index.ts): `frontend/src/router/index.ts`
- [API client](https://github.com/chenphxx/phxxblog/blob/main/frontend/src/api/index.ts): `frontend/src/api/index.ts`

### API runtime

- [FastAPI entry](https://github.com/chenphxx/phxxblog/blob/main/backend/app/main.py): `backend/app/main.py`
- [Module routing](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/router.py): `backend/app/modules/router.py`
- [Feature registry](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/registry.py): `backend/app/modules/registry.py`
- [Identity and access](https://github.com/chenphxx/phxxblog/blob/main/backend/app/core/deps.py): `backend/app/core/deps.py`
- [MySQL persistence](https://github.com/chenphxx/phxxblog/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Content features

- [Post management](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/posts/router.py): `backend/app/modules/posts/router.py`
- [Post queries](https://github.com/chenphxx/phxxblog/blob/main/backend/app/services/post_query.py): `backend/app/services/post_query.py`
- [Diary management](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/diary/router.py): `backend/app/modules/diary/router.py`
- [Archive import](https://github.com/chenphxx/phxxblog/blob/main/backend/app/services/import_pipeline.py): `backend/app/services/import_pipeline.py`
- [Comments](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/comments/router.py): `backend/app/modules/comments/router.py`
- [Categories and tags](https://github.com/chenphxx/phxxblog/tree/main/backend/app/modules/taxonomy): `backend/app/modules/taxonomy`
- [Search](https://github.com/chenphxx/phxxblog/tree/main/backend/app/modules/search): `backend/app/modules/search`
- [Media uploads](https://github.com/chenphxx/phxxblog/tree/main/backend/app/modules/media): `backend/app/modules/media`

### Administration

- [Analytics and stats](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/stats/router.py): `backend/app/modules/stats/router.py`
- [Admin dashboard](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/dashboard/router.py): `backend/app/modules/dashboard/router.py`
- [Site settings](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/settings/router.py): `backend/app/modules/settings/router.py`
- [Feature controls](https://github.com/chenphxx/phxxblog/blob/main/backend/app/modules/modules/router.py): `backend/app/modules/modules/router.py`
- [RSS and SEO](https://github.com/chenphxx/phxxblog/tree/main/backend/app/modules/rss): `backend/app/modules/rss`
- [Operation logs](https://github.com/chenphxx/phxxblog/blob/main/backend/app/services/log.py): `backend/app/services/log.py`

### Other components

- **Visitor**
- **Administrator**

## Connections

- Visitor → Blog interface: browses (evidence: `README.md`)
- Administrator → Blog interface: manages site (evidence: `README.md`)
- Blog interface → Page routing: loads routes (evidence: `frontend/src/main.ts`)
- Blog interface → API client: requests data
- API client → FastAPI entry: calls API
- FastAPI entry → Module routing: mounts routes (evidence: `backend/app/main.py`)
- FastAPI entry → Feature registry: builds registry (evidence: `backend/app/main.py`)
- Module routing → Feature registry: uses registry (evidence: `backend/app/modules/router.py`)
- FastAPI entry → MySQL persistence: checks schema (evidence: `backend/app/main.py`)
- Post management → Post queries: queries posts (evidence: `backend/app/modules/posts/router.py`)
- Post management → MySQL persistence: reads and writes (evidence: `backend/app/modules/posts/router.py`)
- Post management → Archive import: imports archives (evidence: `backend/app/modules/posts/router.py`)
- Diary management → Archive import: imports diaries (evidence: `backend/app/modules/diary/router.py`)
- Archive import → Operation logs: records imports (evidence: `backend/app/services/import_pipeline.py`)
- Comments → MySQL persistence: reads and writes (evidence: `backend/app/modules/comments/router.py`)
- Analytics and stats → MySQL persistence: queries metrics (evidence: `backend/app/modules/stats/router.py`)
- Admin dashboard → Analytics and stats: displays trends
- Feature controls → Feature registry: manages features (evidence: `backend/app/modules/modules/router.py`)
- Post management → Operation logs: logs actions (evidence: `backend/app/modules/posts/router.py`)
- Diary management → MySQL persistence: reads and writes (evidence: `backend/app/modules/diary/router.py`)
- Categories and tags → MySQL persistence: stores taxonomy
- Search → MySQL persistence: searches content
- Media uploads → MySQL persistence: tracks media
- Site settings → MySQL persistence: stores settings
- RSS and SEO → MySQL persistence: publishes content
