How allanmaslopes/yoursummoner-api works
1. Overall shape
- This is a Spring Boot microservice named YourSummoner-API.
- Its job is to expose a REST API for Riot Games / League of Legends data and act as a thin orchestration layer over external Riot endpoints.
2. Request entry points
- The API surface is split into three controllers:
- SummonerController
- ChampionController
- MatchController
- These are the primary inbound boundaries for clients consuming the service.
3. Service layer
- Business orchestration sits in SummonerService, ChampionService, MatchService, ProfileIconService, and StaticService.
- The services likely coordinate fetching, transforming, and combining Riot responses into API-specific DTOs rather than exposing raw upstream payloads directly.
4. Outbound integration layer
- External HTTP calls are isolated in SummonerClient, ChampionClient, MatchClient, and shared RESTClient.
- This is the main outbound boundary to Riot’s APIs, keeping controller/service code separate from transport details.
5. Configuration and cross-cutting concerns
- RiotgamesConfiguration centralizes Riot-related configuration, likely base URLs, credentials, or request settings.
- CorsCofiguration handles browser-origin access rules.
- SwaggerConfig exposes API documentation, which is a visible part of the service contract.
6. Domain model vs API contract
- The model package contains rich response structures for Riot data, including:
- summoner/account objects
- ranking/profile data
- match details
- champion metadata and mastery
- The model/dto package contains outward-facing response shapes such as SummonerProfileDto, RankingDto, ChampionDto, ChampionMasteryDto, and MainChampionDto.
- This suggests the service transforms upstream API payloads into a cleaner API contract before returning data to callers.
7. Riot-specific data domains
- The repository is organized around Riot’s main data domains:
- Summoner/profile: Summoner, SummonerDetails, Ranking, Status, ProfileIcon
- Champions: Champion, ChampionDetail, ChampionByMastery, and supporting nested types like Spell, Skin, Passive
- Matches: Match, MatchRequest, InfoMatch, Participants, Team, Perks, and objective breakdowns
- This indicates the service is not generic; it is purpose-built for League of Legends profile and match analytics.
8. Match data complexity
- The model/match/objectives subtree and associated classes (Objectives, Dragon, Baron, Tower, etc.) show that match responses are deeply nested and normalized into dedicated types.
- That implies the match subsystem is one of the more complex transformation paths in the service.
9. Error handling boundary
- Error models live under model/error with ApiError, ErrorJsonApi, and ErrorXmlApi.
- This suggests the service standardizes failures coming from upstream Riot APIs or its own request validation into structured error payloads.
10. Utility and request semantics
- RequestApiEnum likely centralizes the supported Riot request types or endpoints.
- UtilsWS appears to support web-service utility behavior, probably shared request/response handling or URL construction.
11. Runtime and packaging
- The project uses Maven (pom.xml) and a standard src/main/java / src/main/resources layout.
- application.properties is the main runtime configuration entry point.
- YourSummonerApiApplication is the Spring Boot bootstrap class.
12. Tests
- There is a minimal Spring context test at src/test/java/com/your/summoner/api/RiotGamesApiApplicationTests.java.
- That indicates test coverage is currently lightweight and centered on application startup rather than broad functional validation.
13. Architecture summary for a diagram
- The clean diagram is:
- Client -> Controller -> Service -> Client -> Riot Games API
- with DTO/model transformation in the service layer and config/error handling as shared supporting concerns.
- The service does not appear to persist data locally; it is primarily a stateless API aggregation and transformation layer.
Main entry points: RESTClient.java REST Client · SummonerService.java Summoner Service · ChampionService.java Champion Service · YourSummonerApiApplication.java API App
Components 25
Bootstrap
Application entry point and startup wiring
- API App · Application bootstrap and runtime entry point
src/main/java/com/your/summoner/api/YourSummonerApiApplication.java
Inbound API
REST controllers exposed to clients
- Summoner API · Summoner/profile endpoints
src/main/java/com/your/summoner/api/controller/SummonerController.java - Champion API · Champion metadata and mastery endpoints
src/main/java/com/your/summoner/api/controller/ChampionController.java - Match API · Match lookup and analysis endpoints
src/main/java/com/your/summoner/api/controller/MatchController.java
Services
Orchestration and transformation layer
- Summoner Service · Summoner profile orchestration
src/main/java/com/your/summoner/api/service/SummonerService.java - Champion Service · Champion data orchestration and mapping
src/main/java/com/your/summoner/api/service/ChampionService.java - Match Service · Match orchestration and normalization
src/main/java/com/your/summoner/api/service/MatchService.java - Icon Service · Profile icon lookup and composition
src/main/java/com/your/summoner/api/service/ProfileIconService.java - Static Service · Static Riot data access and helpers
src/main/java/com/your/summoner/api/service/StaticService.java
Outbound Integration
HTTP clients used to call Riot endpoints
- Summoner Client · Outbound Riot calls for summoner data
src/main/java/com/your/summoner/api/client/SummonerClient.java - Champion Client · Outbound Riot calls for champion data
src/main/java/com/your/summoner/api/client/ChampionClient.java - Match Client · Outbound Riot calls for match data
src/main/java/com/your/summoner/api/client/MatchClient.java - REST Client · Shared HTTP transport and request handling
src/main/java/com/your/summoner/api/client/RESTClient.java - Riot Games API · Upstream Riot endpoint boundary
Domain Models
Riot data structures and API contracts
- Summoner DTOs · Outbound profile and ranking response shapes
src/main/java/com/your/summoner/api/model/dto/SummonerProfileDto.java - Champion DTOs · Outbound champion and mastery response shapes
src/main/java/com/your/summoner/api/model/dto/ChampionDto.java - Match Models · Match request and nested match payloads
src/main/java/com/your/summoner/api/model/Match.java - Champion Models · Champion payloads and nested champion structures
src/main/java/com/your/summoner/api/model/champion/Champion.java - Summoner Models · Summoner, ranking, status, and icon payloads
src/main/java/com/your/summoner/api/model/Summoner.java - Error Models · Standardized API and upstream error payloads
src/main/java/com/your/summoner/api/model/error/ApiError.java
Support
Configuration, enums, and shared utilities
- Riot Config · Riot base configuration and request settings
src/main/java/com/your/summoner/api/config/RiotgamesConfiguration.java - Swagger Config · API documentation setup
src/main/java/com/your/summoner/api/config/SwaggerConfig.java - CORS Config · Browser access policy
src/main/java/com/your/summoner/api/config/CorsCofiguration.java - Request Enum · Supported request and endpoint types
src/main/java/com/your/summoner/api/enumeration/RequestApiEnum.java - Utils WS · Shared web-service helpers
src/main/java/com/your/summoner/api/utils/UtilsWS.java
Connections 26
- API App → Summoner API: starts · Bootstraps the summoner API
- API App → Champion API: starts · Bootstraps the champion API
- API App → Match API: starts · Bootstraps the match API
- Summoner API → Summoner Service: uses · Delegates summoner requests
- Champion API → Champion Service: uses · Delegates champion requests
- Match API → Match Service: uses · Delegates match requests
- Summoner Service → Summoner Client: fetches · Retrieves upstream summoner data
- Summoner Service → Icon Service: composes · Adds profile icon data
- Champion Service → Champion Client: fetches · Retrieves upstream champion data
- Champion Service → Static Service: uses · Reads static champion data
- Match Service → Match Client: fetches · Retrieves upstream match data
- Summoner Client → REST Client: built on · Shares HTTP transport
- Champion Client → REST Client: built on · Shares HTTP transport
- Match Client → REST Client: built on · Shares HTTP transport
- REST Client → Riot Games API: calls · Outbound Riot API traffic
- Riot Config → REST Client: configures · Provides Riot HTTP settings
- Swagger Config → API App: documents · Exposes API documentation
- CORS Config → API App: secures · Configures browser access
- Request Enum → Utils WS: supports · Used in request routing helpers
- Utils WS → REST Client: supports · Assists shared transport logic
- Summoner Service → Summoner DTOs: maps to · Transforms domain data to API DTOs
- Summoner Service → Summoner Models: reads · Consumes summoner domain objects
- Champion Service → Champion DTOs: maps to · Transforms champion data to API DTOs
- Champion Service → Champion Models: reads · Consumes champion domain objects
- Match Service → Match Models: reads · Consumes match domain objects
- Match Service → Error Models: handles · Normalizes API failures into error contracts