A Node.js + Express API that analyzes SME bank statement CSV files and generates a counterparty concentration risk report.
The service processes inflow and outflow transactions, normalizes noisy counterparty names, detects concentration risks, and provides a simple risk recommendation.
- Upload SME bank statement CSV files
- Analyze top inflow and outflow counterparties
- Normalize and deduplicate noisy counterparty names
- Detect concentration risk flags
- Monthly inflow concentration trend analysis
- Risk scoring system (
0 = diversified,100 = high concentration risk) - Recommendation engine
- Swagger API documentation
- Unit test coverage
- Node.js
- Express.js
- Multer
- CSV Parser
- Jest
- Swagger UI
Upload a CSV bank statement file and receive a concentration risk analysis report.
{
"concentration_score": 50,
"recommendation": {
"decision": "investigate_concentration"
}
}Make sure Node.js is installed on your machine.
Check installation:
node -v
npm -vnpm cinpm run devnpm run mainnpm run testAfter starting the server, open:
http://localhost:3000
You can directly upload a CSV file and test the API from Swagger UI.
src/
├── index.js
├── services/
├── utils/
tests/
index.js→ API routes and Swagger setupservices/→ core business logicutils/→ normalization, fuzzy matching, scoringtests/→ unit tests
- Used rule-based scoring instead of ML to keep the system explainable and easier to review.
- Used normalization + fuzzy matching instead of hardcoded aliases for better scalability across datasets.
- Focused specifically on concentration risk instead of building a full credit underwriting engine.
AI was used as a pair-programming assistant for:
- project structuring
- Swagger setup
- debugging Express/multer issues
- improving normalization logic
- creating test cases
- validating output against requirements
AI initially suggested a reversed scoring model where 100 = good, but the requirement expected 100 = high concentration risk. This was corrected after validating the assessment requirements manually.
AI also missed some counterparty deduplication edge cases initially, which were identified by reviewing the generated JSON output and refining normalization/fuzzy matching logic.
- Better entity resolution and fuzzy matching
- Docker support
- Improved audit trail for merged counterparties
- More edge-case and performance tests
- Better CSV validation and error handling
Ashit Chuphal