How gaoweilina/my-blog-sqlite works
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: ruoyi_blog.sql Database · RuoYiApplication.java RuoYiApplication · MtoPostController.java Blog content · LoginController.java System
Components 19
Application
Spring Boot entry points and runtime bootstrap
- RuoYiApplication · Primary Spring Boot entry point
src/main/java/com/ruoyi/RuoYiApplication.java - Servlet init · Servlet container deployment initializer
src/main/java/com/ruoyi/RuoYiServletInitializer.java - Thymeleaf UI · Templates and static assets for admin and public pages
src/main/resources/templates/index.html
Framework
Security, web, AOP, datasource, and shared infrastructure
- Shiro · Realm, session, remember-me, filters, and login services
src/main/java/com/ruoyi/framework/shiro - AOP · Data scope, logging, permissions, and datasource switching
src/main/java/com/ruoyi/framework/aspectj - Web core · Base controller, paging, results, exception handling, and shared services
src/main/java/com/ruoyi/framework/web/controller/BaseController.java - Request filters · Repeat-submit and XSS protection at the servlet boundary
src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java - Datasource · Dynamic routing, Druid config, and MyBatis/MyBatis-Plus setup
src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java - Async/Tasks · Async manager, Quartz task support, and shutdown handling
src/main/java/com/ruoyi/framework/manager/AsyncManager.java - WebSocket · WebSocket endpoint and session configuration
src/main/java/com/ruoyi/framework/websocket/WebSocketServer.java
Admin platform
Ruoyi back-office modules and operational tooling
- System · Users, roles, menus, dicts, config, posts, mail, notices, and auth flows
src/main/java/com/ruoyi/project/system/user/controller/LoginController.java - Monitor · Login logs, online users, server health, cache, jobs, and operation logs
src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java - Tooling · 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 · Homepage aggregation, focus/blog entry points, and repeat-log tracking
src/main/java/com/ruoyi/project/emmanuel/index/controller/AdminIndexController.java - Blog content · Categories, channels, tags, posts, comments, links, and public web queries
src/main/java/com/ruoyi/project/emmanuel/mto/controller/MtoPostController.java - Cloud files · File upload, storage, and business-file linking
src/main/java/com/ruoyi/project/emmanuel/cloud/controller/FileController.java - Memorial · Boards, notes, pinboards, and timelines
src/main/java/com/ruoyi/project/emmanuel/memorial/controller/NoteController.java - Accounting · Account, bill, class, and money bookkeeping
src/main/java/com/ruoyi/project/emmanuel/account/controller/AccountBillController.java
Other components
- Database · MySQL/SQLite persistence target configured by profile
sql/ruoyi_blog.sql
Connections 24
- 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