Skip to content

acoliver/fakebank

Repository files navigation

FakeBank Microservices Demo Project

⚠️ IMPORTANT: This is a demonstration project for data lineage testing purposes only. DO NOT use in production environments.

Overview

FakeBank is a comprehensive microservices-based banking demonstration system designed specifically for testing data lineage, service dependencies, and distributed systems monitoring. This project simulates a realistic banking environment with multiple interconnected services, each responsible for specific business capabilities.

⚠️ Disclaimer

This project is for educational and testing purposes only:

  • Contains intentionally simplified security implementations
  • Uses demo data and mock credentials
  • Has known UI bugs and incomplete features
  • Not suitable for production use
  • All data is fictional and for demonstration only

🏗️ Architecture

FakeBank consists of six interconnected microservices:

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│    Security     │     │    Consumer     │     │  Credit Rating  │
│   Service       │     │   Service       │     │    Service      │
│   (Port 3001)   │     │   (Port 3000)   │     │   (Port 3003)   │
└────────┬────────┘     └────────┬────────┘     └────────┬────────┘
         │                       │                       │
         │   JWT Auth            │  Customer Data        │  Credit Scores
         │                       │                       │
         └───────────────────────┴───────────────────────┘
                                 │
                        ┌────────▼────────┐
                        │                 │
                        │    Accounts     │
                        │    Service      │
                        │  (Port 3002)    │
                        └────────┬────────┘
                                 │
         ┌───────────────────────┴───────────────────────┐
         │                                               │
┌────────▼────────┐                             ┌────────▼────────┐
│ Risk Assessment │                             │   FakeBank Web  │
│    Service      │                             │     Portal      │
│  (Port 3009)    │                             │   (Port 3004)   │
└─────────────────┘                             └─────────────────┘

🚀 Services Overview

1. Security Service (Port 3001)

  • JWT-based authentication and authorization
  • User management with role-based access control
  • Token generation and verification
  • Detailed Documentation

2. Consumer Service (Port 3000)

  • Customer data management
  • SSN encryption and secure search
  • Soft delete with audit trails
  • Detailed Documentation

3. Accounts Service (Port 3002)

  • Multi-account type management (checking, savings, credit, etc.)
  • Transaction history and snapshots
  • Balance tracking and statements
  • Detailed Documentation

4. Credit Rating Service (Port 3003)

  • Credit score calculations (FICO-like)
  • Soft and hard credit pulls
  • Credit history simulation
  • Detailed Documentation

5. Risk Assessment Service (Port 3009)

  • Risk scoring for loan applications
  • Product-specific risk analysis
  • Integration with credit rating data
  • Detailed Documentation

6. FakeBank Web Portal (Port 3004)

  • Customer service web interface
  • Credit application processing
  • Audit logging and compliance
  • Note: Contains known UI bugs - work in progress
  • Detailed Documentation

📋 Prerequisites

  • Node.js 20.x or higher
  • npm 9.x or higher
  • Docker 20.10+ (optional but recommended)
  • 8GB RAM minimum for running all services
  • SQLite3 (automatically installed with npm)

🛠️ Quick Start

Option 1: Run All Services with Docker

# Clone the repository
git clone https://github.com/fakebank/fakebank.git
cd fakebank

# Start all services
docker-compose up -d

# Check service health
./scripts/health-check-all.sh

Option 2: Run Services Individually

# Install dependencies for each service
for service in security consumer accounts creditrating riskassessment fakebankweb; do
  cd $service
  npm install
  cd ..
done

# Start services in order (important for dependencies)
cd security && npm start &
cd consumer && npm start &
cd accounts && npm start &
cd creditrating && npm start &
cd riskassessment && npm start &
cd fakebankweb && npm run dev &

👥 Default Users

Username Password Role Access Level
admin Admin123! SUPERVISOR Full system access
manager1 Manager123! BRANCH_MANAGER Approve applications
cs_agent1 Agent123! CUSTOMER_SERVICE Create applications
analyst1 Analyst123! INFORMATION Read-only access

🔧 Configuration

Each service has its own .env configuration. Key settings:

# Common across services
NODE_ENV=development
LOG_LEVEL=info

# Service-specific ports
SECURITY_SERVICE_URL=http://localhost:3001
CONSUMER_SERVICE_URL=http://localhost:3000
ACCOUNTS_SERVICE_URL=http://localhost:3002
CREDITRATING_SERVICE_URL=http://localhost:3003
RISK_ASSESSMENT_SERVICE_URL=http://localhost:3009

# Security
JWT_SECRET=your-secret-key-at-least-32-characters-long
JWT_EXPIRES_IN=1h

# Database paths
DATABASE_PATH=./data/[service-name].db

📊 Data Lineage Testing

This project includes data lineage tracking capabilities:

  1. Service Dependencies: Each service tracks its upstream and downstream dependencies
  2. Data Flow Monitoring: Request tracing across service boundaries
  3. Audit Logging: Complete audit trail of all data modifications
  4. Lineage Files: Located in data/fakebank/[service]/lineage.json

Example Data Flow

Customer Search → Consumer Service → Security Service (Auth)
                                  ↓
                           Accounts Service → Account Data
                                  ↓
                        Credit Rating Service → Credit Score
                                  ↓
                      Risk Assessment Service → Risk Score
                                  ↓
                           Web Portal → Application Decision

🧪 Testing

Each service includes comprehensive tests:

# Run tests for a specific service
cd [service-name]
npm test

# Run integration tests
npm run test:integration

# Run E2E tests (requires all services running)
cd fakebankweb
npm run test:e2e

🐛 Known Issues

  1. UI Bugs in Web Portal:

    • Form validation issues on credit applications
    • Table sorting inconsistencies
    • Mobile responsive layout problems
    • Session timeout handling needs improvement
  2. Performance:

    • SQLite databases not suitable for high load
    • No caching layer implemented
    • Service discovery is hardcoded
  3. Security:

    • Simplified authentication for demo purposes
    • No rate limiting on some endpoints
    • CORS configured for wildcard origins

📚 Documentation

🤝 Contributing

While this is a demo project, contributions are welcome for:

  • Bug fixes (especially UI issues)
  • Documentation improvements
  • Test coverage expansion
  • Performance optimizations

Please read CONTRIBUTING.md before submitting PRs.

📄 License

MIT License - This is demonstration software only.

⚠️ Final Warning

DO NOT USE IN PRODUCTION

This project:

  • Contains hardcoded credentials
  • Uses simplified security measures
  • Has incomplete error handling
  • Includes test data generators
  • Is designed for lineage testing only

For questions or issues, please use the GitHub issue tracker.

Built for data lineage testing by the FakeBank Team 🏦

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published