Application Generator

The Tasker Application Template Generator provides a one-line creation experience for building production-ready applications that leverage Tasker's enterprise workflow orchestration capabilities. Version 1.0.6 introduces Docker-based development environments and comprehensive dry-run validation.

Quick Start

One-Line Creation (Interactive)

curl -fsSL https://raw.githubusercontent.com/tasker-systems/tasker/main/scripts/install-tasker-app.sh | bash

This will:

  1. Check your system dependencies (Ruby 3.0+, Rails 7+, Git)

  2. Download the application generator and templates

  3. Run an interactive setup to customize your application

  4. Create a complete Rails application with Tasker integration

Docker-Based Development

# Create a Docker-based development environment
curl -fsSL https://raw.githubusercontent.com/tasker-systems/tasker/main/scripts/install-tasker-app.sh | bash -s -- \
  --app-name my-tasker-app \
  --docker \
  --with-observability

This creates a complete Docker environment with:

  • Rails application container with live code reloading

  • PostgreSQL 15 with Tasker schema

  • Redis 7 for caching and background jobs

  • Jaeger distributed tracing (optional)

  • Prometheus metrics collection (optional)

Non-Interactive Creation

With Custom Options

Available Options

Option
Description
Default

--app-name NAME

Name of the Tasker application

my-tasker-app

--tasks LIST

Comma-separated application templates to include

ecommerce,inventory,customer

--output-dir DIR

Where to create the application

./tasker-applications

--observability

Include OpenTelemetry/Prometheus config

true

--interactive

Enable interactive prompts

true

--api-base-url URL

DummyJSON API base URL

https://dummyjson.com

--docker

Generate Docker-based development environment

false

--with-observability

Include Jaeger and Prometheus in Docker setup

false

What Gets Created

The generator creates a complete Rails application featuring:

πŸ—οΈ Application Structure

  • Rails 7+ API application with Tasker integration

  • Proper Gemfile with Tasker gem and dependencies

  • Database setup with Tasker migrations

  • Development and production configurations

πŸ“‹ Application Templates

Choose from three business domains:

E-commerce (ecommerce)

  • Order processing workflow

  • Cart validation β†’ Inventory check β†’ Pricing calculation β†’ Order creation

  • DummyJSON API integration for realistic data

Inventory Management (inventory)

  • Stock monitoring and reorder management

  • Threshold-based stock level monitoring

  • Low stock identification and alerting

Customer Onboarding (customer)

  • User registration and validation workflow

  • Duplicate user detection

  • Registration data validation

🎨 Generated Components

YAML Configuration Files (config/tasker/tasks/)

  • Proper Tasker::ConfiguredTask format

  • Environment-specific configurations

  • Step templates with dependencies

Step Handler Classes (app/tasks/)

  • API integration handlers using Tasker::StepHandler::Api

  • Calculation handlers for business logic

  • Database operation handlers

  • Notification handlers (email, SMS, webhooks, Slack)

Enhanced Configuration (config/initializers/tasker.rb)

  • Authentication setup

  • Telemetry and metrics configuration

  • Engine configuration with proper directories

  • Health check configuration

πŸ“Š Observability Stack

  • OpenTelemetry integration for distributed tracing

  • Prometheus metrics collection

  • Structured logging with correlation IDs

  • Example configurations for Jaeger, Zipkin, and other OTLP backends

πŸ“š Documentation

  • Comprehensive README with setup instructions

  • API endpoint documentation

  • Example GraphQL queries and REST API calls

  • Observability setup guides

Architecture Benefits

πŸ”„ Two-Layer Approach

  1. Shell Script Layer: Environment validation, dependency checking, file downloads

  2. Ruby Script Layer: Complex application generation, template processing, Rails integration

✨ Why This Pattern Works

  • Familiar: Developers expect curl | sh for dev tools

  • Robust: Ruby script provides comprehensive environment validation

  • Maintainable: Complex logic stays in Ruby where it belongs

  • Flexible: Easy to extend with new task types and configurations

  • Marketing: Reduces friction for trying Tasker

Security Considerations

πŸ”’ Safe Practices

  • Always review scripts before running: curl -fsSL <url> | less

  • Use HTTPS URLs to prevent man-in-the-middle attacks

  • Script uses temporary directories with cleanup

  • No persistent system modifications outside project directory

πŸ›‘οΈ Transparency

  • All source code is public and reviewable

  • No hidden downloads or external dependencies

  • Clear logging of all operations

  • Fail-fast error handling

Docker Development Environment

Quick Start with Docker

The Docker mode provides a complete containerized development environment, eliminating setup friction:

Docker Development Commands

The ./bin/docker-dev helper script provides 15+ commands for Docker management:

Service Management

Development Tools

Database Operations

Testing & Validation

Docker Architecture

  • Multi-stage Dockerfile: Optimized for development and production

  • Service orchestration: PostgreSQL, Redis, Rails app, and optional observability

  • Volume mounts: Live code reloading with persistent data

  • Health checks: Automatic service dependency management

  • Network isolation: Secure bridge network for all services

Dry-Run Validation System

Overview

The generator includes a comprehensive dry-run validation system that tests template consistency without generating files:

Validation Categories

1. Template File Existence

  • Verifies all required ERB templates exist

  • Adapts to Docker/observability modes

  • Reports missing templates with paths

2. ERB Template Syntax

  • Parses all ERB templates for syntax errors

  • Validates without executing templates

  • Catches malformed Ruby blocks and expressions

3. Generated Code Syntax

  • Renders templates with test data

  • Validates Ruby syntax using RubyVM::InstructionSequence

  • Validates YAML syntax using YAML.safe_load

  • Tests actual generated output, not just templates

4. CLI Options Mapping

  • Ensures all Thor options have corresponding instance variables

  • Validates required methods exist

  • Handles renamed variables (e.g., --docker β†’ @docker_mode)

5. Template Variable Bindings

  • Tests templates can render with expected contexts

  • Validates all required variables are available

  • Tests step handlers, configuration, and Docker bindings

Example Output

CI/CD Integration

The dry-run system is perfect for CI/CD pipelines:

  • Zero file system impact

  • Clear exit codes (0 for success, 1 for failure)

  • Detailed error reporting

  • Sub-second execution time

Development Setup

For Contributors

If you're developing or testing the installer:

Repository Setup

To host this installer on your GitHub repository:

  1. Update URLs in scripts/install-tasker-app.sh:

  2. Ensure Files Are Public:

    • scripts/install-tasker-app.sh

    • scripts/create_tasker_app.rb

    • All files in scripts/templates/

  3. Test the URLs:

Example Usage Flows

Marketing/Conference Flow

Developer Evaluation

Tutorial/Workshop

Integration Examples

Once installed, developers can immediately:

πŸ” Explore APIs

  • GraphQL Playground: http://localhost:3000/tasker/graphql

  • REST API Docs: http://localhost:3000/tasker/api-docs

  • Health Endpoints: http://localhost:3000/tasker/health/status

πŸš€ Execute Workflows

πŸ“ˆ Monitor Observability

  • Metrics: http://localhost:3000/tasker/metrics

  • Configure your observability backend via OTEL_EXPORTER_OTLP_ENDPOINT

  • View structured logs with correlation IDs

This generator transforms Tasker from "interesting project" to "production application" in under 5 minutes, providing an exceptional developer experience that showcases enterprise-grade workflow orchestration capabilities.

Last updated