This project is a Contact Application developed in .NET 5 with microservice architecture.
This project includes following features
Responsible for basic CRUD implementations over Contact Entity.
This service includes:
- .NET 5 Web Api implementation
- REST API Principles, CRUD operations
- PostgreSQL as Database Provider
- Repository Pattern implementation
- Containerization
Responsible for generating reports for Contacts.
This service includes:
- .NET 5 Web Api implementation
- REST API Principles, CRUD operations
- PostgreSQL as Database Provider
- Repository Pattern implementation
- Containerization
- RabbitMQ Message Broker Service
- HTTP Rest communication between Contact Service
- EPPlus for generationg Excel reports
Responsible for communication with microservices.
This service includes:
- Ocelot is used for Gateway implementation
- Containerization
You will need the following tools:
Follow these steps to get your development environment set up: (Before Run Start the Docker Desktop)
- Clone the repository
- (Optional) If you want, you can limit the Wsl2's memory and cpu usage. (see also)
- Go to User's Document Folder ( Press "WinKey + R" and run "%UserProfile%" )
- Create a file named .wslconfig
- Write its content as follows (Windows restart may be required)
[wsl2]
memory=8GB
processors=2
swap=0
localhostForwarding=true
- At the root directory which include docker-compose.yml and docker-compose.override.yml files, run below command:
docker-compose -f docker-compose.yml -f docker-compose.override.yml up
-
Wait for docker compose all microservices.
-
You can launch microservices as below urls:
- Gateway API -> http://localhost:5000
- Contact API -> http://localhost:5002
- Report API -> http://localhost:5004
- pgAdmin PostgreSQL -> http://localhost:5050 -- [email protected] / admin
- RabbitMQ -> http://localhost:15672 -- user / password
If you want to use the API with Postman, click below link.
To run unit tests, you have to run microservices with test environment. We will also use Docker for unit tests.
- At the root directory which include docker-compose-tests.yml and docker-compose-tests.override.yml files, run below command:
docker-compose -f docker-compose-tests.yml -f docker-compose-tests.override.yml up
- Wait for docker compose all microservices.
- From the Test menu item, run the all tests.
- Open the Test Explorer window, and notice the results of the tests.