Represent strategies as interchangeable algorithms
Strategy and Factory patterns separate DCA and lump-sum calculations from orchestration. The service can select an algorithm while the controller continues to expose the same simulation contract.
Comparing recurring and lump-sum investments through an explicit simulation model.
Portfolio project
DCA and lump-sum strategies invest at different times. Comparing them requires consistent inputs and monetary calculations, then a clear presentation of invested capital and portfolio value over time.
I built the Java/Spring Boot simulation backend and the Next.js/TypeScript interface, connecting strategy calculations, persistence, and chart-based results.
Strategy and Factory patterns separate DCA and lump-sum calculations from orchestration. The service can select an algorithm while the controller continues to expose the same simulation contract.
BigDecimal keeps monetary calculations out of binary floating-point arithmetic. This makes numeric handling explicit; rounding and the historical-data assumptions still belong to the simulation model.
Request and response DTOs define the interface, while repositories handle MySQL persistence. Next.js and Chart.js present the results without exposing database entities as the frontend contract.
An educational simulator using historical scenarios. Results depend on the selected period and simulation inputs.