How duydo131/hust_blog works
Project’s Main Components
• Spring Boot API Server – The core Java application under src/main/java/com/learnspringboot/demo. It implements:
∘ Controllers (for Auth, Post, Slug, and User endpoints)
∘ DTOs, mapping classes, services (both database and infrastructure abstractions), and the repository layer for persistence.
∘ A comprehensive security module using Spring Security, JWT authentication, and module-specific authentication providers.
• File Server Service – Found under the file_server folder (file_server/file_service.go), this Go microservice likely handles file-related operations such as storage or retrieval requests.
• Database – Although there is a “postgres” folder that might suggest a custom configuration for PostgreSQL, the “How To Run” instructions indicate using MySQL (create database demo_spring_boot). Represent the DB service as an external persistent store accessed by the Spring Boot API.
• Infrastructure Containers – Docker Compose is orchestrating not only the database but also Zookeeper, Kafka, and any necessary API images. These represent external services that the API communicates with (e.g., Kafka for messaging, and Zookeeper for coordination).
Out Relationships and Interactions
• API Layer (Spring Boot) – Show how individual controllers (AuthController, PostController, etc.) receive incoming REST requests and pass them onto services.
• Service Layer – Illustrate business logic operations (AuthService, PostService, etc.) that interface with the repository layer.
• File Server – Represent the communication (if any) with the API for file management. Although the specifics of interaction aren’t detailed, note its role as an independent service.
Architectural Patterns and Technologies
• Layered Architecture – Clearly delineate the presentation layer (controllers), service or business logic layer, and data access layer. This helps engineers quickly see how requests are processed.
• Security Patterns – Highlight use of JWT for authentication and the specialized module authentication filters which add an extra layer.
• Microservices/Containerization – With Docker managing different service containers (API, file server, database, Kafka, Zookeeper), indicate this separation.
∘ Java with Spring Boot for the API.
∘ Spring Security for authentication and authorization.
∘ Maven (pom.xml, Maven wrapper) for building.
∘ Go for the file server component.
∘ Docker and Docker Compose for container orchestration.
∘ MySQL (as per “How To Run”) for the database (even though there’s a postgres config, follow the README instructions).
∘ Kafka and Zookeeper for messaging/coordination.