How achrafaitibba/track-coumpounding-trades works
Main System Components
a) Client Layer
• External client applications that consume the REST API
b) API Layer
• Controllers package (AccountController, EnumController, TargetController, TradeController)
• REST endpoints grouping
c) Security Layer
• JWT Authentication/Authorization components
• Security filters
• Token management
d) Service Layer
• Business logic services (AccountService, TradeService, TargetService)
• Trade calculation and target computation logic
e) Repository Layer
• Data access layer with all repositories
• Entity relationships
f) Database Layer
• MySQL database
• Entity tables and relationships
Component Relationships and Interactions
a) Authentication Flow:
Client → JwtAuthenticationFilter → SecurityConfigurationFilter → AccountService → TokenRepository
b) Trade Management Flow:
Client → TradeController → TradeService → TradeRepository → Database
c) Target Calculation Flow:
Client → TargetController → TargetService → CompoundingPeriodRepository/TargetRepository → Database
Specific Implementation Details
Important architectural elements:
a) Security Components:
JwtAuthenticationFilter ↔ JwtService ↔ TokenRepository
SecurityConfigurationFilter → LogoutService
b) Data Model Relationships:
Account → User → Trade
Trade → CompoundingPeriod
Target → Account
c) DTO Flow:
Request DTOs → Controllers → Services → Entities → Repositories
Technical Stack Indicators
• Spring Boot 3.x
• Java 17
• MySQL
• JWT
• Hibernate
• Spring Security
Deployment Context
Deployment-related components:
• Tomcat container
• Application properties profiles (local/prod)
• Database connection pool