Bank of Miners represents a modernization initiative that transforms a legacy command-line banking application into a distributed web platform. The core engineering challenge centers on integrating a custom Binary Search Tree (BST) data structure originally designed for single-threaded execution into a multi-threaded Spring Boot environment while maintaining data integrity, performance, and thread safety.
This project demonstrates the application of fundamental computer science principles—specifically data structures, concurrency control, and distributed systems architecture within a production-oriented context. The system bridges academic data structure implementations with enterprise-grade web application patterns.
The project follows a monorepo structure, separating concerns between backend services and frontend presentation:
- Backend: Spring Boot application (Java) serving RESTful APIs
- Frontend: React application (TypeScript) built with Vite, styled with Tailwind CSS
The backend implements a custom in-memory repository pattern using a Binary Search Tree for customer data storage, synchronized with CSV-based persistence. This hybrid approach provides O(log n) lookup performance while maintaining durability through file-based storage.
The system employs a Binary Search Tree (BST) for customer data indexing, providing O(log n) average-case time complexity for search, insert, and update operations. The BST is keyed by customer ID, enabling efficient lookups in a web environment where customer data is frequently accessed.
Concurrency is managed through ReentrantReadWriteLock, allowing multiple concurrent read operations while ensuring exclusive access during write operations. This design pattern maximizes throughput for read-heavy workloads (dashboard queries) while preventing race conditions during transaction processing.
Password security is enforced through BCrypt hashing with automatic migration from legacy plaintext storage. The system validates password hashing at the repository boundary, preventing unhashed credentials from entering the persistence layer.
- Java 17 or higher
- Node.js 18 or higher
- Maven 3.6 or higher
Start the backend server:
cd backend
mvn spring-boot:runThe backend will start on http://localhost:8080.
In a separate terminal, start the frontend development server:
cd frontend
npm install
npm run devThe frontend will start on http://localhost:5173 (or the next available port).
On Unix-like systems (macOS, Linux), you can run both servers in parallel:
(cd backend && mvn spring-boot:run) & (cd frontend && npm install && npm run dev)Backend must be running (mvn spring-boot:run) and Frontend must be running (npm run dev).
Customer ID: 1
Password: 123 (Note: This user is auto-migrated from the CSV).
Verify "Checking", "Savings", and "Credit" cards appear with formatted balances.
- Click "Send Money"
- Select "Checking"
- Enter Target Account:
2(or any valid int) - Enter Amount:
50 - Confirm and verify the balance updates immediately without refresh
.
├── backend/ # Spring Boot REST API
├── frontend/ # React TypeScript application
└── legacy_core/ # Original CLI implementation
- Algorithmic Complexity: O(log n) customer lookups via BST traversal
- Concurrency Model: ReadWriteLock pattern for thread-safe data access
- Persistence Strategy: Write-through cache with CSV synchronization
- Security: BCrypt password hashing with automatic migration
- Testing: Concurrent load testing validates thread safety under stress
For detailed technical documentation, see the respective README files in each module:
- Backend Documentation: Covers the BST repository architecture, thread safety implementation, security patterns, testing strategies, and algorithmic complexity.
- Frontend Documentation: Includes React component architecture, TypeScript patterns, state management, styling approach, and performance optimizations.
These documents provide comprehensive insights into architecture decisions, design patterns, and implementation strategies, connecting academic computer science concepts (e.g., BST algorithms, concurrency patterns) with modern web application development.
The current BST+CSV architecture is designed for educational demonstration of Data Structures and Algorithms (DSA) principles. While it offers O(log n) lookup performance and thread-safe operations, it lacks production-grade scalability and reliability:
- Data Persistence: CSV storage is unsuitable for concurrent multi-user environments and lacks transactional integrity.
- Scalability: In-memory BST cannot scale beyond single-instance deployments.
- Durability: File-based persistence is not atomic and lacks recovery mechanisms.
- Backup/Restore: No automated strategies for backup or point in time recovery.
A production system would use PostgreSQL (for relational data) and Redis (as a caching layer) for enterprise-grade performance and resilience.
While basic authentication and password hashing are provided, production banking systems require:
- OAuth2/JWT: Token-based authentication with refresh support.
- Rate Limiting: Protection against excessive requests and DDoS attacks.
- Audit Logging: Detailed records of financial transactions.
- Data Encryption: Field level encryption for customer data.
- Session Management: Secure session handling with configurable timeouts.
- Multi-Factor Authentication: Added protection beyond passwords.
The current setup uses basic containerization. Production deployments should incorporate:
- Orchestration: Kubernetes for container management and scaling.
- Load Balancing: Distribution across multiple backend/frontend instances.
- Monitoring: Application metrics, error tracking, and performance alerts.
- Secrets Management: Secure rotation and storage of API keys and credentials.
- CI/CD Pipeline: Automated building, testing, and deployment workflows.
- Backup & Recovery: Robust database backup and disaster recovery plans.
This project demonstrates core banking logic, not regulatory compliance:
- PCI DSS: Payment Card Industry Data Security.
- SOX: Sarbanes-Oxley Act for financial auditability.
- AML/KYC: Anti-Money Laundering and Know Your Customer requirements.
- Data Privacy: Compliance with GDPR/CCPA for data protection.
- Audit Trails: Immutable logs for regulatory reporting.
This project is for demonstrating Core Java mechanics and State Management, not a regulatory-compliant banking solution. It is intended as an educational resource for distributed systems, concurrency, and full-stack web development. Production banking systems require additional enhancements for security, compliance, scalability, and operational robustness.
The current architecture effectively bridges academic computer science principles with modern application engineering, illustrating practical applications of theoretical concepts such as BST algorithms and concurrency models.