A professional analytical tool for financial data, utilizing the National Bank of Poland (NBP) API to provide statistical insights into currency and gold markets.
The application is built using a Service-Oriented Architecture with a clear separation of concerns:
- UI Layer (
UIController):- Manages the DOM, handles user input, and triggers rendering logic.
- Uses a state-cleaner pattern to reset visualizations between analysis runs.
- Service Layer (Facade Pattern -
CurrencyAnalyzer):- Acts as a single entry point for the frontend.
- Orchestrates the data flow between the API service and the analytical engine.
- Data Access Layer (
NBPService):- Handles asynchronous communication with the NBP REST API.
- Implements Request Chunking: Automatically splits long-term requests (e.g., 5 years) into valid 360-day segments to bypass API limitations.
- Mathematical Engine (
AnalysisService):- Pure logic layer performing statistical calculations (Median, StdDev, etc.) and trend detection.
- Ensures Floating Point Precision by rounding all outputs to 4 decimal places.
- A modern web browser (Chrome, Firefox, Edge).
- Node.js (Version 20 and above) for running automated tests.
- Frontend: Open
index.htmldirectly in your browser. No server is required as the app communicates directly with the NBP API via CORS. - Development/Testing:
- Install dependencies:
npm install - Run tests:
npm test
- Install dependencies:
The project utilizes GitHub Actions to maintain code quality and prevent regressions.
- Trigger: The pipeline runs automatically on every
pushorpull_requestto themain,release, ordevelopbranches. - Environment: Runs on
ubuntu-latestwith Node.js 20. - Process:
- Checkouts the source code.
- Installs NPM dependencies.
- Executes the test suite using Jest.
- Headless Testing: E2E simulations are performed in a JSDOM environment, allowing the CI to validate UI logic and API integration without a graphical display.
- Line Charts: Used for historical rate trends.
- Histograms: Used for change distribution across 10 frequency bins.
- Dashboard: Real-time summary chips and statistical cards.
Users can export any generated analysis to CSV format. The exported file includes timestamped data and follows standard quote-escaping rules for maximum compatibility with Excel/Google Sheets.
The release-and-deploy.yml workflow runs on pushes to the release branch and:
- Auto-generates a semantic version tag and a GitHub Release.
- Publishes the static site to GitHub Pages (
upload-pages-artifact→deploy-pages).
Because the app is fully static and talks to the NBP API directly over CORS, the Pages URL is the production deployment — no server component is required.
Release tag note: the tagger uses
default_bump: minor. To emitv2.0.0specifically, setcustom_tag: 2.0.0on the tag step or align it with thepackage.jsonversion.
- Product backlog / user stories: GitHub Projects — add board link here
- UML (activity, sequence, component):
docs/UML.md - Acceptance test report (SRS deviations, Must/Should/Could):
docs/ACCEPTANCE_TEST_REPORT.md
npm test runs the Jest suite (29 tests) covering the API layer, statistical and
session logic, cross-rate/distribution binning, CSV export, and end-to-end UI flows
(UC-001…UC-004) in a jsdom environment. The same command runs in CI on every push
and pull request to main, release, and develop.