How 373675032/love-charity works
Project type and purpose
• This is a full-stack Java Web application (an MVC-style “forum” for charity projects) built with Spring Boot, Spring MVC, Thymeleaf, MyBatis and static assets (Bootstrap, jQuery, EditMd).
• Purpose: Provide a public-facing site for browsing and posting help‐articles and charity projects (front-end), plus an admin console for managing users, content, comments, links, feedback, etc.
High-level layers & directories
• Presentation layer
• src/main/resources/static/... → Bootstrap-based CSS/JS/third-party libs (DataTables, EditorMd, Ionicons, etc.)
• src/main/resources/templates/... → Thymeleaf HTML templates (background/admin & front).
• Controller layer
• com.charity.controller.* → Spring MVC @Controller classes handling HTTP endpoints.
• com.charity.component.LoginHandlerInterceptor → login/session interceptor.
• Service layer
• com.charity.service.* → interfaces (business logic abstractions)
• com.charity.service.impl.* → implementations invoking DAOs and utils.
• Data-access layer
• com.charity.mapper.* → MyBatis mapper interfaces
• src/main/resources/mybatis/mapper/*.xml → SQL mappings
• Model/DTO/VO
• com.charity.entity → JPA-style domain objects
• com.charity.dto.ResponseResult → API response wrapper
• com.charity.vo.* → view objects returned to template layer
• Configuration & utilities
• com.charity.config.* → Spring Boot Java @Configuration classes (DruidConfig, MvcConfig)
• com.charity.utils.* → OSS upload, Mail, Logging, IP, Bean copy, etc.
• External resources
• application.yml → DB, mail, OSS endpoints
• love-charity.sql → schema
• Aliyun OSS (object storage for user files/avatars)
• SMTP server (email verification/reset password)
• Ehcache (caching layer)
• Druid (DB connection pool + monitoring)
Core architectural patterns
• MVC: Thymeleaf templates + static resources (View) ←→ Controllers (Controller) ←→ Services → Mappers/DB (Model).
• Layered architecture (presentation, controller, service, DAO, persistence).
• Interceptor pattern for authentication/authorization.
• DAO pattern via MyBatis.
• External service integration: OSS and SMTP as “side-car” services.
• Caching at DB-access layer (Ehcache).
• Centralized configuration with Spring Boot auto-config + Java @Configuration.