A full-stack system for collecting, analyzing, forecasting, and visualizing monthly USD exchange rate data with advanced mathematical analysis.
The platform is designed with a clean, modular architecture that separates data access, business logic, mathematical computation, and presentation layers.
The system manages historical monthly average USD exchange rates starting from January 2023, performs trend analysis and forecasting, and provides interactive visualizations and matrix-based analytics.
It is built to ensure:
- Deterministic calculations
- Clear separation of concerns
- Full test coverage for computational logic
- Maintainable and extensible codebase
- Python 3.11+
- FastAPI
- Pydantic
- pytest
- Pure Python computational modules
- React or Angular
- REST-based API communication
- Charting and table visualization libraries
- Docker
- Docker Compose
- Persistent storage of monthly average USD exchange rates
- Data model includes month and calculated average
- Designed for periodic monthly updates
- Line graph displaying monthly average exchange rates
- Tabular view with color-based rating:
- Green → highest average value
- Red → lowest average value
- Sorting options:
- By month
- By average rate (ascending)
- Search and highlighting of specific months
- Approximate forecast for the next month
- Forecast is based on the rolling average of the previous three months
The system performs additional analytical operations using matrix-based models:
- Each cell represents a rolling three-month average
- Difference between actual monthly averages and forecasted values
- Additional row calculating the average difference for each three-month window
- Multiplication of the forecast matrix by the difference matrix
- Results displayed in a structured tabular format
- Interactive display triggered by user action
The backend follows a layered architecture:
-
Controllers
HTTP API layer only (FastAPI routes) -
Services
Business logic and orchestration -
Calculations
Pure mathematical logic:- averages
- forecasts
- matrix construction
- matrix multiplication
-
Repositories
Database access layer -
Models
Domain entities -
Schemas
API data transfer objects (DTOs) -
Errors
Domain-specific exceptions
This structure ensures:
- Testability
- Maintainability
- Clear responsibility boundaries
- Component-based UI
- Focused solely on presentation and interaction
- No business or mathematical logic on the client side
- Data retrieved exclusively via REST API
- Unit tests for all mathematical computations:
- Averages
- Forecast calculations
- Matrix operations
- Service-level tests
- Repository-level tests
All calculations are deterministic and fully covered by tests.
docker-compose up --build- Clean Code
- Separation of Concerns
- Thin Client, Strong Backend
- Deterministic and testable computations
- Scalable architecture