Files
product-affinity/readme.md
T

34 lines
1.7 KiB
Markdown
Raw Normal View History

2021-06-23 12:17:01 +02:00
# Backend dev technical test
2021-06-23 12:19:55 +02:00
We want to offer a new feature to our customers showing similar products to the one they are seeing. To do this we agreed with our front-end applications to create a new REST API that will provide them the product detail of similar products to a given one. [Here](./similarProducts.yaml) is the contract we agreed.
2021-06-23 12:17:01 +02:00
We already have an endpoint that provides the product Ids similar to a given one. We also have another endpoint that returns the product detail by productId. [Here](./existingApis.yaml) is the documentation of the existing APIs.
**Create a Spring boot application that exposes the agreed REST API on port 5000.**
![Diagram](./assets/diagram.jpg "Diagram")
Note that _Test_ and _Mocks_ components are given, you must only implement _yourApp_.
## Testing and Self-evaluation
You can run the same test we will put through your application. You just need to have docker installed.
2021-06-23 12:19:55 +02:00
First of all, you may need to enable file sharing for the `shared` folder on your docker dashboard -> settings -> resources -> file sharing.
2021-06-23 12:17:01 +02:00
Then you can start the mocks and other needed infrastructure with the following command.
```
docker-compose up -d simulado influxdb grafana
```
Check that mocks are working with a sample request to [http://localhost:3001/product/1/similarids](http://localhost:3001/product/1/similarids).
To execute the test run:
```
docker-compose run --rm k6 run scripts/test.js
```
Browse [http://localhost:3000/d/Le2Ku9NMk/k6-performance-test](http://localhost:3000/d/Le2Ku9NMk/k6-performance-test) to view the results.
## Evaluation
The following topics will be considered:
- Code clarity and maintainability
- Performance
2021-06-23 12:19:55 +02:00
- Resilence