Skip to content

Commit 2807127

Browse files
committed
Update Readme
1 parent 544146d commit 2807127

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Spring Boot WebFlux Microservice with MongoDB
2+
3+
## Overview
4+
This microservice is built using **Spring Boot** and **Spring WebFlux** to provide an asynchronous, non-blocking REST API. It interacts with a **MongoDB NoSQL database** to store and retrieve product information.
5+
6+
## Features
7+
- Retrieve products by **EAN code**.
8+
- Retrieve a product by **EAN code and Store ID**.
9+
- Uses **Spring Data Reactive MongoDB** for database interactions.
10+
- Asynchronous handling with **Spring WebFlux**.
11+
- Includes **unit tests** with JUnit 5 and Mockito.
12+
13+
## Technologies Used
14+
- Java 17
15+
- Spring Boot 3
16+
- Spring WebFlux
17+
- Spring Data MongoDB (Reactive)
18+
- MongoDB
19+
- JUnit 5 & Mockito (for testing)
20+
- Maven
21+
22+
## API Endpoints
23+
24+
### 1. Get all products with a specific EAN
25+
**Request:**
26+
```sh
27+
GET /products/ean/{ean}
28+
```
29+
**Example:**
30+
```sh
31+
curl -X GET "http://localhost:8080/products/ean/123456789" -H "Content-Type: application/json"
32+
```
33+
### 2. Get a product by EAN and Store ID
34+
**Request:**
35+
```sh
36+
GET /products/ean/{ean}/store/{storeId}
37+
```
38+
**Example:**
39+
```sh
40+
curl -X GET "http://localhost:8080/products/ean/123456789/store/1" -H "Content-Type: application/json"
41+
```
42+
## Installation & Setup
43+
### 1. Clone the repository
44+
```sh
45+
git clone https://github.com/selmaguedidi/springreactiveproject.git
46+
```
47+
### 2. Start MongoDB
48+
Ensure MongoDB is running locally or update application.properties to connect to a remote MongoDB instance.
49+
50+
### 3. Build & Run the Application
51+
```sh
52+
mvn clean install
53+
mvn spring-boot:run
54+
```
55+
The application will start on http://localhost:8080.
56+
57+
## Running Tests
58+
```sh
59+
mvn test
60+
```

0 commit comments

Comments
 (0)