SecureBankingSystem - is a desktop bankAccount manager built with Python and Tkinter, using SQLite for persistence and Argon2id for secure password/PIN hashing. It supports admin/customer workflows, account creation, deposits/withdrawals, PIN changes, and transaction history—designed for learning secure app patterns and prototyping fintech features
Bank Account Management System
(Tkinter + SQLite + Argon2id)A desktop Bank Account Management System built with Python and Tkinter. It supports admin and customer workflows, stores data in SQLite, and secures credentials with Argon2id hashing. The UI is intentionally simple and fast, while the backend focuses on correctness and safety.
If you read only this README, you should understand how the system works, how the data is stored, and how to operate or extend it.







What This App Does
Admin features
- Create and delete admin accounts
- Create and delete customer accounts
- View customer account summaries
- Secure login with PIN
- Deposit and withdraw funds (with limits)
- Change PIN
- View balance and account summary
- Close account
- Admin passwords and customer PINs are hashed with Argon2id
- SQLite storage (no plaintext credentials)
- Input validation at the service layer
- Transaction updates are atomic
Architecture Overview
The project is split into clear layers:
- UI layer:
bank_app/ui.py
- Service layer:
bank_app/services.py
- Storage layer:
bank_app/storage.py
- Security:
bank_app/security.py
This separation makes the code easier to test, reason about, and change safely.
Data Model (SQLite)
The app stores data in data/bank.db with three tables:
admins
username(unique)password_hashcreated_at
account_number(primary key)pin_hashbalance(integer)created_atnameaccount_type(SavingsorCurrent)dateofbirth(DD/MM/YYYY)mobilegendernationalitykyc_document
account_numberamounttx_type(depositorwithdraw)balance_aftercreated_at
Requirements
- Python 3.10+ (3.11 recommended)
- Tkinter (bundled with most Python installs on Windows/macOS)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
Run the App
From the repo root:
python mainProject.py
You can also run:
python -m bank_app
First-Time Admin Setup
If no admin exists, the Admin Login screen shows a Create First Admin button.
You can also bootstrap via environment variables (optional):
BANKAPPBOOTSTRAPADMIN_IDBANKAPPBOOTSTRAPADMIN_PASSWORD
$env:BANKAPPBOOTSTRAPADMIN_ID="admin"
$env:BANKAPPBOOTSTRAPADMIN_PASSWORD="admin@123"
python mainProject.py
After the first admin is created, normal admin login is enabled.
Usage Walkthrough
Admin
- Open the app and choose Employee
- Log in as admin
- Use the menu to:
Customer
- Open the app and choose Customer
- Log in with account number + PIN
- Use the menu to:
Business Rules
- PIN must be exactly 4 digits
- Passwords must be at least 6 characters
- Minimum balance:
10000 - Max deposit/withdraw per transaction:
25000 - Date format:
DD/MM/YYYY
bankapp/services.py and bankapp/validation.py.
Tests
Install dev dependencies:
pip install -r requirements-dev.txt
Run the test suite:
pytest -q
Tests cover:
- Argon2id hashing and verification
- Validation rules (dates, mobile numbers)
- Core service workflows (admin/customer, deposit/withdraw)
CI (GitHub Actions)
A workflow is included at .github/workflows/python-ci.yml to run tests on pushes and pull requests.
Legacy Data Migration (Optional)
Older versions stored data in flat text files under database/. Those files are now deprecated and not used by the app.
If you need to import legacy data into SQLite:
python scripts/migrate_legacy.py
The script reads:
database/Admin/adminDatabase.txtdatabase/Customer/customerDatabase.txt
Project Structure
bank_app/
config.py
errors.py
security.py
services.py
storage.py
ui.py
scripts/
migrate_legacy.py
tests/
test_security.py
test_services.py
test_validation.py
images/
mainProject.py
README.md
Notes for Contributors
- Keep UI code in
bankapp/ui.pyand business logic inbankapp/services.py. - Always validate inputs in the service layer.
- Avoid storing secrets in plaintext.
- If you add new features, add at least one test.
Troubleshooting
App opens but icons are missing
- Make sure you run the app from the repo root so
images/is discoverable.
- On Linux, install
python3-tkvia your package manager.