Rdxv / libraryMicroservicesG4

group 4 repository for microservices library app
2 stars 0 forks source link

Group 4 microservices library app

App schematics

Services:

Available features (for books, customers and lends)

Create, list, retrieve, edit and delete

Logging

All services log to console in JSON format. Environment vars allow changing the log level (default INFO and above). All logs related to requests from clients display a correlation id (generated by the gateway service and passed along to backend services). Logs for lend also record the customer id, being able to be used for tracing as well.

How to start and stop services

To start all services at once go into the project directory and type docker-compose up -d (if using docker compose) or, if using kubernetes, type kubectl apply -f ./kubernetes-config To stop the services with docker compose type docker-compose stop to stop all containers and docker-compose rm to remove the now-stopped containers. With kubernetes, type kubectl delete -f ./kubernetes-config

To build an image for the container, go into a service directory and type docker build . -t imageName (you can choose an image name you like) To start a single container, type docker run -p port1:port2 imageName and replace port with the values of ports you wish to open and imagename Default service ports (port1) are 3001 for books, 3002 for lend, 3003 for customers. Note: you can change these in .env files in the corresponding service folder. Port2 is the exposed container port and can be set freely. imageName is the same you chose when typing docker-build.

To start a single NodeJS service, go into the corresponding directory and type the following commands:

To start GraphQL go into the corresponding directory and type the following commands:

Project created by: Andrea Cirillo (mantainer) Alex Enrico Aimino Alberto Alineri Daniele Quasimodo Simone Stella