How mefr-arch/tradingjournal works
Trading Journal is a Spring Boot API for recording trades and reviewing performance. Clients submit validated trade data to the controller, which delegates CRUD and statistics requests to the service; the service validates and calculates PnL, then uses the repository to access persisted trades. Statistics are aggregated from retrieved trades into a response DTO. The README also documents Swagger/OpenAPI, but its configuration is not represented in the sampled source. Edges reflect sampled calls; database wiring is inferred from the Spring Data repository and documented PostgreSQL/H2 stack.
Main entry points: TradeService.java Trade service · TradeController.java Trade controller · Trade.java Trade entity · TradeRepo.java Trade repository
Components 8
API
- Trade controller
src/main/java/com/feranmi/trading_journal/controller/TradeController.java
Trade domain
- Trade service
src/main/java/com/feranmi/trading_journal/service/TradeService.java - Trade entity
src/main/java/com/feranmi/trading_journal/model/Trade.java - Trade direction
src/main/java/com/feranmi/trading_journal/model/Direction.java
Persistence and stats
- Trade repository
src/main/java/com/feranmi/trading_journal/repository/TradeRepo.java - Trade database
- Stats response
src/main/java/com/feranmi/trading_journal/dto/TradeStatsResponse.java
Other components
- API client
Connections 8
- API client → Trade controller: sends requests
- Trade controller → API client: returns results
- Trade controller → Trade service: delegates requests
- Trade service → Trade repository: reads and writes
- Trade service → Trade entity: validates and calculates
- Trade entity → Trade direction: checks direction
- Trade repository → Trade database: persists trades
- Trade service → Stats response: builds statistics