Customer API

This project is a simple RESTful API for managing customers. It allows users to retrieve a list of all customers and add new customers. The API is built using Spring Boot and MongoDB to persist the data.

Getting Started

To get started with this project, follow these steps:

  1. Clone this repository to your local machine.
  2. Ensure you have MongoDB installed and running locally on your machine.
  3. Open the project in your preferred IDE.
  4. Run the main file CustomerApiApplication.java with @SpringBootApplication annotation.
  5. Alternatively, you can build and run the project using Gradle: ./gradlew bootRun

Usage

Get All Customers

Endpoint: GET /customers

Retrieves a list of all customers.

Add Customer

Endpoint: POST /customers

Adds a new customer to the system.

Request Body

{
  "name": "Customer Name",
  "email": "customer@example.com",
}

Replace "Customer Name" and "customer@example.com" with the actual details of the customer you want to add.

Postman Collections

For testing the API endpoints, you can use the Postman collection provided in the link below:

Customer API Postman Collection