How srtepa/cns_course_project works
This Flask application monitors NBRB currency rates, presents current and historical values with analytics, and provides conversion, account, favorites, and settings features. The main workflow is a browser request handled by the routes, which obtain rate data from the API client or JSON cache, optionally analyze history, and render a page. Authentication and preferences are separate supporting branches. The excerpts establish the main service calls and persistence behavior; template and client-side wiring is not fully shown, so those links are limited to documented or directly supported relationships.
Main entry points: main_routes.py Flask routes · app.py Flask app setup · api_client.py NBRB API client · data_manager.py Rate data manager
Components 18
Web application
- Flask routes
controllers/main_routes.py - Page templates
templates - Browser interface
static/js/app.js - App configuration
config.py - Flask app setup
app.py
Rate data
- NBRB API client
services/api_client.py - Retry and breaker
services/network.py - Rate data manager
services/data_manager.py - Rate snapshots
data/rates.json - Rate history model
models/history.py
Accounts and preferences
- Authentication manager
services/auth_manager.py - User records
data/users.json - User settings
data/settings.json
Analysis and presentation
- Currency model
models/currency.py - Rate analytics
services/analytics.py - Date formatting
services/formatting.py
Other components
- Visitor
- NBRB rates API
Connections 22
- Visitor → Flask routes: requests pages
README.md - Flask routes → NBRB API client: fetches rates
controllers/main_routes.py - NBRB API client → NBRB rates API: requests rates
README.md - NBRB API client → Retry and breaker: uses retries
services/api_client.py - Flask routes → Rate data manager: loads snapshots
controllers/main_routes.py - Rate data manager → Rate snapshots: reads and writes
services/data_manager.py - Rate data manager → Rate history model: parses snapshots
services/data_manager.py - NBRB API client → Rate history model: creates snapshots
services/api_client.py - Flask routes → Authentication manager: authenticates users
controllers/main_routes.py - Authentication manager → User records: reads and writes
services/auth_manager.py - Flask routes → User settings: loads preferences
controllers/main_routes.py - Rate data manager → User settings: reads and writes
services/data_manager.py - Flask routes → Rate analytics: analyzes history
controllers/main_routes.py - Flask routes → Currency model: builds currency rows
controllers/main_routes.py - Flask routes → Page templates: renders pages
controllers/main_routes.py - Flask app setup → Flask routes: registers routes
app.py - Flask app setup → Rate data manager: configures storage
app.py - Flask app setup → NBRB API client: configures client
app.py - Flask app setup → Authentication manager: configures accounts
app.py - Flask app setup → Date formatting: registers filter
app.py - App configuration → Flask app setup: provides settings
app.py - Browser interface → Flask routes: submits interactions