A simple REST API for managing bank customer records.
This project was built with Spring Boot, Spring Data JPA, and H2 in-memory database. It supports basic CRUD operations for customer management.
- Create a new customer
- Get all customers
- Get a customer by ID
- Update customer details
- Delete a customer
- Store customer records using H2 in-memory database
- Java
- Spring Boot
- Spring Web
- Spring Data JPA
- H2 Database
- Maven
src
└── main
├── java
│ └── com
│ └── bank
│ └── customer
│ ├── CustomerApplication.java
│ ├── controller
│ │ └── CustomerController.java
│ ├── entity
│ │ └── Customer.java
│ ├── repository
│ │ └── CustomerRepository.java
│ └── service
│ └── CustomerService.java
└── resources
└── application.properties
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/customers |
Create a new customer |
| GET | /api/customers |
Get all customers |
| GET | /api/customers/{id} |
Get a customer by ID |
| PUT | /api/customers/{id} |
Update a customer |
| DELETE | /api/customers/{id} |
Delete a customer |
{
"id": 1,
"firstName": "Marcus",
"lastName": "Adigun",
"email": "marcus@example.com",
"phoneNumber": "08012345678"
}POST /api/customers
{
"firstName": "Marcus",
"lastName": "Adigun",
"email": "marcus@example.com",
"phoneNumber": "08012345678"
}PUT /api/customers/1
{
"firstName": "Marcus",
"lastName": "Updated",
"email": "marcus.updated@example.com",
"phoneNumber": "08111111111"
}H2 console is available at:
http://localhost:8080/h2-console
Use this JDBC URL:
jdbc:h2:mem:bankdb
Default username:
sa
Leave the password empty.
Clone the repository:
git clone <your-repository-url>Go into the project folder:
cd customerRun the application:
./mvnw spring-boot:runOn Windows:
mvnw.cmd spring-boot:runThe application will start on:
http://localhost:8080
This project helped me practice:
- Building REST APIs with Spring Boot
- Creating entities with JPA annotations
- Using Spring Data JPA repositories
- Structuring a project with controller, service, repository, and entity layers
- Testing API endpoints with Postman
- Using H2 as an in-memory database