Skip to content

A Spring Boot backend for a complete banking system — supports customer management, bank accounts, deposits, withdrawals, transfers, and transaction tracking. Built with Java 17, Spring Data JPA, and H2/MySQL, following REST best practices with DTO mapping, validation, and exception handling.

Notifications You must be signed in to change notification settings

IsraaXx/Bank-Account-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏦 BM-BankAccountSystem

📌 Overview

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.


✅ Quick Status

  • Spring Boot 3.5.4 (Java 17, Maven) with BankApplication main class
  • Entities: Customer, Account, Transaction (JPA annotated)
  • Repositories: CustomerRepository, AccountRepository, TransactionRepository
  • Services: Create, read, update, delete; deposit, withdraw, transfer logic
  • Controllers:
    • CustomerController
    • AccountController
  • DTOs: Mapping with basic validation
  • Database: H2 in-memory (default config)
  • ERD: Provided in /ERD folder

🛠 Technologies

  • Java 17
  • Spring Boot (Web, Data JPA)
  • H2 Database / MySQL
  • Maven
  • ModelMapper (for DTOs)
  • Postman (for testing)

🚀 How to Run

Requirements

  • Java 17 JDK
  • Maven 3.6+
  • Optional: IntelliJ IDEA / VS Code

Steps

git clone https://github.com/IsraaXx/Bank-Account-System.git
cd Bank-Account-System
mvn clean spring-boot:run

App starts at: http://localhost:8080
Base API path: /apihttp://localhost:8080/api
H2 console: http://localhost:8080/h2-console
JDBC URL: jdbc:h2:mem:bankdb (user: sa, no password)


📡 API Endpoints

Customers

  • POST /customers – Create customer
  • GET /customers – List customers
  • GET /customers/{id} – Get by ID
  • PUT /customers/{id} – Update
  • DELETE /customers/{id} – Delete

Accounts

  • POST /accounts – Create account
  • GET /accounts – List accounts (paged)
  • GET /accounts/{id} – Get by ID
  • DELETE /accounts/{id} – Delete
  • POST /accounts/{id}/deposit – Deposit
  • POST /accounts/{id}/withdraw – Withdraw
  • POST /accounts/transfer – Transfer money
  • GET /accounts/type/{type} – Find by type

🧾 Postman Testing Plan

All requests use header: Content-Type: application/json

  1. Create Customer A
{
  "name": "Alice Example",
  "email": "alice@example.com",
  "phone": "0123456789"
}

Expected: 201 Created → save customerAId

  1. Create Customer B (different email/phone) → save customerBId

  2. Create Account for Customer A

{
  "accountType": "SAVINGS",
  "initialBalance": 500,
  "customerId": {{customerAId}}
}

Expected: 201 Created → save accountAId

  1. Create Account for Customer B → save accountBId

  2. Deposit into Account A

{ "amount": 200.0 }

Expected: Balance +200

  1. Withdraw from Account A
{ "amount": 100.0 }

Expected: Balance -100

  1. Transfer from Account A to Account B
{
  "senderAccountId": {{accountAId}},
  "receiverAccountId": {{accountBId}},
  "amount": 150.0
}

Expected: 204 No Content → Check balances

  1. Get Account Balances
  • GET /accounts/{{accountAId}}
  • GET /accounts/{{accountBId}}
  1. List Accounts
  • GET /accounts?page=0&size=10
  1. Find by Type
  • GET /accounts/type/SAVINGS
  1. Customer CRUD
  • List, update, delete customers

📊 ERD

Located in /ERD folder → Bank Application.png


About

A Spring Boot backend for a complete banking system — supports customer management, bank accounts, deposits, withdrawals, transfers, and transaction tracking. Built with Java 17, Spring Data JPA, and H2/MySQL, following REST best practices with DTO mapping, validation, and exception handling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages