Welcome to the Boots Boutique API, a RESTful service built with Java and Spring Boot to manage a boutique's boot inventory.
This API provides endpoints to manage boot inventory, allowing for standard CRUD (Create, Read, Update, Delete) operations.
GET /api/v1/boots: Retrieves a list of all boots in the inventory.POST /api/v1/boots: Adds a new boot to the inventory.DELETE /api/v1/boots/{id}: Deletes a specific boot by its ID.PUT /api/v1/boots/{id}/quantity/increment: Increments the quantity of a specific boot.PUT /api/v1/boots/{id}/quantity/decrement: Decrements the quantity of a specific boot.GET /api/v1/boots/search: Searches for boots based on query parameters (materialortype).GET /api/v1/boots/types: Returns a list of all availableBootTypeenums.
- Java 18
- Spring Boot: Core framework for building the application.
- Spring Web: For creating RESTful endpoints.
- Spring Data JPA: For database interaction.
- H2 Database Engine: In-memory database for development.
- Maven: Dependency management and build tool.
- JUnit 5: Standard for unit testing in Java.
- Mockito: For creating mock objects in tests.
- Spring Boot Test & MockMvc: For integration and controller layer testing.
Follow these instructions to get a copy of the project up and running on your local machine.
- Java Development Kit (JDK) 17 or newer.
- Apache Maven.
-
Clone this repository to your local machine:
git clone https://github.com/your-username/boots-boutique.git
-
Navigate to the project root directory:
cd boots-boutique -
Run the application using Maven:
mvn spring-boot:run
-
The server will start on
http://localhost:8080.
Here are a few examples of how to interact with the API using curl.
Get all boots:
curl -X GET http://localhost:8080/api/v1/bootsAdd a new boot:
curl -X POST http://localhost:8080/api/v1/boots \
-H "Content-Type: application/json" \
-d '{
"type": "CHELSEA",
"size": 11.5,
"material": "Suede",
"quantity": 10,
"bestSeller": false
}'Contributions are welcome! If you'd like to improve this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature/new-feature). - Make your changes and commit them (
git commit -m 'Add new feature'). - Push to your branch (
git push origin feature/new-feature). - Open a Pull Request.
If you have any questions or suggestions, feel free to reach out at jaoalbertorsc@gmail.com.