Skip to content

oviecodes/taskforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TaskForge - Distributed Task Processing System

A microservices-based distributed system showcasing modern architectural patterns for task processing, built with Node.js (TypeScript), featuring Go and Python workers, and containerized with Docker/Kubernetes.

Architecture Overview

High Level Architecture

TaskForge demonstrates key distributed systems concepts:

  • API Gateway Pattern: Central entry point for client requests
  • Message Queue Processing: Asynchronous task handling with RabbitMQ
  • Event Sourcing: Outbox pattern for reliable event publishing
  • Circuit Breaker: Resilient external service calls
  • Observability: Comprehensive monitoring and logging

Articles on Architectural patterns & designs

Services

Service Language Purpose
gateway-node TypeScript API Gateway & Authentication
status-gateway TypeScript WebSocket status updates
outbox-publisher TypeScript Event publishing with outbox pattern
generate-pdf-worker Python PDF generation service
resize-image Go Image processing service
compress-video Python Video compression service
chromium-renderer TypeScript HTML to PDF rendering

Infrastructure

  • Database: PostgreSQL with Prisma (schema) + Knex (queries) hybrid approach
  • Message Broker: RabbitMQ for async communication
  • Cache: Redis for session management and caching
  • Monitoring: Prometheus + Grafana + Loki + AlertManager stack
  • Container Orchestration: Kubernetes with proper resource management

Performance Highlights

  • Hybrid ORM Strategy: Prisma for migrations, Knex for high-performance queries
  • Connection Pooling: Optimized database connections
  • Async Processing: Non-blocking task handling
  • Resource Limits: Production-ready resource management

Quick Start

Local Development

# Start infrastructure
cd infra
docker-compose up -d

# Run services individually
cd gateway-node && npm run dev
cd status-gateway && npm run dev
# ... etc

Monitoring & Observability

Access the monitoring stack:

Design Decisions

Database Strategy

  • Prisma: Schema definition and safe migrations
  • Knex: High-performance runtime queries for load testing

Messaging Patterns

  • Outbox Pattern: Ensures reliable event publishing
  • Dead Letter Queues: Handles failed message processing
  • Circuit Breaker: Prevents cascade failures

Kubernetes Setup

  • Init Containers: Database migrations before service start
  • Health Checks: Comprehensive liveness/readiness probes
  • Resource Limits: Prevents resource starvation
  • Secrets Management: Proper secret handling vs hardcoded values

Scalability Features

  • Horizontal Scaling: Services can scale independently
  • Database Connection Pooling: Efficient resource utilization
  • Async Processing: Non-blocking architecture
  • Load Balancing: Kubernetes service discovery

Security

  • Secrets Management: Kubernetes secrets vs environment variables
  • JWT Authentication: Stateless authentication strategy

This project demonstrates understanding of distributed systems patterns, performance optimization, and production-ready deployment practices suitable for modern microservices architectures.

About

Distributed systems written in Node.js (Typescript), Golang, and Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published