Skip to content

illegalcall/task-master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Task Master - Scalable Job Processing System

A background job processing system that handles heavy or time-consuming tasksβ€”like sending emails, processing images, or automating workflowsβ€”so your main app stays fast and responsive.

πŸš€ Quick Start

# Start development environment
docker compose -f docker-compose.dev.yml up --build

# Run database migrations
docker exec -i postgres-db psql -U admin -d taskmaster < db/schema.sql

# Run tests
go test ./... -v

πŸ“‹ Implementation Progress

1. Core Infrastructure βœ…

  • Project structure and module setup
  • PostgreSQL database integration
  • Redis for state management
  • Kafka message queue setup
  • Docker containerization
  • Basic authentication (JWT)
  • Configuration management
  • gRPC API implementation

2. Job Processing System 🚧

Basic Features βœ…

  • REST API endpoints (Fiber)
  • Job creation and storage
  • Kafka producer implementation
  • Worker service setup
  • Basic job status tracking
  • Simple retry mechanism

Core Processing Features 🚧

  • Job type registry system
  • Payload validation
  • Configurable retry policies
  • Job timeout handling
  • Progress tracking
  • Job dependencies
  • Job cancellation
  • Priority queues
  • Dead-letter queue
  • Result storage

Advanced Processing Features 🚧

  • Distributed locking
  • Job batching
  • Workflow engine
  • Cron scheduling
  • Rate limiting
  • Job routing
  • Job chaining
  • Recovery system

3. Developer Experience 🚧

Documentation & Tools

  • Job type documentation
  • Debugging tools
  • Testing/simulation tools
  • Job templates
  • Payload transformation
  • Hooks/middleware system

Web Dashboard

  • React + Tailwind UI
  • Real-time updates (WebSocket)
  • Job filtering and search
  • Analytics dashboard
  • Retry controls
  • Logs viewer
  • Worker management

4. Operations & Monitoring 🚧

Observability

  • Structured logging (slog)
  • Prometheus metrics
  • Grafana dashboards
  • OpenTelemetry tracing
  • Health checks
  • Resource monitoring

Operational Tools

  • Job archival
  • Cleanup policies
  • Audit logging
  • Cost tracking
  • Quota management
  • Statistics collection
  • Alerts/notifications

5. Production Deployment 🚧

Infrastructure

  • Kubernetes setup
  • Helm charts
  • Worker auto-scaling
  • Multi-region support
  • Backup/restore system
  • Blue-green deployments

Cloud Integration

  • Terraform configurations
  • AWS/GCP deployment
  • Cost optimization
  • Security hardening

πŸ”„ System Architecture

Components

  1. API Service

    • REST/gRPC endpoints
    • Request validation
    • Job creation & queuing
  2. Message Queue

    • Kafka-based processing
    • Job distribution
    • Order guarantee
  3. Worker Service

    • Job execution
    • Status management
    • Error handling
  4. Storage Layer

    • PostgreSQL: Job data
    • Redis: Status cache
    • Kafka: Message queue

Basic Job Flow

  1. Submit job via API
  2. Store in PostgreSQL
  3. Queue in Kafka
  4. Process via Worker
  5. Update status
  6. Store results

πŸ›  Development

Prerequisites

  • Go 1.23+
  • Docker & Docker Compose
  • Make (optional)

Environment Setup

DATABASE_URL=postgres://admin:admin@postgres-db:5432/taskmaster?sslmode=disable
KAFKA_BROKER=kafka:9092
REDIS_ADDR=redis:6379
JWT_SECRET=supersecretkey

API Examples

# Authentication
POST /api/login
{
    "username": "admin",
    "password": "password"
}

# Job Management
POST /api/jobs
{
    "type": "sendEmail",
    "payload": {
        "to": "user@example.com",
        "subject": "Welcome!",
        "template": "welcome_email"
    }
}

GET /api/jobs/:id
GET /api/jobs

πŸ“ Contributing

  1. Fork repository
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Open Pull Request

πŸ“„ License

MIT License

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •