Skip to content

akshawop/banking-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ Banking System Project Documentation

Welcome to the Banking System project! This guide will help you set up, understand, and run the project on your local machine using Visual Studio Code or any Java IDE. πŸš€


1. πŸ—‚ Project Structure

Banking System/
β”‚
β”œβ”€β”€ src/                        # β˜• Java source code
β”‚   └── me/akshawop/banking/
β”‚        β”œβ”€β”€ cli/               # πŸ–₯ Command Line Interfaces (CLIs)
β”‚        β”‚    β”œβ”€β”€ AccountCLI.java
β”‚        β”‚    β”œβ”€β”€ ATM.java
β”‚        β”‚    β”œβ”€β”€ BankCLI.java
β”‚        β”‚    β”œβ”€β”€ BranchCLI.java
β”‚        β”‚    β”œβ”€β”€ CustomerCLI.java
β”‚        β”‚    └── inputmodules/        # πŸ“ Forms and Inputs for User interaction
β”‚        β”‚         β”œβ”€β”€ NewAddress.java
β”‚        β”‚         β”œβ”€β”€ UpdateAddress.java
β”‚        β”‚         └── forms/
β”‚        β”‚              β”œβ”€β”€ CreateBankForm.java
β”‚        β”‚              β”œβ”€β”€ CreateBranchForm.java
β”‚        β”‚              β”œβ”€β”€ NewAccountForm.java
β”‚        β”‚              β”œβ”€β”€ NewCustomerForm.java
β”‚        β”‚              β”œβ”€β”€ UpdateBankForm.java
β”‚        β”‚              └── UpdateCustomerForm.java
β”‚        β”œβ”€β”€ customtype/               # πŸ“¦ Custom data types
β”‚        β”‚    └── Address.java
β”‚        β”œβ”€β”€ sql/                       # πŸ—ƒοΈ SQL query helpers
β”‚        β”‚    └── SQLQueries.java
β”‚        β”œβ”€β”€ sys/                       # βš™οΈ Core system classes & DAOs
β”‚        β”‚    β”œβ”€β”€ Account.java
β”‚        β”‚    β”œβ”€β”€ AccountDAO.java
β”‚        β”‚    β”œβ”€β”€ AccountStatus.java
β”‚        β”‚    β”œβ”€β”€ AccountType.java
β”‚        β”‚    β”œβ”€β”€ Bank.java
β”‚        β”‚    β”œβ”€β”€ BankDAO.java
β”‚        β”‚    β”œβ”€β”€ Branch.java
β”‚        β”‚    β”œβ”€β”€ BranchDAO.java
β”‚        β”‚    β”œβ”€β”€ Card.java
β”‚        β”‚    β”œβ”€β”€ CardDAO.java
β”‚        β”‚    β”œβ”€β”€ CardStatus.java
β”‚        β”‚    β”œβ”€β”€ CardType.java
β”‚        β”‚    β”œβ”€β”€ Customer.java
β”‚        β”‚    β”œβ”€β”€ CustomerDAO.java
β”‚        β”‚    β”œβ”€β”€ DB.java               # πŸ”Œ Database connection config
β”‚        β”‚    β”œβ”€β”€ Transaction.java
β”‚        β”‚    β”œβ”€β”€ TransactionDAO.java
β”‚        β”‚    β”œβ”€β”€ TransactionMode.java
β”‚        β”‚    └── TransactionType.java
β”‚        └── util/                      # πŸ› οΈ Utility classes & exceptions
β”‚             β”œβ”€β”€ AccountBlockedException.java
β”‚             β”œβ”€β”€ CardBlockedException.java
β”‚             β”œβ”€β”€ ClearScreen.java
β”‚             β”œβ”€β”€ IncorrectPinException.java
β”‚             β”œβ”€β”€ InputChecker.java
β”‚             β”œβ”€β”€ InputPIN.java
β”‚             └── NotEnoughBalanceException.java
β”‚
β”œβ”€β”€ lib/                        # πŸ“¦ External libraries (JARs)
β”‚   β”œβ”€β”€ jline-3.30.4.jar
β”‚   └── mysql-connector-j-9.3.0.jar
β”‚
β”œβ”€β”€ sql/                        # πŸ—„ SQL schema for database setup
β”‚   └── schema.sql
β”‚
β”œβ”€β”€ bin/                        # πŸ—οΈ Compiled Java classes (after build)
β”‚
β”œβ”€β”€ windows/                    # πŸ’» Windows scripts for compiling and running
β”‚   β”œβ”€β”€ atm.ps1
β”‚   β”œβ”€β”€ bank.ps1
β”‚   β”œβ”€β”€ branch.ps1
β”‚   └── compile.ps1
β”‚
β”œβ”€β”€ linux/                      # 🐧 Linux / macOS shell scripts for compiling and running
β”‚   β”œβ”€β”€ atm.sh
β”‚   β”œβ”€β”€ bank.sh
β”‚   β”œβ”€β”€ branch.sh
β”‚   └── compile.sh
β”‚
β”œβ”€β”€ .gitignore 🚫
β”œβ”€β”€ .gitattributes βš™οΈ
└── README.md πŸ“˜

2. βš™οΈ Prerequisites

  • Java JDK 17 or higher installed (Download here)β˜•

  • MySQL Server πŸ—„ running locally (or update connection settings in DB.java)

  • Visual Studio Code πŸ’» (recommended) or any Java IDE

  • VS Code Extensions:

    • Extension Pack for Java πŸ“¦
    • Java Dependency Viewer πŸ”
    • Code Runner (optional) βœ…

