How han-dongil/ringle works
Project type and purpose
• This is a full-stack Spring Boot web application for managing course registration (“수강신청 과제”).
• It exposes RESTful APIs secured by JWT tokens, serves a JSP-based UI for users, and includes Swagger UI for interactive API docs.
• User roles: “student” and “tutor”; login via /api/v1/login returns JWT, then clients must send “Authorization: Bearer <token>” for protected endpoints.
File structure
• Top-level:
• assignment/src/main/java/com/example/demo: Spring Boot entrypoints and Servlet initializer
• auth: JWT filter, entry point, handlers, user-details service, controllers
• config: OpenAPI (Swagger) and Spring Security config
• module: three domains (classes, members, registration), each with controller, service, dto, mapper
• util: JWT utils and common response wrapper
• resources: application.yml, log4jdbc properties, MyBatis XML mappers
• webapp/WEB-INF/jsp: main-page JSP
• Testing under src/test/java
• Build: Maven (pom.xml)
Review README for behavior
• Endpoints start with /api/v1/login (open), /api/v1/student (student only), /api/v1/tutor (tutor only).
• Swagger UI exposed at http://localhost:18089
• Postman or browser can be clients.
Main components
a. Clients
• Web Browser (JSP UI + Swagger UI)
• API Clients (Postman, Mobile)
b. API Gateway / Spring Security
• JwtAuthFilter, CustomEntryPoint, AccessDeniedHandler
c. Controllers
• AuthController
• ClassController, MemberController, RegistrationController
• MainViewController (serves JSP)
d. Service Layer
• ClassServiceImpl, MemberServiceImpl, RegistrationServiceImpl
e. Data Access
• MyBatis mappers (class-mapper.xml, members-mapper.xml, registration-mapper.xml)
• Mapper interfaces
f. Database
• Relational DB (e.g. MySQL)
g. Utility and Config
• JwtUtil, CustomResponse
• OpenApiConfig, SecurityConfig
• application.yml, log4jdbc
Relationships & interactions
• Client → Spring Security Filter Chain (JwtAuthFilter) → Controllers
• Controllers ↔ Service Layer → MyBatis Mappers → Database
• MainViewController → JSP (view rendering)
• Swagger UI ← OpenAPI config
• Errors handled by GlobalExceptionHandler → CustomExceptionResponse
Architectural patterns & principles
• Layered (Web → Controller → Service → DAO → DB)
• Role-based access control via JWT
• MyBatis for data mapping (XML + mapper interfaces)
• Dependency injection via Spring Boot
• Externalized config (YAML, Log4jdbc)
Essential elements
• Clear component labels (e.g., “JwtAuthFilter”, “RegistrationService”)
• Detail the MyBatis XML mappers as part of Data Layer