# gaoweilina/my-blog-sqlite architecture

> Architecture diagram of the GitHub repository gaoweilina/my-blog-sqlite, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gaoweilina/my-blog-sqlite
- Repository: https://github.com/gaoweilina/my-blog-sqlite

## Overview

1. This is a single Spring Boot application, not a split microservice system. The entry point is `RuoYiApplication`, with `RuoYiServletInitializer` for servlet container deployment. It packages both an admin back office and a blog/public site in one JVM process.

2. The core request path is classic layered MVC: `Controller -> Service -> Mapper -> MyBatis XML -> Database`. Most business modules follow this pattern, with entities/domain objects under each module, service interfaces plus `*ServiceImpl`, and SQL mappings in `src/main/resources/mybatis/...`.

3. Security is centered on Apache Shiro. `framework/shiro` contains the realm, login/register/password services, session management, remember-me, and request filters such as captcha, logout, kickout, and online-session checks. This is the main boundary protecting the admin and sensitive APIs.

4. Cross-cutting behavior is mostly implemented through AOP and servlet filters. `framework/aspectj` handles data scope, logging, permissions, and datasource switching. `framework/interceptor` adds repeat-submit protection. `common/xss` wraps requests to filter XSS input. These sit in front of business controllers and affect many modules.

5. Data access is backed by MyBatis and MyBatis-Plus, with Druid as the connection pool. The repo also includes a `DynamicDataSource`, a MySQL-to-SQLite function interceptor, and separate YAML profiles for MySQL and SQLite, so persistence is configurable and partly database-portable.

6. The application is organized into two broad business areas:
   - `project/system`, `project/monitor`, and `project/tool` are the standard Ruoyi admin platform features.
   - `project/emmanuel` is the custom blog/product area.
   This separation is important for diagramming because the first group is infrastructure/admin-oriented, while the second group is the user-facing product logic.

7. The standard platform modules include user, role, menu, dept, dict, notice, config, post, mail, logs, online sessions, server monitoring, cache monitoring, job scheduling, and code generation. These modules are mostly administrative CRUD plus operational tooling, and they reuse shared framework services for auth, pagination, logging, and Excel/export support.

8. The custom blog domain is split into several subdomains:
   - `emmanuel/mto` for blog content management: categories, channels, tags, posts, comments, links, and public web post queries.
   - `emmanuel/cloud` for file storage and file-business linking.
   - `emmanuel/memorial` for board/note/timeline style content.
   - `emmanuel/account` for account/bill/money bookkeeping.
   - `emmanuel/index` for homepage/admin dashboard aggregation and repeat-log tracking.
   These are independent bounded areas with their own controller/service/mapper stacks.

9. The UI is server-rendered with Thymeleaf templates. Admin pages live under `templates/system`, `templates/monitor`, `templates/tool`, and custom product pages under `templates/emmanuel/...`. Static assets are bundled under `src/main/resources/static`, including large front-end libraries and dedicated blog/cloud/homepage assets. There is no separate SPA frontend server in this repo.

10. The blog/public experience is HTML-first and heavily asset-driven. The repository contains rich editor and content-rendering libraries such as Editor.md, CodeMirror, Prism, Tocbot, Moment, and various UI kits. This supports markdown editing, code highlighting, article navigation, and public blog rendering directly from the same backend.

11. Background and real-time infrastructure is present but still inside the monolith:
   - Quartz schedules jobs in `project/monitor/job` and `framework/task`.
   - WebSocket support lives in `framework/websocket`.
   - Async execution is handled by `framework/manager/AsyncManager`.
   These are auxiliary subsystems, not separate services.

12. Operational packaging is first-class. The repo includes Docker files, shell/batch launch scripts, SQL initialization files, and database documentation. That suggests the deployable unit is the whole application plus its database, with Docker being the main containerized deployment path.

