Built with Avalonia UI (.NET) on the front end and MySQL on the back end — every piece of business logic (approvals, balance checks, interest calculation, transfers) lives in stored procedures, not in ORM magic.
- Overview
- Features
- Architecture
- Tech Stack
- Database Design
- Security
- Getting Started
- Role-Based Access at a Glance
- Project Structure
- Documentation
- Screenshots
- Roadmap
- Contributors
- License
BankApp simulates the internal system a real bank would use to run its day-to-day operations across multiple branches — onboarding customers, opening accounts, processing deposits/withdrawals/transfers, issuing and repaying loans, managing staff, and keeping a full audit trail of who did what and when.
It was built as a database management course project, but grew well past a typical CRUD assignment: it models a realistic loan approval pipeline, branch-scoped access control, automatic interest-bearing installment scheduling, and a two-layer activity/audit logging system — all backed by 95 stored procedures and zero ORM.
|
|
BankApp is a 2-project solution following clean separation between UI and core logic:
┌─────────────────────────────────────────────────────────┐
│ BankApp.UI │
│ Avalonia · MVVM · CommunityToolkit.Mvvm │
│ Views ←→ ViewModels ←→ (DI) ←→ Repositories │
└───────────────────────────┬───────────────────────────────┘
│
┌────────────────────────────▼──────────────────────────────┐
│ BankApp.Core │
│ Repositories · Models · Security (BCrypt) │
│ MySqlConnector — parameterized calls only, no ORM │
└───────────────────────────┬───────────────────────────────┘
│
┌────────────────────────────▼──────────────────────────────┐
│ MySQL │
│ 14 tables · 95 stored procedures │
│ All business rules enforced here — balance checks, │
│ approval gating, uniqueness, transactional integrity │
└─────────────────────────────────────────────────────────────┘
Key architectural decisions:
- MVVM throughout, powered by
CommunityToolkit.Mvvm's source generators ([ObservableProperty],[RelayCommand]) — no hand-written boilerplate. - Constructor-based dependency injection via
Microsoft.Extensions.DependencyInjection. Every repository and page-level ViewModel is resolved through the container (ServiceCollectionExtensions.cs), configured once at startup inApp.axaml.cs. - No ORM. Every single database call goes through a stored procedure, invoked with
typed
MySqlParameterobjects — this was a hard project requirement, and it also means the SQL layer can be reasoned about, tested, and secured independently of the application code. - Repository pattern — one repository per aggregate (
AccountRepository,LoanRepository,EmployeeRepository, …), each responsible for mapping stored procedure result sets onto plain C# models. - Role-scoping lives in SQL, not just in the UI. A Branch Manager's queries are scoped inside the stored procedure itself (by resolving their branch from their employee ID), not merely hidden by the client — so the access boundary holds even if a procedure is called directly.
| Layer | Technology |
|---|---|
| UI Framework | Avalonia UI 12.0 (cross-platform, XAML-based) |
| Pattern | MVVM via CommunityToolkit.Mvvm 8.4 |
| Dependency Injection | Microsoft.Extensions.DependencyInjection |
| Language / Runtime | C# / .NET 10 |
| Database | MySQL 8.0 (InnoDB, utf8mb4) |
| Data Access | MySqlConnector 2.6 — raw parameterized ADO.NET-style calls, no ORM |
| Password Hashing | BCrypt.Net-Next (salted, adaptive, work factor 12) |
| Fonts | Lato, Roboto, Phosphor Icons |
The schema is fully normalized to 3NF, with one deliberate exception documented below.
14 tables, grouped by area:
- Core banking:
customers,branch,employee,account_type,account,transaction_type,transaction,loan,installment - Security:
role,system_user,user_role - Auditing:
activity_log,audit_trail
A single deliberate denormalization: transaction.BalanceBefore /
transaction.BalanceAfter are stored explicitly rather than derived, because a bank
ledger must preserve the balance as it was at the moment of the transaction as an
immutable historical fact — not a value that could shift if earlier rows were ever
touched.
Full documentation — ER diagram, relational schema, normalization report, and annotated
SQL examples — is in Reports/BankManagement_DOC.pdf.
- Authentication — username/password login; passwords are hashed with BCrypt and never stored or compared as plaintext.
- Authorization — three roles (
BankManager,BranchManager,Employee) stored relationally, not as a hardcoded flag. Sensitive stored procedures (e.g. loan approval) re-validate the caller's role server-side. - SQL injection prevention — every database call in the app is a parameterized stored procedure call; user input is never concatenated into SQL, anywhere, by construction of the data-access layer.
- Auditability — the activity log + audit trail combination means every sensitive change (who changed an employee's salary, when, from what to what) is reconstructable after the fact.
- .NET 10 SDK
- MySQL Server 8.0+
- A MySQL client (MySQL Workbench, DBeaver, or the
mysqlCLI) to run the schema script
git clone https://github.com/<your-username>/BankApp.git
cd BankAppCreate the database and load the schema (tables, seed data, and all 95 stored procedures) from the provided dump:
mysql -u root -p -e "CREATE DATABASE bankmanagement_db;"
mysql -u root -p bankmanagement_db < Database/BankManagement.sqlOpen BankApp.Core/Data/DbConfig.cs and fill in your local MySQL credentials:
private const string Host = "localhost";
private const string Port = "3306";
private const string Database = "bankmanagement_db";
private const string Username = "root";
private const string Password = "<your-password-here>";
⚠️ Note: credentials are hardcoded here for simplicity, which is fine for local development but should never be committed with real values to a public repo. If you fork this project, consider moving these into anappsettings.jsonread viaMicrosoft.Extensions.Configuration, or environment variables, before pushing.
dotnet restore
dotnet run --project BankApp.UIThe app will open on the login screen. See seed accounts below for what's pre-loaded in the sample data, or create your own via the database directly.
| Bank Manager | Branch Manager | Employee | |
|---|---|---|---|
| View own branch's customers/accounts/loans | ✅ | ✅ | ✅ |
| View all branches | ✅ | ❌ | ❌ |
| Create / edit / delete branches | ✅ | ❌ | ❌ |
| Hire employees | ✅ (any branch) | ✅ (own branch only) | ❌ |
| Approve / reject loan requests | ✅ | ✅ (own branch) | ❌ |
| Loans they create go active immediately | ✅ | ✅ | ❌ (needs approval) |
| Manage system users & roles | ✅ | ❌ | ❌ |
| View activity log | ✅ (all) | ✅ (own branch) | ❌ |
BankApp/
├── BankApp.Core/ # Domain layer — no UI dependencies
│ ├── Data/ # DbConfig, DatabaseService (thin ADO.NET wrapper)
│ ├── Models/ # Plain C# models mapped from stored procedure results
│ ├── Repositories/ # One repository per aggregate (11 total)
│ └── Security/ # PasswordHasher (BCrypt wrapper)
│
├── BankApp.UI/ # Avalonia MVVM application
│ ├── Views/ # 26 XAML views (pages + dialogs)
│ ├── ViewModels/ # One ViewModel per view, DI-constructed
│ ├── Services/ # NavigationService, DialogService, SessionService, ...
│ ├── Converters/ # XAML value converters
│ ├── Styles/ # Shared Fluent-theme overrides
│ └── ServiceCollectionExtensions.cs # DI container registration
│
├── Database/
│ └── BankManagement.sql # Full schema + seed data + all stored procedures
│
└── Reports/
├── BankManagement_DOC.pdf # Full design document (ER, schema, normalization, SQL)
├── BankManagement_ER.jpg # ER diagram
└── bankmanagement_db.png # Schema diagram
The full project write-up — requirements analysis, ER diagram, relational schema,
normalization report (up to 3NF), and annotated SQL examples for constraint
enforcement, transactional integrity, and role-scoped queries — is available in
Reports/BankManagement_DOC.pdf.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Ideas that didn't make it into this version but would be natural next steps:
- Toggle Dark / Light theme
- Database backup/restore from within the app
- Encryption at rest for national ID numbers
- Full amortized (rather than flat) interest calculation for loans
- Exportable PDF statements per account
- Two-factor authentication
- [Mani Vakili][https://github.com/ManiINFINITE]
- [Amirhosein Bordoei][https://github.com/AmirhoseinBo]
This project was built for educational purposes as part of a Database Management Systems course.