3. πŸ— Setting Up the Database

  1. Start your MySQL server. πŸ”Œ
  2. Open sql/schema.sql and run its contents in your MySQL client πŸ“„βœ…

4. πŸ›  Configuring the Project

  • Dependencies: MySQL Connector/J πŸ—„ and JLine ✍️ (in lib/)
  • Database Connection πŸ”‘: Edit src/me/akshawop/banking/sys/DB.java to match your MySQL username, password, and database name.

5. πŸƒ Building and Running

A. Compile the Project

Windows (PowerShell) πŸ’»

./windows/compile.ps1

Linux / macOS (Shell) 🐧

./linux/compile.sh

Manual Compilation πŸ› οΈ

javac -cp "lib/*" -d bin src/me/akshawop/banking/**/*.java

B. Run CLI Applications πŸ–₯️

Each CLI file represents a different role in the banking system.

1. BankCLI πŸ¦πŸ‘”

  • Purpose: Manage banks and branches

  • Main File: src/me/akshawop/banking/cli/BankCLI.java

  • Run:

    • Windows πŸ’»:
      ./windows/bank.ps1
    • Linux/macOS 🐧:
      ./linux/bank.sh
    • Manual:
      # windows
      java -cp "bin;lib/*" me.akshawop.banking.cli.BankCLI
      # linux / macOS
      java -cp "bin:lib/*" me.akshawop.banking.cli.BankCLI
  • What it does:

    • Allows creation and management of banks and branches 🏒
    • Uses BankDAO for database operations πŸ—„
    • Helper forms in inputmodules/forms/ for user input ✍️

2. BranchCLI πŸ›οΈπŸ‘”

  • Purpose: Manage customers, accounts, and branch operations

  • Main File: src/me/akshawop/banking/cli/BranchCLI.java

  • Run:

    • Windows πŸ’»:
      ./windows/branch.ps1
    • Linux/macOS 🐧:
      ./linux/branch.sh
    • Manual:
      # windows
      java -cp "bin;lib/*" me.akshawop.banking.cli.BranchCLI
      # linux / macOS
      java -cp "bin:lib/*" me.akshawop.banking.cli.BranchCLI
  • What it does:

    • Allows branch officials to add/update customers πŸ‘€, manage accounts πŸ’°, issue cards πŸ’³, and handle transactions πŸ’Έ
    • Uses BranchDAO for branch-specific database operations πŸ—„
    • Helper forms ✍️ and utility classes for input validation and screen clearing πŸ§Ήβœ…

3. ATM πŸ§πŸ‘€

  • Purpose: Simulate ATM operations

  • Main File: src/me/akshawop/banking/cli/ATM.java

  • Run:

    • Windows πŸ’»:
      ./windows/atm.ps1
    • Linux/macOS 🐧:
      ./linux/atm.sh
    • Manual:
      # windows
      java -cp "bin;lib/*" me.akshawop.banking.cli.ATM
      # linux / macOS
      java -cp "bin:lib/*" me.akshawop.banking.cli.ATM
  • What it does:

    • Allows customers to log in πŸ”’, check balances πŸ’°, withdraw/deposit money πŸ’Έ, and view transactions 🧾
    • Uses AccountDAO, TransactionDAO, and related classes for account and transaction management πŸ—„

6. βš™ How the System Works

CLI Classes (User Interfaces) πŸ–₯️

  • BankCLI: 🏦 manages banks and branches 🏒, uses BankDAO πŸ—„, forms ✍️
  • BranchCLI: πŸ›οΈ manages customers πŸ‘€ and accounts πŸ’°, uses BranchDAO πŸ—„, forms ✍️ and utils πŸ§Ήβœ…
  • ATM: 🏧 customer interface, interacts with AccountDAO πŸ’°, TransactionDAO πŸ’Έ

DAO Classes πŸ—„

  • BankDAO 🏦, BranchDAO πŸ›οΈ, AccountDAO πŸ’°, CustomerDAO πŸ‘€, TransactionDAO πŸ’Έ, CardDAO πŸ’³

Helper Classes πŸ› οΈ

  • Forms ✍️(inputmodules/forms/):
    Collect and validate user input for creating/updating entities.

  • Utils 🧹(util/):

    • ClearScreen: Clears the console for better UX.
    • InputChecker: Validates user input.
  • Custom exceptions for error handling ⚠️❌


7. 🎭 Roleplay Usage

  • Bank Official 🏦 β†’ BankCLI
  • Branch Official πŸ›οΈ β†’ BranchCLI
  • Customer 🏧 β†’ ATM

8. πŸ›‘ Troubleshooting

  • Database errors πŸ—„ Check your MySQL connection settings (in the DB.java file) and ensure the schema is set up in the database (schema.sql).
  • Class not found πŸ“¦ Make sure you compile with the correct classpath (lib/* for JARs).
  • Input issues ⚠️ Ensure your terminal is focused when running CLI programs.

9. 🎨 Customization

  • Add roles βž• Create new CLI classes in cli/ and corresponding DAOs in sys/.
  • Change database πŸ”‘ Update DB.java for different database engines or credentials.
  • Add features ✨ Extend forms, DAOs, and CLI classes as needed.

10. πŸ“š Additional Resources


πŸŽ‰Enjoy exploring and roleplaying with your Banking System project!

If you have any questions or need help, check the comments in the code, see the error messages or DM me on instagram.πŸ“

About

Made a small scale CLI based banking system made in java(just for practice)

Topics

Resources

Stars

Watchers

Forks

Languages