How sky7214sky72/portfolio works
Main Components
• API Gateway / Entry Point: Represent the main Spring Boot application (PortfolioApplication.java) that serves as the entry point.
• Module Segments:
– Word Module: Handles user word memorization and vocabulary management (controllers, domain, repository, and service under the “word” package).
– Baseball Module: Includes endpoints and domain logic for calculating baseball statistics, managed under the “baseball” package.
– Lotto Module: Provides lotto prediction functionality, including scheduled tasks, under the “lotto” package.
– Sign / Authentication Module: Manages login, OAuth integration, and token management (using JWT). This module (under “sign”) is critical for user authentication with support for multiple OAuth providers.
– Global Components: Shared annotation-based authorization, configuration of Swagger, Web config, and exception handling. These elements support cross-module features such as security, configuration, and error management.
• Presentation Layer:
– Controllers for each module (e.g., BaseballController, LottoController, WordController, SignController) provide REST APIs.
• Service Layer:
– Services (e.g., StatService, LottoService, SignService, UserService, WordService) encapsulate business logic.
• Data/Repository Layer:
– Repository interfaces (e.g., HitterRepository, LeagueRepository, WordRepository, SignRepository, etc.) abstract database interactions. Note that JPA is used with PostgreSQL (and H2 for local testing) as noted in the README.
• Domain (Model) Layer:
– Domain objects and DTOs represent the data model, with some modules having extra calculators (e.g., OpsCalculator, WrcCalculator for baseball stats).
External Systems and Infrastructure
• OAuth Providers: Represent external systems like Kakao (as well as Naver, Google). They interact with the sign module for authentication.
• Monitoring Tools: Include Prometheus, Promtail, Loki, and Grafana for server log monitoring and health tracking. These should be visualized as an external monitoring cluster linked to the running application.
• Docker & CI/CD: The presence of a Dockerfile, docker-compose (compose.yaml), and GitHub workflows for Gradle builds indicate containerization and CI integration.
• Database: PostgreSQL (and H2 for local dev) should be depicted as the persistent data store that interacts with all repository layers.