This repository contains three projects built with .NET 6 implementing the MicroServices architecture:
- Customer API: A web API for managing customer-related operations.
- Product API: A web API for managing product-related operations.
- API Gateway: Routes upstream and downstream requests to specified routes for the customer and product APIs.
- Auth API: A web API for managing authentication-related operations.
Since microservices-based applications comprise several different services, you often need a common interface or gateway to call these services so that you define and manage all concerns in one place rather than replicate them across all downstream services. This is precisely why I undertook such a project to understand and showcase the capabilities of a API Gateway which gives us consistent way to connect with the microservices.
-
Customer API: customer-api/
- Contains the source code and configuration for the Customer API.
-
Product API: product-api/
- Contains the source code and configuration for the Product API.
-
API Gateway: api-gateway/
- Contains the source code and configuration for the API Gateway.
-
Auth API: auth-api/
- Contains the source code and configuration for the Auth API.
-
Clone the repository:
git clone https://github.com/battletremor/OrderProcessing.git cd OrderProcessing
-
Build and run the projects:
- Navigate to each project directory (OrderProcessing.Customer/, OrderProcessing.Product/, OrderProcessing/, OrderProcessing.Auth/) and run:
dotnet build dotnet run
- Open your browser and navigate to the API endpoints:
-
Customer API: http://localhost:5001/swagger
-
Product API: http://localhost:5002/swagger
-
API Gateway: http://localhost:5000/swagger
-
Product API: http://localhost:5005/swagger
- Each project may have its own configuration files. Check the appsettings.json or respective configuration files for customization.
If you would like to contribute to this project, please follow the Contributing Guidelines.
Caution
This project uses http scheme, additionally it has support for https but the ports may vary. Please check launchSettings.json of each project to know more about.
Tip
The two webapi projects OrderProcessing.Customer, OrderProcessing.Product have swaggeeUI enabled which can be disabled by commenting the launchUrl key-value pair in launchSettings.json The gateway can be tested with PostMan for more details you can check out the official website of Postman