This is a Spring Boot bank account system that supports:
- Customers & accounts management
- Deposits & withdrawals
- Money transfers
- Transaction tracking
It uses Spring Boot, Spring Data JPA, DTOs, validation, and follows REST best practices.
Postman tests and ERD diagram are included in the repo.
- Spring Boot 3.5.4 (Java 17, Maven) with
BankApplicationmain class - Entities:
Customer,Account,Transaction(JPA annotated) - Repositories:
CustomerRepository,AccountRepository,TransactionRepository - Services: Create, read, update, delete; deposit, withdraw, transfer logic
- Controllers:
CustomerControllerAccountController
- DTOs: Mapping with basic validation
- Database: H2 in-memory (default config)
- ERD: Provided in
/ERDfolder
- Java 17
- Spring Boot (Web, Data JPA)
- H2 Database / MySQL
- Maven
- ModelMapper (for DTOs)
- Postman (for testing)
- Java 17 JDK
- Maven 3.6+
- Optional: IntelliJ IDEA / VS Code
git clone https://github.com/IsraaXx/Bank-Account-System.git
cd Bank-Account-System
mvn clean spring-boot:runApp starts at: http://localhost:8080
Base API path: /api → http://localhost:8080/api
H2 console: http://localhost:8080/h2-console
JDBC URL: jdbc:h2:mem:bankdb (user: sa, no password)
POST /customers– Create customerGET /customers– List customersGET /customers/{id}– Get by IDPUT /customers/{id}– UpdateDELETE /customers/{id}– Delete
POST /accounts– Create accountGET /accounts– List accounts (paged)GET /accounts/{id}– Get by IDDELETE /accounts/{id}– DeletePOST /accounts/{id}/deposit– DepositPOST /accounts/{id}/withdraw– WithdrawPOST /accounts/transfer– Transfer moneyGET /accounts/type/{type}– Find by type
All requests use header:
Content-Type: application/json
- Create Customer A
{
"name": "Alice Example",
"email": "alice@example.com",
"phone": "0123456789"
}Expected: 201 Created → save customerAId
-
Create Customer B (different email/phone) → save
customerBId -
Create Account for Customer A
{
"accountType": "SAVINGS",
"initialBalance": 500,
"customerId": {{customerAId}}
}Expected: 201 Created → save accountAId
-
Create Account for Customer B → save
accountBId -
Deposit into Account A
{ "amount": 200.0 }Expected: Balance +200
- Withdraw from Account A
{ "amount": 100.0 }Expected: Balance -100
- Transfer from Account A to Account B
{
"senderAccountId": {{accountAId}},
"receiverAccountId": {{accountBId}},
"amount": 150.0
}Expected: 204 No Content → Check balances
- Get Account Balances
GET /accounts/{{accountAId}}GET /accounts/{{accountBId}}
- List Accounts
GET /accounts?page=0&size=10
- Find by Type
GET /accounts/type/SAVINGS
- Customer CRUD
- List, update, delete customers
Located in /ERD folder → Bank Application.png