This project consists of multiple microservices, each serving a specific purpose within the system. The services include api-gateway
, client
, identity
, favorites
, and library
. Below are the instructions for setting up and running the entire system.
Before running the project, ensure that you have the following installed:
For an optimal development experience, it's recommended to use the NX Console extension. NX Console provides an intuitive graphical interface for running NX commands, managing your workspace, and generating code.
If you're using Visual Studio Code, you can install the NX Console extension from the Visual Studio Marketplace:
For JetBrains IDEs like WebStorm, IntelliJ IDEA, and others, you can also install the NX Console plugin:
These tools provide a powerful way to interact with your NX workspace without having to remember complex commands.
To start the required databases for the microservices, use the following command to run docker-compose
:
docker-compose up
This command will start all the necessary databases, such as PostgreSQL, Redis, and MongoDB, as defined in the docker-compose.yml file.
Once the databases are up and running, you can start each microservice individually using the following commands:
Start the API Gateway, which serves as the central point of entry to the system:
nx run api-gateway:serve:development
Start the Identity Service, which manages user authentication and authorization:
nx run identity:serve:development
Start the Favorites Service, which handles user favorites across different entities:
nx run favorites:serve:development
Start the Library Service, which manages books and authors:
nx run library:serve:development
Start the frontend client application:
nx run client:serve
- Start Databases:
docker-compose up
- Start API Gateway:
nx run api-gateway:serve:development
- Start Identity Service:
nx run identity:serve:development
- Start Favorites Service:
nx run favorites:serve:development
- Start Library Service:
nx run library:serve:development
- Start Client:
nx run client:serve
- Ensure that the databases are fully initialized before starting the microservices to avoid connection errors.
- You can use docker-compose down to stop the databases when they are no longer needed.