A production-quality Banking Employee System built with Java, featuring both CLI and JavaFX GUI interfaces.
Features • Architecture • Installation • Usage • Testing
A comprehensive Banking Employee Back-Office System implemented in Java, designed using clean Object-Oriented Programming (OOP) principles and a layered architecture. The system features strong validation, custom exception handling, audit logging, automated testing, CSV export, and a full JavaFX Desktop GUI.
This project simulates how bank employees manage customers, accounts, and transactions through:
| Interface | Description |
|---|---|
| 🖥️ CLI Application | Console-based interface for terminal users |
| 🪟 JavaFX Desktop GUI | Modern desktop application with rich UI |
| 🧪 JUnit 5 Test Suite | Comprehensive automated testing |
| 📤 CSV Export System | Transaction history export with multiple modes |
| 🔐 RBAC Security | Role-Based Access Control |
⚠️ Scope Notice: This system represents employee-assisted banking operations only. No customer self-service, online banking, or external transfers.
| Category | Technology | Version |
|---|---|---|
| Language | Java | 17 (LTS) |
| GUI Framework | JavaFX | 21.0.2 |
| Build Tool | Maven | 3.x |
| Testing | JUnit Jupiter | 5.10.1 |
| Architecture | Layered / MVC | - |
| Data Storage | In-Memory (Repository Pattern) | - |
| Role | Code | Permissions |
|---|---|---|
| Customer Service | CS |
Create customers, Open accounts |
| Teller | TELLER |
Deposit, Withdraw, View transactions |
| Manager | MANAGER |
Full system access (all operations) |
- Employee login with username/password validation
- Role-based access control enforced at service layer
- Secure session management (login/logout)
- Authorization checks on every operation
- Create customers with Egyptian National ID validation
- Comprehensive National ID validation:
- 14-digit format validation
- Birth date extraction and validation
- Governorate code verification (35 valid codes)
- Century detection (2xxx = 1900s, 3xxx = 2000s)
- Prevent duplicate customers (unique National ID)
- List customers with account count
- Search customers by National ID
| Account Type | Overdraft | Withdrawal Limit |
|---|---|---|
| Savings Account | ❌ No | Limited to balance |
| Current Account | ✅ Yes | Configurable limit |
- 16-digit account numbers (system-generated)
- Multiple accounts per customer supported
- Account numbers masked in display (e.g.,
XXXXXXXXXXXX3456) - Account validation with custom exceptions
| Feature | Description |
|---|---|
| Deposit | Add funds to any account (no fee) |
| Withdrawal | Remove funds with 1% fee |
| Fee Calculation | Real-time fee display in GUI |
| Balance Validation | Polymorphic rules per account type |
Transaction Record (Immutable):
├── Transaction ID (unique)
├── Type (DEPOSIT / WITHDRAWAL)
├── Amount
├── Fee (1% for withdrawals)
├── Total (Amount + Fee)
├── Balance After
├── Timestamp
├── Account Number
└── Audit Trail
├── Employee ID
├── Employee Name
└── Employee Role
Three Export Modes:
| Mode | Trigger | File Pattern |
|---|---|---|
| By Customer | Filter by National ID | transactions_customer_{nationalId}.csv |
| All Transactions | Show All view | transactions_all_{timestamp}_by_{employee}.csv |
| By Account | Legacy/API | transactions_account_{accountNumber}.csv |
Export Features:
- Incremental export (append-only, no duplicates)
- Excel-compatible CSV format
- Automatic
exports/directory creation - Timestamp tracking per export key
CSV Format:
AccountNumber,Type,Amount,BalanceAfter,PerformedBy,Role,Timestamp,TransactionIdThe system validates Egyptian National IDs according to official format:
Position: 1 | 2-3 | 4-5 | 6-7 | 8-9 | 10-13 | 14
Content: C | YY | MM | DD | GOV | SEQ | CHECK
| Component | Description |
|---|---|
| Century (C) | 2 = 1900s, 3 = 2000s |
| Year (YY) | Birth year (00-99) |
| Month (MM) | Birth month (01-12) |
| Day (DD) | Birth day (01-31) |
| Governorate (GOV) | 35 valid codes (01-35) |
| Sequence (SEQ) | Unique identifier |
| Check (CHECK) | Validation digit |
┌─────────────────────────────────────────────────────────────┐
│ PRESENTATION LAYER │
├─────────────────────────────┬───────────────────────────────┤
│ CLI (Console) │ JavaFX (Desktop) │
│ ┌─────────────────────┐ │ ┌─────────────────────┐ │
│ │ BankEmployeeCLI │ │ │ MainApp │ │
│ │ LoginView │ │ │ LoginController │ │
│ │ MenuView │ │ │ DashboardController │ │
│ │ CustomerView │ │ │ CustomerFormCtrl │ │
│ │ AccountView │ │ │ AccountFormCtrl │ │
│ │ TransactionView │ │ │ TransactionFormCtrl │ │
│ └─────────────────────┘ │ └─────────────────────┘ │
├─────────────────────────────┴───────────────────────────────┤
│ SERVICE LAYER │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ BankService (Facade + Singleton) │ │
│ │ ├── AuthenticationService │ │
│ │ ├── AuthorizationService │ │
│ │ ├── AccountService │ │
│ │ └── TransactionService │ │
│ └─────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ REPOSITORY LAYER │
│ ┌─────────────────────────────────────────────────────┐ │
│ │CustomerRepository │ AccountRepository │ TxRepository│ │
│ └─────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ DOMAIN LAYER │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Person ← Customer, Employee │ │
│ │ Account ← SavingsAccount, CurrentAccount │ │
│ │ Transaction, TransactionType, AccountType │ │
│ │ EmployeeRole │ │
│ └─────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ UTILITY LAYER │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ NationalIdValidator │ AccountValidator │ IdGenerator│ │
│ │ NumberFormatter │ TransactionPrinter │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
banking-system/
│
├── pom.xml # Maven configuration
├── README.md # This file
│
├── exports/ # CSV export output directory
│ ├── transactions_customer_*.csv
│ └── transactions_all_*.csv
│
├── src/
│ ├── main/
│ │ ├── java/com/finance/bank/
│ │ │ │
│ │ │ ├── app/ # Entry Points
│ │ │ │ ├── BankEmployeeCLI.java
│ │ │ │ └── MainApp.java
│ │ │ │
│ │ │ ├── model/ # Domain Models
│ │ │ │ ├── Person.java
│ │ │ │ ├── Customer.java
│ │ │ │ ├── Employee.java
│ │ │ │ ├── EmployeeRole.java
│ │ │ │ ├── Account.java
│ │ │ │ ├── SavingsAccount.java
│ │ │ │ ├── CurrentAccount.java
│ │ │ │ ├── AccountType.java
│ │ │ │ ├── Transaction.java
│ │ │ │ └── TransactionType.java
│ │ │ │
│ │ │ ├── repository/ # Data Access Layer
│ │ │ │ ├── CustomerRepository.java
│ │ │ │ ├── AccountRepository.java
│ │ │ │ └── TransactionRepository.java
│ │ │ │
│ │ │ ├── service/ # Business Logic
│ │ │ │ ├── BankService.java
│ │ │ │ ├── AuthenticationService.java
│ │ │ │ ├── AuthorizationService.java
│ │ │ │ ├── AccountService.java
│ │ │ │ └── TransactionService.java
│ │ │ │
│ │ │ ├── exception/ # Custom Exceptions
│ │ │ │ ├── InvalidNationalIdException.java
│ │ │ │ ├── DuplicateNationalIdException.java
│ │ │ │ ├── InvalidAccountException.java
│ │ │ │ ├── DuplicateAccountException.java
│ │ │ │ ├── InvalidAmountException.java
│ │ │ │ ├── InsufficientAmountException.java
│ │ │ │ ├── AuthenticationException.java
│ │ │ │ ├── UnauthorizedException.java
│ │ │ │ ├── AccessDeniedException.java
│ │ │ │ └── ResourceNotFoundException.java
│ │ │ │
│ │ │ ├── util/ # Utilities
│ │ │ │ ├── NationalIdValidator.java
│ │ │ │ ├── AccountValidator.java
│ │ │ │ ├── IdGenerator.java
│ │ │ │ ├── NumberFormatter.java
│ │ │ │ └── TransactionPrinter.java
│ │ │ │
│ │ │ ├── view/ # CLI Views
│ │ │ │ ├── LoginView.java
│ │ │ │ ├── MenuView.java
│ │ │ │ ├── CustomerView.java
│ │ │ │ ├── AccountView.java
│ │ │ │ ├── TransactionView.java
│ │ │ │ └── InputValidator.java
│ │ │ │
│ │ │ └── presentation/ # JavaFX Layer
│ │ │ ├── controllers/
│ │ │ │ ├── LoginController.java
│ │ │ │ ├── DashboardController.java
│ │ │ │ ├── DashboardHomeController.java
│ │ │ │ ├── CustomerFormController.java
│ │ │ │ ├── CustomerListController.java
│ │ │ │ ├── AccountFormController.java
│ │ │ │ ├── AccountListController.java
│ │ │ │ ├── TransactionFormController.java
│ │ │ │ ├── TransactionHistoryController.java
│ │ │ │ └── EmployeeAware.java
│ │ │ └── util/
│ │ │ ├── NavigationManager.java
│ │ │ ├── SessionManager.java
│ │ │ └── AlertHelper.java
│ │ │
│ │ └── resources/com/finance/bank/presentation/
│ │ ├── views/ # FXML Files
│ │ │ ├── login.fxml
│ │ │ ├── dashboard.fxml
│ │ │ ├── dashboard_home.fxml
│ │ │ ├── customer_form.fxml
│ │ │ ├── customer_list.fxml
│ │ │ ├── account_form.fxml
│ │ │ ├── account_list.fxml
│ │ │ ├── transaction_form.fxml
│ │ │ └── transaction_history.fxml
│ │ └── css/
│ │ └── bank-theme.css # Custom Theme
│ │
│ └── test/java/com/finance/bank/test/
│ └── BankingSystemTest.java # JUnit 5 Tests
│
└── target/ # Build output
└── banking-system-2.0.0.jar
| Exception | Scenario |
|---|---|
InvalidNationalIdException |
National ID format/validation failed |
DuplicateNationalIdException |
Customer already exists |
InvalidAccountException |
Account validation failed |
DuplicateAccountException |
Account number already exists |
InvalidAmountException |
Amount ≤ 0 or invalid format |
InsufficientAmountException |
Balance/overdraft limit exceeded |
AuthenticationException |
Login credentials invalid |
UnauthorizedException |
Employee lacks permission |
AccessDeniedException |
Access to resource denied |
ResourceNotFoundException |
Requested resource not found |
| Pattern | Implementation | Purpose |
|---|---|---|
| Singleton | BankService |
Single point of access to business logic |
| Facade | BankService |
Simplified API for complex subsystems |
| Repository | *Repository classes |
Abstract data storage operations |
| MVC | JavaFX Controllers + FXML | Separation of concerns in GUI |
| Strategy | Account.withdraw() |
Different withdrawal rules per account type |
| Template Method | Account abstract class |
Common behavior with customization points |
| Factory | IdGenerator |
Centralized ID generation |
| Observer | JavaFX Property Bindings | Real-time UI updates |
| Feature | Implementation |
|---|---|
| Role-Based Access Control | AuthorizationService checks on every operation |
| Immutable Transactions | All Transaction fields are final |
| Masked Account Numbers | Display as XXXXXXXXXXXX3456 |
| Input Validation | Custom validators for all user input |
| Exception-Driven Security | Custom exceptions for all error scenarios |
| Audit Trail | Every transaction records employee details |
| Session Management | SessionManager for secure employee sessions |
| Defensive Copying | Unmodifiable collections returned from repositories |
🔑 Login Screen
- Employee authentication
- Role detection and display
- Secure session initialization
📊 Dashboard
- Role-based navigation sidebar
- Dynamic content loading
- Employee info display
- Quick action buttons
👤 Customer Management
- Create customer form with validation
- Customer list with search
- Account count per customer
💳 Account Management
- Open Savings/Current accounts
- Configurable overdraft limits
- Account list with filtering
💰 Transactions
- Deposit/Withdraw forms
- Real-time fee calculation
- Dynamic fee information card
- Transaction receipt display
- Transaction history with filters
- Export to CSV
- Custom CSS theme (
bank-theme.css) - Responsive sidebar navigation
- Alert system for feedback
- Form validation with visual feedback
- Data tables with sorting
- Masked sensitive data display
Complete console-based workflow:
┌─────────────────────────────────────────┐
│ FINANCE BANK CLI │
├─────────────────────────────────────────┤
│ 1. Login │
│ 2. Create Customer │
│ 3. Open Account │
│ 4. Deposit │
│ 5. Withdraw │
│ 6. Transaction History │
│ 7. Export CSV │
│ 8. Logout │
│ 0. Exit │
└─────────────────────────────────────────┘
| Category | Tests |
|---|---|
| Authentication | Login success/failure, invalid credentials |
| Authorization | Role-based access, permission denied |
| Customer | Creation, validation, duplicates |
| Account | Opening, validation, types |
| Transactions | Deposit, withdraw, fees, overdraft |
| Exceptions | All custom exception scenarios |
# Run all tests
mvn test
# Run with verbose output
mvn test -Dtest=BankingSystemTest
# Run specific test method
mvn test -Dtest=BankingSystemTest#testDeposit@BeforeEach
void setUp() {
BankService.getInstance().reset(); // Clean state for each test
}- Java 17 or higher
- Maven 3.x
- JavaFX SDK 21 (handled by Maven)
# Clone repository
git clone https://github.com/omar-abdullah-dev/Core-Banking-Backoffice-Java.git
cd BankSystemWIthExceptions
# Build project
mvn clean install
# Run tests
mvn testmvn javafx:run# Using Maven
mvn exec:java -Dexec.mainClass="com.finance.bank.app.BankEmployeeCLI"
# Or run directly from IDE
# Main class: com.finance.bank.app.BankEmployeeCLI| Username | Password | Role |
|---|---|---|
ahmed |
ahmedPass! |
Manager |
mohamed |
mohamedPass! |
Teller |
omar |
omarPass! |
CS |
1. Login as Manager (ahmed/ahmedPass!)
2. Create Customer (Enter valid Egyptian National ID)
3. Open Savings Account for customer
4. Deposit EGP 10,000
5. Withdraw EGP 1,000 (Fee: EGP 10, Total: EGP 1,010)
6. View Transaction History
7. Export to CSV
8. Logout
| Component | Status |
|---|---|
| CLI Application | ✅ Complete |
| JavaFX GUI | ✅ Complete |
| Unit Tests | ✅ Complete |
| CSV Export | ✅ Complete |
| Documentation | ✅ Complete |
| Code Quality | ✅ Production-Ready |
- Database Integration — MySQL/PostgreSQL persistence
- Password Hashing — BCrypt encryption
- Spring Boot API — RESTful web services
- Web Frontend — React/Angular client
- Microservices — Service decomposition
- Logging Framework — SLF4J integration
- Docker Support — Containerization
- CI/CD Pipeline — GitHub Actions
This project is open-source and intended for educational purposes.
Omar Abdullah Moharam
Built with ❤️ to demonstrate clean Java architecture, OOP principles, and production-quality code.