A modern, enterprise-grade platform for managing Treasury and Collateral operations, built with Spring Boot, React, Kafka, and PostgreSQL.
- Key Features
- Technology Stack
- System Architecture
- Project Structure
- Quick Start Guide
- API Overview
- Frontend Overview
- Testing
- Contributing
- License
- Full CRUD for treasury accounts (create, update, delete, view)
- Advanced filtering by status, type, currency, bank
- Fund transfers between accounts with validation
- Real-time balance and available balance tracking
- Low balance alerts and summary reports
- Full CRUD for collaterals (bonds, stocks, real estate, etc.)
- Dynamic valuation, haircut calculation, eligibility engine
- Expiry monitoring, risk analytics, and high-risk detection
- Advanced search and reporting (by type, rating, currency, etc.)
- Real-time eligible value and risk exposure calculation
- JWT authentication with role-based access (ADMIN, TREASURY, COLLATERAL, USER)
- Registration, login, logout, and profile endpoints
- Password encryption (BCrypt)
- User enable/disable, role management, and audit events
- Modern dashboard with KPIs (total balance, eligible collaterals, etc.)
- Interactive charts (bar, pie) for account and collateral distribution
- Real-time updates via Kafka event-driven architecture
- Apache Kafka for event streaming (user, treasury, collateral, audit, notification)
- Microservices-ready modular backend
- RESTful API with CORS and rate limiting
- Docker Compose for local development (PostgreSQL, Kafka, Zookeeper)
- Spring Boot 3.2+ (Docs)
- Spring Security (Docs)
- Spring Data JPA (Docs)
- Apache Kafka (Docs)
- JWT (jjwt) (Docs)
- PostgreSQL (Docs)
- H2 Database (for dev/testing)
- Lombok (Docs)
- React 18+ (Docs)
- Material-UI (MUI) 5+ (Docs)
- Axios (Docs)
- React Router v6 (Docs)
- Recharts (Docs)
- Framer Motion (Docs)
graph TD
subgraph "Frontend"
A[React SPA] --> B[MUI Components]
B --> C[Axios HTTP Client]
end
subgraph "API Gateway"
D[Spring Boot API]
E[JWT Auth]
F[CORS]
end
subgraph "Business Layer"
G[Treasury Service]
H[Collateral Service]
I[User Service]
J[Risk Engine]
end
subgraph "Data Layer"
K[JPA Repositories]
L[PostgreSQL]
end
subgraph "Messaging"
M[Kafka Producer]
N[Kafka Consumer]
O[Event Store]
end
C --> D
D --> E
D --> F
D --> G
D --> H
G --> K
H --> K
K --> L
G --> M
H --> M
N --> J
M --> O
TCMTreino/
βββ backend/ # Spring Boot API (Java)
β βββ src/main/java/com/treasury/kpstreasury/
β β βββ controllers/ # REST endpoints
β β βββ services/ # Business logic
β β βββ repositories/ # Data access
β β βββ models/ # Entities & DTOs
β β βββ config/ # Security, Kafka, JWT
β β βββ events/ # Kafka event models
β β βββ utils/ # Mappers
β βββ src/main/resources/
β β βββ application.properties
β βββ pom.xml
βββ frontend/ # React SPA (JS)
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Main pages (Dashboard, Treasury, Collateral, Auth)
β β βββ services/ # API clients
β β βββ contexts/ # Auth context
β β βββ theme/ # MUI theme
β βββ package.json
βββ docker-compose.yml # Local dev stack (Kafka, Postgres)
βββ README.md
docker-compose up -dcd backend
mvn clean install
mvn spring-boot:run- API: http://localhost:8080/api
- Swagger UI: http://localhost:8080/swagger-ui.html (if enabled)
cd frontend
npm install
npm startPOST /api/auth/loginβ User login (JWT)POST /api/auth/registerβ User registrationPOST /api/auth/logoutβ LogoutGET /api/auth/meβ Get current userGET /api/auth/validate-tokenβ Validate JWT
GET /api/treasuryβ List all accountsPOST /api/treasuryβ Create accountPUT /api/treasury/{id}β Update accountDELETE /api/treasury/{id}β Delete accountPOST /api/treasury/transferβ Transfer fundsGET /api/treasury/reports/total-balanceβ Total balance by currency/status- ...and more (see code/docs)
GET /api/collateralβ List all collateralsPOST /api/collateralβ Create collateralPUT /api/collateral/{id}β Update collateralDELETE /api/collateral/{id}β Delete collateralGET /api/collateral/reports/total-eligible-valueβ Total eligible value- ...and more (see code/docs)
GET /api/usersβ List users (admin)PUT /api/users/{id}β Update userPUT /api/users/{id}/change-passwordβ Change password- ...and more
Full API details: See Spring Boot Controller code or Swagger UI if enabled.
- Login/Register: Secure authentication, registration, and JWT session management
- Dashboard: KPIs, charts, and quick stats for treasury and collateral
- Treasury: Manage accounts, transfer funds, view balances, filter/search
- Collateral: Manage collaterals, eligibility, risk, and reporting
- Responsive UI: Modern Material-UI design, dark/light mode, animated transitions
cd backend
mvn testcd frontend
npm testWe welcome contributions! Please fork the repo, create a feature branch, and submit a pull request.
This project is licensed under the MIT License. See LICENSE for details.
Built with passion for modern financial systems.
