A robust C++ banking system with dual persistence support (SQLite3 and JSON) featuring account management and transaction operations.
The Universal Bank System is a command-line banking application that provides comprehensive account management capabilities. It features a flexible persistence layer that can store data either in SQLite3 database or JSON files, configurable through a simple configuration file.
- Account creation and management
- Balance inquiry and transaction operations
- Multiple storage backend support (SQLite/JSON)
- Detailed account history tracking
- Person-centric account viewing
- Configurable persistence layer
- C++17 compatible compiler
- SQLite3 development libraries
- nlohmann/json library
- CMake 3.10 or higher
-
Clone the repository
git clone https://github.com/your-username/bank_system.git cd bank_system -
Install dependencies (Ubuntu/Debian)
sudo apt update sudo apt install build-essential cmake libsqlite3-dev
-
Build the project
mkdir build && cd build cmake .. make
The system uses a config.json file to determine the storage backend:
{
"persistence": {
"json_file_path": "bank_data.json",
"sqlite_file_path": "bank_data.sqlite",
"storage_type": "sqlite"
}
}- Set
storage_typeto either"sqlite"or"json"to choose the storage backend - Configure file paths for both SQLite and JSON storage
-
Create Account (Option 1)
- Create new bank account with initial deposit
- Requires name and national ID
-
Delete Account (Option 2)
- Remove existing account by ID
-
Balance Inquiry (Option 3)
- Check account balance using account ID
-
Show Person Accounts (Option 4)
- View all accounts owned by a specific person
-
Show Account Details (Option 5)
- View comprehensive account information including:
- Account owner
- Last operation details
- Account creation time
- Transaction history
- View comprehensive account information including:
-
Deposit (Option 6)
- Add funds to an account
-
Withdrawal (Option 7)
- Remove funds from an account
./bankSample interaction:
Welcome to Universal Bank System
Please enter the number for your choice:
1: Create Account
2: Delete Account
3: Balance Inquiry
4: Show Person Accounts
5: Show Account Details
6: Deposit
7: Withdrawal
8: Exit
The system supports two types of data storage:
-
SQLite Storage
- Relational database storage
- Transaction-safe operations
- Efficient querying capabilities
-
JSON Storage
- File-based storage
- Human-readable format
- Easy backup and transfer
- National ID verification
- Transaction logging
- Operation timestamps
- Unique account IDs
- Data persistence verification
The system includes comprehensive error handling for:
- Invalid account operations
- Insufficient funds
- Database constraints
- Configuration issues
- Data loading/saving errors
bank_system/
├── bank_system.cpp # Main application entry
├── include/
│ ├── bank.h # Bank operations
│ ├── cli.h # Command line interface
│ ├── serialization.h # JSON serialization
│ ├── config_manager.h # Configuration handling
│ └── sqlite.h # SQLite operations
└── src/
└── [Implementation files]
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Add Qt QML GUI Front-end
- Multi-currency support
- Interest calculation
- Account types (Savings, Current)
- Transaction categories
- Export statements
- User authentication
For support, please open an issue in the GitHub repository or contact the maintainers.

