DotnetWorker is a robust .NET Worker Service designed to monitor website status and health. Built with Clean Architecture and Domain-Driven Design (DDD) principles, it serves as a solid foundation for building scalable and maintainable background processing applications.
- 🏗️ Clean Architecture: Organized into Domain, Application, Infrastructure, and WorkerService layers for separation of concerns.
- 🎯 Domain-Driven Design: Implements DDD patterns like Aggregates, Entities, and Domain Events using
Ardalis.SharedKernel. - 🔄 Worker Service: Runs as a background service, perfect for long-running tasks and scheduled jobs.
- 🐳 Docker Support: Includes
Dockerfileanddocker-compose.ymlfor easy containerization and deployment. - 📝 Structured Logging: Integrated with Serilog for comprehensive logging capabilities.
- 🧩 Mediator: Uses the Mediator pattern for loose coupling between application components.
Follow these instructions to get the project up and running on your local machine for development and testing purposes.
- .NET SDK (Version 10.0 or later recommended)
- Docker Desktop (Optional, for containerized execution)
-
Clone the repository:
git clone https://github.com/georgeparkdev/base-repository-dotnet-worker cd base-repository-dotnet-worker -
Rename the project (if needed):
./scripts/rename-solution.sh
-
Setup the development environment:
You can use the provided setup script to initialize the environment.
./scripts/setup-dev.sh
To run the worker service locally:
dotnet runTo run the application using Docker Compose:
docker compose up -dThe solution follows the Clean Architecture principles:
DotnetWorker.Domain: Contains the core business logic, entities (e.g.,WebsiteChecker), and interfaces. This layer has no dependencies on other layers.DotnetWorker.Application: Contains the application logic, commands, queries, and service interfaces. It depends only on the Domain layer.DotnetWorker.Infrastructure: Implements the interfaces defined in the Application and Domain layers (e.g., data access, external service calls).DotnetWorker.WorkerService: The entry point of the application. It configures the dependency injection container and hosts the background service.
We welcome contributions! Please read our CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.