A distributed system based on a microservices architecture using .NET 8 and gRPC, designed to manage the fuel consumption of light and heavy machinery at Company XYZ.
Develop a distributed system that efficiently controls the fuel consumption of the company's vehicle fleet.
- Implement independent microservices for managing drivers, vehicles, routes, and fuel consumption.
- Use gRPC as the communication mechanism between microservices.
- Ensure high availability and scalability of the system.
- Separate the management of light and heavy machinery.
- Guarantee interoperability between distributed components.
- Architectural Style: Microservices
- Communication: gRPC (Protocol Buffers)
- Persistence: Independent databases or shared schemas (SQL Server / MongoDB)
- Containers: Docker (each microservice includes a Dockerfile)
- Orchestration: Kubernetes (future integration)
- DriversService: Driver management
- VehiclesService: Vehicle management (light and heavy)
- RoutesService: Route and distance management
- FuelService: Fuel consumption tracking
- AuthService: Authentication and authorization with JWT
Each microservice is structured into the following layers:
Controllers(gRPC)Application(Business logic)Domain(Entities, interfaces)Infrastructure(Data access, gRPC clients)Persistence(Database management)
/src
/Services
/Common
/DriversService
/VehiclesService
/RoutesService
/FuelService
/AuthService
/Protos
/Shared
/FuelControlSystem (Gateway)
- .NET 8 SDK
- Docker
- Docker Compose
- Clone the repository:
git clone https://github.com/TicheKiwar/FuelControlSystem.git
cd FuelControlSystem- Build and run all services using Docker Compose:
docker-compose up --buildThis will build and start all microservices, databases, and the API Gateway automatically using the provided Dockerfiles.
-
Access the services:
- Use a gRPC client (e.g., Postman, BloomRPC, or a custom frontend).
- If you have enabled an API Gateway (REST or gRPC-Web), access it via the configured domain or localhost.
-
Stop all services:
docker-compose down- Create a new directory under
/src/Services - Define the service's Protocol Buffers (
.protofiles) in the/Protosdirectory - Implement the service following the layered architecture
- Add the service to the Docker Compose configuration
- Modify the required
.protofiles if the contract changes - Update the service implementation
- Rebuild and restart the affected services with Docker Compose
dotnet testEach microservice includes integration tests that can be run independently or as part of the CI/CD pipeline.
Use Docker Compose as described in the Installation section.
- Build container images
- Push to container registry
- Deploy using Kubernetes manifests or Docker Compose
- Each service logs to a centralized logging system
- Prometheus metrics are exposed for monitoring
- Grafana dashboards are available for visualization