Main entry points: [`sql/ruoyi_blog.sql`](https://github.com/gaoweilina/my-blog-sqlite/blob/master/sql/ruoyi_blog.sql) (Database), [`src/main/java/com/ruoyi/RuoYiApplication.java`](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/RuoYiApplication.java) (RuoYiApplication), [`src/main/java/com/ruoyi/project/emmanuel/mto/controller/MtoPostController.java`](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/mto/controller/MtoPostController.java) (Blog content), [`src/main/java/com/ruoyi/project/system/user/controller/LoginController.java`](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/system/user/controller/LoginController.java) (System)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_app["Application"]
  node_app_main(("RuoYiApplication<br/>boot app"))
  node_app_servlet(("Servlet init<br/>web bootstrap"))
  node_ui["Thymeleaf UI<br/>server-rendered views<br/>[index.html]"]
end

subgraph group_grp_fw["Framework"]
  node_fw_shiro["Shiro<br/>auth boundary"]
  node_fw_aspect["AOP<br/>cross-cutting"]
  node_fw_web["Web core<br/>mvc support"]
  node_fw_filter["Request filters<br/>http filter"]
  node_fw_ds["Datasource<br/>persistence infra"]
  node_fw_async["Async/Tasks<br/>runtime jobs<br/>[AsyncManager.java]"]
  node_fw_ws["WebSocket<br/>realtime"]
end

subgraph group_grp_admin["Admin platform"]
  node_admin_sys["System<br/>admin module"]
  node_admin_mon["Monitor<br/>ops module<br/>[JobController.java]"]
  node_admin_tool["Tooling<br/>generator module<br/>[GenController.java]"]
end

subgraph group_grp_product["Product area"]
  node_product_index["Home hub<br/>product module"]
  node_product_mto["Blog content<br/>content module"]
  node_product_cloud["Cloud files<br/>file module"]
  node_product_mem["Memorial<br/>board module"]
  node_product_acct["Accounting<br/>ledger module"]
end

node_db[("Database<br/>sql store<br/>[ruoyi_blog.sql]")]

node_app_main -->|"starts with"| node_fw_shiro
node_app_main -->|"configures"| node_fw_ds
node_app_main -->|"loads"| node_admin_sys
node_app_main -->|"loads"| node_product_mto
node_app_main -->|"serves"| node_ui
node_app_servlet -->|"deploys"| node_app_main
node_fw_filter -->|"guards"| node_fw_shiro
node_fw_aspect -->|"advises"| node_admin_sys
node_fw_aspect -->|"advises"| node_product_mto
node_fw_web -->|"supports"| node_admin_sys
node_fw_web -->|"supports"| node_product_mto
node_fw_ds -->|"reads/writes"| node_db
node_fw_async -->|"executes"| node_admin_mon
node_fw_ws -->|"enables"| node_product_index
node_admin_sys -->|"persists"| node_db
node_admin_mon -->|"persists"| node_db
node_admin_tool -->|"inspects"| node_db
node_product_index -->|"aggregates"| node_product_mto
node_product_mto -->|"persists"| node_db
node_product_cloud -->|"persists"| node_db
node_product_mem -->|"persists"| node_db
node_product_acct -->|"persists"| node_db
node_ui -->|"renders"| node_product_mto
node_ui -->|"renders"| node_admin_sys

click node_app_main "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/RuoYiApplication.java"
click node_app_servlet "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/RuoYiServletInitializer.java"
click node_fw_shiro "https://github.com/gaoweilina/my-blog-sqlite/tree/master/src/main/java/com/ruoyi/framework/shiro"
click node_fw_aspect "https://github.com/gaoweilina/my-blog-sqlite/tree/master/src/main/java/com/ruoyi/framework/aspectj"
click node_fw_web "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/web/controller/BaseController.java"
click node_fw_filter "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java"
click node_fw_ds "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java"
click node_fw_async "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/manager/AsyncManager.java"
click node_fw_ws "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/websocket/WebSocketServer.java"
click node_admin_sys "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/system/user/controller/LoginController.java"
click node_admin_mon "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java"
click node_admin_tool "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java"
click node_product_index "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/index/controller/AdminIndexController.java"
click node_product_mto "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/mto/controller/MtoPostController.java"
click node_product_cloud "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/cloud/controller/FileController.java"
click node_product_mem "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/memorial/controller/NoteController.java"
click node_product_acct "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/account/controller/AccountBillController.java"
click node_db "https://github.com/gaoweilina/my-blog-sqlite/blob/master/sql/ruoyi_blog.sql"
click node_ui "https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/resources/templates/index.html"

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_main,node_app_servlet,node_ui toneBlue
class node_fw_shiro,node_fw_aspect,node_fw_web,node_fw_filter,node_fw_ds,node_fw_async,node_fw_ws toneAmber
class node_admin_sys,node_admin_mon,node_admin_tool toneMint
class node_product_index,node_product_mto,node_product_cloud,node_product_mem,node_product_acct toneRose
class node_db toneNeutral
```

## Components

### Application

Spring Boot entry points and runtime bootstrap

- [RuoYiApplication](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/RuoYiApplication.java): boot app · Primary Spring Boot entry point · `src/main/java/com/ruoyi/RuoYiApplication.java`
- [Servlet init](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/RuoYiServletInitializer.java): web bootstrap · Servlet container deployment initializer · `src/main/java/com/ruoyi/RuoYiServletInitializer.java`
- [Thymeleaf UI](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/resources/templates/index.html): server-rendered views · Templates and static assets for admin and public pages · `src/main/resources/templates/index.html`

### Framework

Security, web, AOP, datasource, and shared infrastructure

- [Shiro](https://github.com/gaoweilina/my-blog-sqlite/tree/master/src/main/java/com/ruoyi/framework/shiro): auth boundary · Realm, session, remember-me, filters, and login services · `src/main/java/com/ruoyi/framework/shiro`
- [AOP](https://github.com/gaoweilina/my-blog-sqlite/tree/master/src/main/java/com/ruoyi/framework/aspectj): cross-cutting · Data scope, logging, permissions, and datasource switching · `src/main/java/com/ruoyi/framework/aspectj`
- [Web core](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/web/controller/BaseController.java): mvc support · Base controller, paging, results, exception handling, and shared services · `src/main/java/com/ruoyi/framework/web/controller/BaseController.java`
- [Request filters](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java): http filter · Repeat-submit and XSS protection at the servlet boundary · `src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java`
- [Datasource](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java): persistence infra · Dynamic routing, Druid config, and MyBatis/MyBatis-Plus setup · `src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java`
- [Async/Tasks](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/manager/AsyncManager.java): runtime jobs · Async manager, Quartz task support, and shutdown handling · `src/main/java/com/ruoyi/framework/manager/AsyncManager.java`
- [WebSocket](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/framework/websocket/WebSocketServer.java): realtime · WebSocket endpoint and session configuration · `src/main/java/com/ruoyi/framework/websocket/WebSocketServer.java`

### Admin platform

Ruoyi back-office modules and operational tooling

- [System](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/system/user/controller/LoginController.java): admin module · Users, roles, menus, dicts, config, posts, mail, notices, and auth flows · `src/main/java/com/ruoyi/project/system/user/controller/LoginController.java`
- [Monitor](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java): ops module · Login logs, online users, server health, cache, jobs, and operation logs · `src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java`
- [Tooling](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java): generator module · Code generation, build helpers, and Swagger/test utilities · `src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java`

### Product area

Custom blog and user-facing domains

- [Home hub](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/index/controller/AdminIndexController.java): product module · Homepage aggregation, focus/blog entry points, and repeat-log tracking · `src/main/java/com/ruoyi/project/emmanuel/index/controller/AdminIndexController.java`
- [Blog content](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/mto/controller/MtoPostController.java): content module · Categories, channels, tags, posts, comments, links, and public web queries · `src/main/java/com/ruoyi/project/emmanuel/mto/controller/MtoPostController.java`
- [Cloud files](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/cloud/controller/FileController.java): file module · File upload, storage, and business-file linking · `src/main/java/com/ruoyi/project/emmanuel/cloud/controller/FileController.java`
- [Memorial](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/memorial/controller/NoteController.java): board module · Boards, notes, pinboards, and timelines · `src/main/java/com/ruoyi/project/emmanuel/memorial/controller/NoteController.java`
- [Accounting](https://github.com/gaoweilina/my-blog-sqlite/blob/master/src/main/java/com/ruoyi/project/emmanuel/account/controller/AccountBillController.java): ledger module · Account, bill, class, and money bookkeeping · `src/main/java/com/ruoyi/project/emmanuel/account/controller/AccountBillController.java`

### Other components

- [Database](https://github.com/gaoweilina/my-blog-sqlite/blob/master/sql/ruoyi_blog.sql): sql store · MySQL/SQLite persistence target configured by profile · `sql/ruoyi_blog.sql`

## Connections

- RuoYiApplication → Shiro: starts with · Application boots the security boundary first
- RuoYiApplication → Datasource: configures · Bootstraps persistence and datasource infrastructure
- RuoYiApplication → System: loads · Registers admin MVC modules
- RuoYiApplication → Blog content: loads · Registers public blog/product modules
- RuoYiApplication → Thymeleaf UI: serves · Runs the server-rendered template layer
- Servlet init → RuoYiApplication: deploys · Supports external servlet container deployment
- Request filters → Shiro: guards · Filters and interceptors run before protected endpoints
- AOP → System: advises · Applies permissions, logging, data scope, and datasource switching
- AOP → Blog content: advises · Cross-cutting concerns also affect product modules
- Web core → System: supports · Shared MVC utilities are reused by admin controllers
- Web core → Blog content: supports · Shared MVC utilities are reused by product controllers
- Datasource → Database: reads/writes · MyBatis and MyBatis-Plus persistence access the database
- Async/Tasks → Monitor: executes · Background jobs and scheduled tasks live in the monolith
- WebSocket → Home hub: enables · Realtime chat/websocket features are part of the product area
- System → Database: persists · Standard platform CRUD maps to SQL tables
- Monitor → Database: persists · Monitoring data and logs are stored in the database
- Tooling → Database: inspects · Generator tooling reads schema metadata
- Home hub → Blog content: aggregates · Homepage/dashboard surfaces blog content
- Blog content → Database: persists · Content, tags, comments, and links use MyBatis mappings
- Cloud files → Database: persists · Files and file-link metadata are stored
- Memorial → Database: persists · Board and timeline content is stored
- Accounting → Database: persists · Accounting records are stored
- Thymeleaf UI → Blog content: renders · Templates present public blog pages
- Thymeleaf UI → System: renders · Templates present admin views
