Skip to content

Welcome to the repository for the Bank of Miners, a comprehensive, object-oriented banking application developed as part of the Advanced Object-Oriented Programming course at the University of Texas at El Paso. This system is designed to simulate core banking operations while emphasizing principles such as security, scalability, and usability.

Notifications You must be signed in to change notification settings

BryanPMX/bank-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

128 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bank of Miners - Full Stack Banking Platform

Abstract

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.

Architecture Overview

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.

Key Features

High-Performance Data Structures

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.

Thread Safety

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.

Secure Authentication

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.

Quick Start

Prerequisites

  • Java 17 or higher
  • Node.js 18 or higher
  • Maven 3.6 or higher

Running the Application

Start the backend server:

cd backend
mvn spring-boot:run

The backend will start on http://localhost:8080.

In a separate terminal, start the frontend development server:

cd frontend
npm install
npm run dev

The frontend will start on http://localhost:5173 (or the next available port).

Running Both Servers Simultaneously

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)

Manual Testing Guide

Prerequisites

Backend must be running (mvn spring-boot:run) and Frontend must be running (npm run dev).

Login Credentials

Customer ID: 1 Password: 123 (Note: This user is auto-migrated from the CSV).

Test Scenarios

View Dashboard

Verify "Checking", "Savings", and "Credit" cards appear with formatted balances.

Transfer Money

  1. Click "Send Money"
  2. Select "Checking"
  3. Enter Target Account: 2 (or any valid int)
  4. Enter Amount: 50
  5. Confirm and verify the balance updates immediately without refresh

Project Structure

.
├── backend/          # Spring Boot REST API
├── frontend/         # React TypeScript application
└── legacy_core/      # Original CLI implementation

Technical Highlights

  • 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

Development

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.

Production Roadmap & Gap Analysis

Architecture Limits

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.

Security Hardening

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.

Infrastructure & Deployment

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.

Regulatory Compliance

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.

Disclaimer

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.

About

Welcome to the repository for the Bank of Miners, a comprehensive, object-oriented banking application developed as part of the Advanced Object-Oriented Programming course at the University of Texas at El Paso. This system is designed to simulate core banking operations while emphasizing principles such as security, scalability, and usability.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages