How archan0621/seulchuksaeng_be works
Project type and purpose
• This is a full-stack club-management web application, focused on backend services implemented in Spring Boot.
• Purpose: automate membership, attendance, fee management for a university soccer club.
Main components (to include
A. Frontend layer
• PHP web server (outside VPC) hosting HTML/JS, HighCharts for admin dashboards
B. Load-Balancer
• Nginx on its own Ubuntu instance (round-robin)
C. Backend application tier
• Two identical Spring Boot instances (Docker containers) behind the LB
• Exposed REST endpoints handled by Controllers, secured by Spring Security + JWT
D. Persistence tier
• MySQL database on its own instance
• Spring Data JPA Repositories
E. Caching
• Spring Cache (e.g., Redis or in-memory depending on config) via CacheConfig
F. Scheduler
• Spring’s @Scheduled and dynamic one-off schedulers for penalty assignment
G. Cross-cutting services
• AOP aspects (SlowResponseAspect, LogExecutionTime)
• Annotations for AdminAuthorize, UserAuthorize
H. External integrations
• Naver Map API (geo-coding, distance calculation)
• Discord Webhook (notifications)
• Slack Webhook (alerts from Prometheus)
I. Observability & monitoring
• Pinpoint APM server (transaction tracing)
• Prometheus & Grafana server (metrics collection & dashboards)
Relationships and data-flow
1. User (Browser)
→ requests frontend PHP → HTML/JS (HighCharts dashboards)
→ issues REST calls to api.example.com
2. Nginx Load-Balancer
→ dispatches to one of two Spring Boot backend instances
3. Spring Boot instance
a. Authentication & Authorization (JwtAuthenticationFilter → SecurityConfig → TokenProvider)
b. Controller layer (EventController, MemberController, etc.)
c. Service layer (MemberService, EventService, MemberEventService)
d. Repository layer (MemberRepository, EventRepository, MemberEventRepository)
e. Domain objects (Member, Event, Attendance, MemberEvent)
f. Scheduler tasks (PenaltyScheduler, PenaltyGrantTask)
g. AOP intercepts for logging / slow-response measurement
h. Cache reads/writes via CacheConfig
i. External HTTP calls:
• NaverMapApiProvider (to look up lat/long)
• DiscordWebhookSender (to send notifications)
4. Database
← JPA reads/writes, commit/rollback
5. Observability
• Pinpoint agent in each backend container → Pinpoint server collects traces
• Spring Boot metrics exposed → scraped by Prometheus → displayed in Grafana; alerts via Slack webhook
Architectural patterns & design principles
• Layered MVC (Controller → Service → Repository)
• Separation of concerns (Controllers handle HTTP, Services handle business logic, Repos handle data access)
• AOP for cross-cutting concerns (logging, performance monitoring)
• JWT stateless authentication (no session affinity)
• N-to-N relationship resolved with MemberEvent join entity
• Externalized configuration & Dockerized deployment for horizontal scaling
• Scheduled batch processing for penalties
• Single-responsibility for each micro-instance: app tier, DB, LB, monitoring
Diagramming recommendations
• Use clear labels for each component: e.g., “Nginx LB”, “Spring Boot App #1”, “MySQL DB”
• User → PHP Frontend → LB → App → DB
• App → Naver Map API
• App → Discord Webhook
• App’s /actuator/metrics → Prometheus → Grafana
• App’s Pinpoint agent → Pinpoint Server
• Green: User-facing/frontend
• Blue: Application tier
• Orange: Persistence
• Purple: External third-party APIs
• Gray: Monitoring & Observability
• Clouds for external services