CRU Rest API for customers data
First of all, clone or download this repo.
Once this is done, ensure Docker daemon is started. Then, build the entire project from parent.
To start all services, from parent folder type on command line:
docker-compose up -d
If any of the microservices exits, rerun exited ones by typing:
docker-compose start
Microservices can be found on ports 8080 and 8081. You can interact with API by using Swagger interface, found at http://localhost:8080/swagger-ui.html or http://localhost:8081/swagger-ui.html.
Documentation can be found on code or via SwaggerUI. Beside that, you can find here basic documentation too.
Represents the customer information saved into database. It has following attributes:
- id - autogenerated, unique
- name - required
- email - required, unique
- phone - unique
- address
This project exposes 2 microservices:
- This service is used to create or update customers. Exposes POST method to create a customer. Exposes PUT method to update a customer.
- This service is used to retrieve customer data. Exposes GET method requiring customer id. Additionaly Exposes GET method to retrieve all customers (just testing purposes).
I used In-Memory H2 Database.
Database is shared between microservices. To acomplish this, customerPost microservice also starts database and exposes it on localhost:9090.
- Java jdk 11
- Gradle v6.8.1
- Docker v20.10.10
Made by Mario Ferrero Fernández