A robust backend solution for core banking operations, built using ASP.NET Core 8, C#, and PostgreSQL, while following the Clean Architecture principles. This project demonstrates a modular, maintainable, and secure backend system suitable for financial applications.
- Overview
- Features
- Architecture
- Folder Structure
- Tech Stack
- Live Link
- Installation & Setup
- Database Setup
- API Documentation
- How to Simulate Deposit & Transfer Between Accounts
- Example Requests & Responses
- Validation & Security
- Contributing
- License
- Author
The Core Banking Solution simulates user account creation, fund transfers, deposits, withdrawals and transaction history with authentication and authorization using ASP.NET Core while following the Clean Architecture Pattern, Microservices and the Repository Pattern.
It demonstrates:
- Clean architecture separation: Domain, Application, Infrastructure, Presentation
- Secure authentication & authorization with ASP.NET Core Identity and JWT
- RESTful APIs
- Automated validation pipelines and error handling
- Customer Management: Register, update, and retrieve customer information
- Bank Accounts: Create and manage accounts per customer
- Transactions: Deposit, withdrawal, transfer, and transaction history
- Role-based Access Control: Admin and Customer roles
- Validation Pipeline: Ensures input validation and domain rules
- Security: Password hashing, JWT authentication, and claims-based authorization
- Logging & Auditing: Tracks critical actions for accountability
flowchart TB
A[Presentation Layer: API Controllers] --> B[Application Layer: Services & Use Cases]
B --> C[Domain Layer: Entities & Interfaces]
C --> D[Infrastructure Layer: EF Core, Identity, Repositories]
D --> E[PostgreSQL Database]
CoreBankingSolution/
│
├─ src/
│ ├─ CoreBanking.Domain/ # Entities, Interfaces, Value Objects
│ ├─ CoreBanking.DTO/ # DTOs
│ ├─ CoreBanking.Application/ # Services, Use Cases, CQRS
│ ├─ CoreBanking.Infrastructure/ # EF Core, Repositories, Identity
│ └─ CoreBanking.API/ # Controllers, Program.cs
│
├─ docker/ # Docker configurations
└─ README.md
• .NET Core (C#)
• Entity Framework Core
• PostgreSQL
• ASP.NET Identity
• JWT Authentication
• Clean Architecture
• Repository Pattern & Dependency Injection
• Command Query Responsibility Segregation (CQRS)
• Unit of Work & Database Transactions
• SendGrid SMTP (for email services)
• Live Link (Swagger Docs): https://core-banking-solution.onrender.com/swagger/index.html
Before you begin, make sure you have the following installed:
- Clone the repository
git clone https://github.com/Yamuhammad01/Core-Banking-Solution.git- Restore dependencies
dotnet restore
- Create database migration
Add-Migration "InitialCreate"- Update Database
Update-Database- Run the API
dotnet run- Access API at https://localhost:yourport
• Database: CoreBankingDB
• Tables: AspNetUsers, AspNetUserTokens, AspNetUserRoles, AspNetUserLogins, AspNetUserClaims, AspNetRoles, AspNetRoleClaims, Accounts, Transactions, ConfirmationCodes
This section documents all the main endpoints of the Core Banking API, including sample requests, responses, and expected HTTP status codes.
| Endpoint | Method | Description | Status Codes |
|---|---|---|---|
/api/admin/get-all-customers |
GET | Get all customers | 200 OK |
/api/admin/get-customers-by-email |
GET | Get customer by Email | 200 OK, 404 Not Found |
/api/admin/deposit |
POST | Deposit into an account | 200 OK, 400 Bad Request |
/api/auth/customers/register |
POST | Register a new customer | 201 Created, 400 Bad Request |
/api/customer/auth/login |
POST | User login & JWT generation | 200 OK, 400 Bad Request, 401 Unauthorized |
/api/transactions/withdraw |
POST | Withdraw from an account | 200 OK, 400 Bad Request, 403 Forbidden |
/api/transactions/transfer-funds |
POST | Transfer between accounts | 200 OK, 400 Bad Request, 403 Forbidden |
/api/transactions/transaction-history |
GET | View transaction history | 200 OK, 400 Bad Request, 403 Forbidden |
This section explains how to test deposit and transfer operations inside the Core Banking Solution using the built-in simulation endpoints. These endpoints are strictly for development and testing purposes.
- Submit a registration request.
- A unique account number is automatically generated.
- Account details are sent to the registered email
(check Spam/Junk if not found).
Use the built-in admin credentials:
• Email: admin@corebanking.com
• Password: Admin@123@$
After login, a JWT token is generated.
Add it to your request (authorisation) header: Authorization: Bearer <YOUR_JWT_TOKEN>
Call the /api/admin/deposit endpoint using the account number of the customer you registered.
A credit alert is sent to the customer's email showing:
- Amount deposited
- Updated balance
- Transaction details
- Use the customer’s email and password.
- copy the generated token and add it to the authorisation header in this format (Bearer eyJhbGciOiJIUzI......)
You can now view:
-
Account balance
-
My account
-
Profile information
-
Transaction history e.t.c
Register another customer with a different email to generate a second account.
- Log in to the account with funds (Account A).
- Send a transfer request from Account A → Account B using
/api/transactions/transfer-funds.
- Account A receives a debit alert.
- Account B receives a credit alert.
Use the transaction history endpoint to confirm:
- Deposits
- Transfers
- Withdrawals
The deposit endpoint is available only for simulation/testing purposes only.
In a real-world core banking system:
- Admin deposits should not exist
- Funds should only be added through external bank integrations or real payment rails
- Deposits usually come via ACH, SWIFT, NIP, card transactions, or bank APIs, not through admin-triggered actions.
This simulation exists solely for testing account workflows during development.
POST /api/auth/login
Headers:
Content-Type: application/json
{
"email": "user@example.com",
"password": "Password123!"
}Content-Type: application/json
{
"token": "<JWT_TOKEN>",
"expiresIn": 3600
}• Passwords hashed using ASP.NET Core Identity
• JWT Authentication & Role-based Authorization
• Fork the repository
• Create a feature branch: git checkout -b feature/XYZ..Feature
• Commit your changes: git commit -m "Added xyz... feature"
• Push to branch: git push origin feature/XYZ..Feature
• Open a Pull Request
This project is licensed under the MIT License.
Muhammad Idris
• GitHub: https://github.com/Yamuhammad01
• LinkedIn: https://www.linkedin.com/in/muhammad-idrisb2/
• Email: idrismuhd814@gmail.com