The Customer Management API is a Spring Boot application that provides endpoints to manage customer information. It allows users to perform CRUD (Create, Read, Update, Delete) operations on customer data.
- Get a list of all customers.
- Add a new customer.
- Update an existing customer.
- Delete a customer by ID.
- Java
- Spring Boot
- Spring Data JPA (Java Persistence API)
- Maven (for dependency management)
- Java Development Kit (JDK) 8 or higher.
- Maven installed (for building and running the project).
-
Clone the repository:
git clone https://github.com/ThunderSmoker/SpringBoot-CRUD.git cd customer-management-api
2.Build Project:
mvn clean package
-
Update the
application.properties
file with your PostgreSQL database credentials:spring.datasource.url=jdbc:postgresql://localhost:5432/YourDatabaseName spring.datasource.username=your-username spring.datasource.password=your-password
4.Run the Application
mvn spring-boot:run
Method | Endpoint | Description |
---|---|---|
POST | /api/customers | Create a new customer record. |
GET | /api/customers | Retrieve all customer records. |
GET | /api/customers/{id} | Retrieve a specific customer. |
PUT | /api/customers/{id} | Update an existing customer. |
DELETE | /api/customers/{id} | Delete a customer record. |
#Request Body format(JSON)
{
"name": "John Doe",
"email": "johndoe@example.com",
"age": 30
}