Skip to content

Latest commit

 

History

History
247 lines (188 loc) · 6.84 KB

File metadata and controls

247 lines (188 loc) · 6.84 KB

🏦 Console Banking System

Java License

A feature-rich console-based banking application built in Java, demonstrating object-oriented programming principles, inheritance, and role-based access control. This system provides comprehensive banking operations with separate user and administrative interfaces.

📋 Table of Contents

✨ Features

User Features

  • Account Management

    • User registration with age validation (18+ required)
    • Secure login with username and password authentication
    • Personal account dashboard
  • Banking Operations

    • View account balance in real-time
    • Deposit funds with validation
    • Withdraw funds with insufficient balance protection
    • Comprehensive transaction history
  • Security

    • Input validation for all financial transactions
    • Protection against negative amounts
    • Session-based authentication

Admin Features

  • User Management

    • View all registered users
    • Search users by username
    • Remove user accounts
  • System Monitoring

    • View comprehensive activity logs
    • Track all system events (logins, transactions, deletions)
    • Audit trail for compliance

🏗️ Architecture

The system follows object-oriented design principles with a clear class hierarchy:

Person (Base Class)
├── User (extends Person)
│   └── Manages user accounts, transactions, and balance
└── Admin (extends Person)
    └── System administration and monitoring

Supporting Classes:
├── ActivityLog - System-wide event tracking
├── TransactionLog - Per-user financial transaction records
└── Main - Application entry point and UI controller

Design Patterns

  • Inheritance: Person base class extended by User and Admin
  • Encapsulation: Data abstraction with appropriate access modifiers
  • Composition: User contains ArrayList<TransactionLog>

📦 Prerequisites

  • Java Development Kit (JDK): Version 8 or higher
  • Operating System: Windows, macOS, or Linux
  • Terminal/Command Prompt: For running the application

🚀 Installation

  1. Clone the repository

    git clone https://github.com/litch07/banking-system-java.git
    cd banking-system-java
  2. Compile the source files

    javac *.java
  3. Verify compilation

    # Check for .class files
    ls *.class

💻 Usage

Running the Application

java Main

Main Menu Options

---- Welcome ----
1. Sign Up       - Create a new user account
2. Sign In       - Access your account
3. Admin Login   - Administrative access
4. About me      - System information
5. Exit          - Close application

User Workflow

  1. Sign Up

    • Enter name and age (must be 18+)
    • Choose username and password
    • Set initial deposit amount
  2. Sign In

    • Enter credentials
    • Access personal banking menu:
      • View Balance
      • Deposit funds
      • Withdraw funds
      • View transaction history
      • Log out

Admin Workflow

Default Credentials:

  • Username: admin
  • Password: admin

Admin Menu:

  • View all registered users
  • Search for specific users
  • Remove user accounts
  • Monitor activity logs
  • Log out

📁 Class Structure

Person.java

Base class providing common attributes for users and admins.

Fields:

  • String name - Person's full name
  • String username - Unique identifier
  • String password - Authentication credential

Methods:

  • displayDetails() - Display basic information

User.java

Represents a banking customer with full transaction capabilities.

Additional Fields:

  • int age - User age (minimum 18)
  • double balance - Current account balance
  • ArrayList<TransactionLog> transactionLogs - Personal transaction history

Methods:

  • deposit(double amount) - Add funds to account
  • withdraw(double amount) - Remove funds from account
  • viewTransactionLogs() - Display transaction history

Admin.java

System administrator with elevated privileges.

Methods:

  • authenticate(String username, String password) - Verify admin credentials
  • viewAllUsers(ArrayList<User> users) - List all users
  • searchUser(ArrayList<User> users, String username) - Find specific user
  • deleteUser(ArrayList<User> users, String username) - Remove user
  • viewActivityLogs(ArrayList<ActivityLog> activityLogs) - Monitor system activity

ActivityLog.java

Records system-wide events for auditing purposes.

Fields:

  • String username - Actor
  • String activityType - Event type
  • double amount - Associated value (if applicable)
  • LocalDateTime time - Timestamp

TransactionLog.java

Tracks individual financial transactions.

Fields:

  • String username - Account owner
  • String transactionType - Deposit/Withdraw
  • double amount - Transaction value
  • double newBalance - Balance after transaction
  • LocalDateTime time - Timestamp

🔒 Security Notes

⚠️ Educational Purpose Only

This application is designed for learning and demonstration. It contains several intentional simplifications:

  • In-Memory Storage: All data is lost when the application closes
  • Plain Text Passwords: Credentials are not hashed or encrypted
  • No Persistence: No database or file storage implementation
  • Basic Validation: Limited input sanitization

For Production Use, Consider:

  • Password hashing (BCrypt, Argon2)
  • Database integration (MySQL, PostgreSQL)
  • Exception handling for invalid inputs
  • Session management and timeouts
  • Multi-factor authentication
  • Encryption for sensitive data
  • Input sanitization against injection attacks

🤝 Contributing

Contributions are welcome! Here are some ways you can improve this project:

  1. Add database persistence
  2. Implement password encryption
  3. Add more transaction types (transfers, bill payments)
  4. Create a graphical user interface (GUI)
  5. Add unit tests
  6. Implement transaction limits and fraud detection

Steps to Contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📧 Contact

For questions or suggestions, please open an issue on GitHub.


⭐ If you found this project helpful, please consider giving it a star!