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.
- Features
- Architecture
- Prerequisites
- Installation
- Usage
- Class Structure
- Security Notes
- Contributing
- License
-
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
-
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
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
- Inheritance:
Personbase class extended byUserandAdmin - Encapsulation: Data abstraction with appropriate access modifiers
- Composition:
UsercontainsArrayList<TransactionLog>
- Java Development Kit (JDK): Version 8 or higher
- Operating System: Windows, macOS, or Linux
- Terminal/Command Prompt: For running the application
-
Clone the repository
git clone https://github.com/litch07/banking-system-java.git cd banking-system-java -
Compile the source files
javac *.java -
Verify compilation
# Check for .class files ls *.class
java Main---- 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
-
Sign Up
- Enter name and age (must be 18+)
- Choose username and password
- Set initial deposit amount
-
Sign In
- Enter credentials
- Access personal banking menu:
- View Balance
- Deposit funds
- Withdraw funds
- View transaction history
- Log out
Default Credentials:
- Username:
admin - Password:
admin
Admin Menu:
- View all registered users
- Search for specific users
- Remove user accounts
- Monitor activity logs
- Log out
Base class providing common attributes for users and admins.
Fields:
String name- Person's full nameString username- Unique identifierString password- Authentication credential
Methods:
displayDetails()- Display basic information
Represents a banking customer with full transaction capabilities.
Additional Fields:
int age- User age (minimum 18)double balance- Current account balanceArrayList<TransactionLog> transactionLogs- Personal transaction history
Methods:
deposit(double amount)- Add funds to accountwithdraw(double amount)- Remove funds from accountviewTransactionLogs()- Display transaction history
System administrator with elevated privileges.
Methods:
authenticate(String username, String password)- Verify admin credentialsviewAllUsers(ArrayList<User> users)- List all userssearchUser(ArrayList<User> users, String username)- Find specific userdeleteUser(ArrayList<User> users, String username)- Remove userviewActivityLogs(ArrayList<ActivityLog> activityLogs)- Monitor system activity
Records system-wide events for auditing purposes.
Fields:
String username- ActorString activityType- Event typedouble amount- Associated value (if applicable)LocalDateTime time- Timestamp
Tracks individual financial transactions.
Fields:
String username- Account ownerString transactionType- Deposit/Withdrawdouble amount- Transaction valuedouble newBalance- Balance after transactionLocalDateTime time- Timestamp
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
Contributions are welcome! Here are some ways you can improve this project:
- Add database persistence
- Implement password encryption
- Add more transaction types (transfers, bill payments)
- Create a graphical user interface (GUI)
- Add unit tests
- Implement transaction limits and fraud detection
Steps to Contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or suggestions, please open an issue on GitHub.
⭐ If you found this project helpful, please consider giving it a star!