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 | bashThis will:
Check your system dependencies (Ruby 3.0+, Rails 7+, Git)
Download the application generator and templates
Run an interactive setup to customize your application
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-observabilityThis 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
--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::ConfiguredTaskformatEnvironment-specific configurations
Step templates with dependencies
Step Handler Classes (app/tasks/)
API integration handlers using
Tasker::StepHandler::ApiCalculation 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
Shell Script Layer: Environment validation, dependency checking, file downloads
Ruby Script Layer: Complex application generation, template processing, Rails integration
β¨ Why This Pattern Works
Familiar: Developers expect
curl | shfor dev toolsRobust: 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> | lessUse 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:
Update URLs in
scripts/install-tasker-app.sh:Ensure Files Are Public:
scripts/install-tasker-app.shscripts/create_tasker_app.rbAll files in
scripts/templates/
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/graphqlREST API Docs:
http://localhost:3000/tasker/api-docsHealth Endpoints:
http://localhost:3000/tasker/health/status
π Execute Workflows
π Monitor Observability
Metrics:
http://localhost:3000/tasker/metricsConfigure your observability backend via
OTEL_EXPORTER_OTLP_ENDPOINTView 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