How kksshh0612/server works
Core Project Nature & Purpose
• This is a backend service for the Nest.net website focused on supporting various functionalities such as user authentication, attendance management, posting different types of content, and handling file uploads.
• The system is layered following a typical Spring Boot application structure (Controller, Service, Repository, Domain/DTO layers).
Main Architectural Components
a. Web Layer (Frontend/Controller):
• Controllers for managing endpoints are organized by features (e.g., attendance, auth, post [with subtypes: unified, notice, introduction, exam collection, photo], comment, executive, file, manager, member, life4cut, memberprofile).
• How these controllers receive HTTP requests and then delegate them to service layer.
b. Service Layer:
• Contains business logic for each functional area (e.g., AttendanceService, AuthService, PostService, etc.).
• Also includes specialized services like MailService and SlackService that handle external integrations.
c. Persistence / Repository Layer:
• Repositories that interface with the database for various domain entities are structured in packages matching functional groups (e.g., member, attendance, post, file).
• Domain classes are mapped under the “domain” packages.
d. Domain & DTO:
• Domain objects represent the core data models (e.g., Member, Post, Attendance, etc.).
• DTOs (Data Transfer Objects) exist for both request and response types. They ensure that only the necessary data is passed between layers.
e. Security & Authentication:
• Detailed configurations exist for security – JWT-based authentication, cookie handling, custom authorization filters, and overall SecurityConfig. Classes like Authenticator, CustomAuthorizationFilter, TokenProvider, and related error handlers are key.
f. Configuration & Integration:
• There are configuration packages for Swagger (API documentation), Redis (caching or session management), and general Web/MVC configuration.
• Environment-specific configuration files in src/main/resources (e.g., application-dev.yml, application-prod.yml) allow tuning based on the deployment environment.
g. Build & Deployment Artifacts:
• Build scripts (build.gradle, settings.gradle, gradlew files) and a Dockerfile demonstrate containerization and CI/CD integration.
Relationships & Data Flow
• Additionally, show any external integration points such as MailService and SlackService connecting to external systems.
• Interplay between Authentication (JWT, Cookies) and the secured endpoints.
Architectural Patterns & Design Principles
• N-tier layered architecture: clear separation between presentation (controllers), service, and data access.
• Use of DTOs in controller-service interaction to decouple domain from API contracts.
• Security is handled via a dedicated configuration package and filters following best practices.
• Configuration-driven environment management (multiple application.yml files).
Final Recommendations
– Security & Authentication (JWT, cookie management, authorization filters)
– Functional modules (attendance, posts [notice, introduction, exam collection, photo, unified], member, etc.)
– External integrations (Mail, Slack, Redis)
– Infrastructure (Gradle build, Docker container, Environment Configurations)
• Dependencies, including directional data flows (such as “data validation from Controller to Service”, “database CRUD via Repository”, etc.).