Skip to content

A resilient asynchronous task orchestrator built with .NET 9 and PostgreSQL. Designed to handle high-traffic background processing with a self-healing worker service, automated Dockerized migrations, and a focus on system reliability.

Notifications You must be signed in to change notification settings

nahorfelix/Task-Orchestrator-with-Docker-and-PostgreSQ

Repository files navigation

Task Orchestrator CI

Task Orchestrator with Docker and PostgreSQL

A robust, containerized .NET 9 Web API designed to handle asynchronous background processing. This project demonstrates how to decouple heavy processing tasks from the main user interface to ensure high availability and system reliability.

🚀 Key Features

  • Asynchronous Processing: Uses a Background Service (Worker) to process jobs independently of the API response.
  • Self-Healing Infrastructure: Configured with Docker restart: always and automated EF Core migrations to ensure the system recovers from failures automatically.
  • Database Persistence: Integrated with PostgreSQL to track job statuses (Pending, Processing, Completed).
  • Fault Tolerance: Designed to handle database connection delays during container startup.

🛠️ Tech Stack

  • Framework: .NET 9 (Web API)
  • Database: PostgreSQL 18
  • ORM: Entity Framework Core
  • Containerization: Docker & Docker Compose
  • Documentation: Swagger UI

🏃 Getting Started

To get the entire system running locally, you only need one command:

docker-compose up --build
Once started:
API/Swagger: http://localhost:5010/swagger
Database: localhost:5433
## 📈 Real-World Use Case (e.g., Safaricom M-PESA)
This architecture is built for scenarios like:
*   **  Transactional SMS: Sending confirmations after a transaction without making the user wait for the network.
Bulk Billing: Generating thousands of invoices at midnight via the background worker.
Third-Party Integrations: Managing retries when external APIs (like banking gateways) are temporarily down.
## 📂 Project Structure
TaskOrchestrator.Api: The entry point for client requests.
TaskOrchestrator.Infrastructure: Contains the Database Context, Repositories, and the Background Processing Service.
TaskOrchestrator.Core: Domain models and business logic.

About

A resilient asynchronous task orchestrator built with .NET 9 and PostgreSQL. Designed to handle high-traffic background processing with a self-healing worker service, automated Dockerized migrations, and a focus on system reliability.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published