https://github.com/akshawop/banking-system
Made a small scale CLI based banking system made in java(just for practice)
https://github.com/akshawop/banking-system
banking-system java jdbc jline mysql practice-project
Last synced: 2 months ago
JSON representation
Made a small scale CLI based banking system made in java(just for practice)
- Host: GitHub
- URL: https://github.com/akshawop/banking-system
- Owner: akshawop
- Created: 2025-07-03T21:26:32.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-14T18:18:06.000Z (11 months ago)
- Last Synced: 2025-08-14T20:26:17.195Z (11 months ago)
- Topics: banking-system, java, jdbc, jline, mysql, practice-project
- Language: Java
- Homepage:
- Size: 3.71 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
๏ปฟ# ๐๏ธ 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](https://adoptium.net/))โ
- **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)** ๐ป
```sh
./windows/compile.ps1
```
#### **Linux / macOS (Shell)** ๐ง
```sh
./linux/compile.sh
```
#### **Manual Compilation** ๐ ๏ธ
```sh
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 ๐ป:
```sh
./windows/bank.ps1
```
- Linux/macOS ๐ง:
```sh
./linux/bank.sh
```
- Manual:
```sh
# windows
java -cp "bin;lib/*" me.akshawop.banking.cli.BankCLI
```
```sh
# 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 ๐ป:
```sh
./windows/branch.ps1
```
- Linux/macOS ๐ง:
```sh
./linux/branch.sh
```
- Manual:
```sh
# windows
java -cp "bin;lib/*" me.akshawop.banking.cli.BranchCLI
```
```sh
# 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 ๐ป:
```sh
./windows/atm.ps1
```
- Linux/macOS ๐ง:
```sh
./linux/atm.sh
```
- Manual:
```sh
# windows
java -cp "bin;lib/*" me.akshawop.banking.cli.ATM
```
```sh
# 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
- [VS Code Java Docs](https://code.visualstudio.com/docs/java/java-tutorial) ๐ป
- [MySQL Connector/J Docs](https://dev.mysql.com/doc/connector-j/en/) ๐
- [JLine Docs](https://github.com/jline/jline3) โ๏ธ
---
### ๐**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.๐