- Python 3.10 or higher
- pip (Python package manager)
pip install -r backend/requirements.txt- FastAPI - High-performance Python API framework
- Uvicorn - ASGI server for FastAPI
- Gunicorn - Production process manager
- NGINX - Reverse proxy, load balancing, and rate limiting
- Django - Use when a full admin experience and enterprise-grade auth system are required
Test pipeline execution from command line:
# Execute sample pipeline
python -m backend.cli execute --pipeline backend/examples/sample.yaml --verbose
# List available examples
python -m backend.cli list-examplesStart the FastAPI server:
# Development mode (with auto-reload)
python -m backend.main
# Or using uvicorn directly
uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000Server will be available at:
- API: http://localhost:8000
- Docs: http://localhost:8000/api/docs
- Health: http://localhost:8000/health
POST /api/pipelines- Create pipelineGET /api/pipelines- List pipelinesGET /api/pipelines/{id}- Get pipelinePUT /api/pipelines/{id}- Update pipelineDELETE /api/pipelines/{id}- Delete pipeline
POST /api/executions- Start executionGET /api/executions- List executionsGET /api/executions/{id}- Get execution detailsGET /api/executions/{id}/logs- Get logsDELETE /api/executions/{id}- Cancel execution
GET /api/metrics- Current metricsGET /api/metrics/history- Historical data
curl -X POST http://localhost:8000/api/pipelines \
-H "Content-Type: application/json" \
-d '{
"name": "test-pipeline",
"description": "Test pipeline",
"stages": [
{
"name": "Input Stage",
"type": "input",
"config": {"source": "test.csv"}
}
]
}'curl -X POST http://localhost:8000/api/executions \
-H "Content-Type: application/json" \
-d '{"pipeline_id": "your-pipeline-id"}'FlexiRoaster supports selectable execution backends for asynchronous and distributed workloads:
local: default in-process executioncelery: async jobs, retries, and scheduling support through Celery workersray: distributed Python execution, optimized for ML/AI-heavy pipelines
Use the optional execution_backend field when creating an execution:
curl -X POST http://localhost:8000/api/executions -H "Content-Type: application/json" -d '{"pipeline_id": "your-pipeline-id", "execution_backend": "ray"}'Or set a default backend via environment variables in backend/.env:
DISTRIBUTED_EXECUTION_BACKEND=local
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/1
CELERY_EXECUTION_TASK=flexiroaster.execute_pipeline
RAY_ADDRESS=auto
RAY_NAMESPACE=flexiroasterIf Celery or Ray is unavailable, FlexiRoaster automatically falls back to local execution and records the fallback reason in execution context.
- JWT authentication endpoint:
POST /api/auth/token - RBAC roles:
admin,operator,viewer - Rate limiting: IP-based sliding window using
RATE_LIMIT_PER_MINUTE - Secret management abstraction via
SECRET_BACKEND(envorvault) - Optional enterprise IAM metadata endpoint for Keycloak:
GET /api/auth/oidc/keycloak/config
Example token request:
curl -X POST http://localhost:8000/api/auth/token \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "admin123"}'Use token:
curl http://localhost:8000/api/pipelines \
-H "Authorization: Bearer <access_token>"Copy .env.example to .env and customize:
cp backend/.env.example backend/.envFlexiRoaster supports Kafka-compatible domain events (Apache Kafka or Redpanda) for loose coupling, high scalability, audit-friendly workflows, and real-time analytics.
- Event-driven triggers
- High-throughput ingestion
- Real-time pipeline activation
- Kafka-compatible
- Lower operational complexity
Use this layer when:
- Pipelines should trigger from events
- You need real-time monitoring
- You process millions of records
pipeline.createdexecution.startedexecution.failedexecution.completed
Set the following environment variables in backend/.env:
ENABLE_EVENT_STREAMING=true
EVENT_STREAM_BACKEND=kafka
KAFKA_BOOTSTRAP_SERVERS=localhost:9092
KAFKA_CLIENT_ID=flexiroaster-backend
TOPIC_PIPELINE_CREATED=pipeline.created
TOPIC_EXECUTION_STARTED=execution.started
TOPIC_EXECUTION_FAILED=execution.failed
TOPIC_EXECUTION_COMPLETED=execution.completedIf Kafka/Redpanda is unavailable, the backend falls back to structured application logs for events so local development continues to work.
FlexiRoaster now includes a production observability baseline:
- Prometheus metrics scrape endpoint:
GET /metrics - Grafana dashboards (using Prometheus datasource)
- Elasticsearch + Logstash centralized JSON logs
Key telemetry includes:
- Pipeline latency (
flexiroaster_pipeline_execution_latency_seconds) - Failure rates (
flexiroaster_pipeline_failure_rate) - Resource usage (
flexiroaster_process_cpu_percent,flexiroaster_process_memory_rss_bytes) - SLA tracking (
flexiroaster_pipeline_sla_breaches_total)
Runtime knobs (environment variables):
ENABLE_PROMETHEUS_METRICS=true
PIPELINE_SLA_TARGET_SECONDS=30
ENABLE_LOGSTASH_LOGGING=true
LOGSTASH_HOST=logstash
LOGSTASH_PORT=5000Use docker compose up to launch backend + monitoring stack (Prometheus/Grafana/Elasticsearch/Logstash).
- Install Python and dependencies
- Test CLI execution
- Start API server
- Test endpoints with Postman or curl
- Integrate with frontend (already running on port 5173)
- Full implementation plan:
implementation_plan.md - Task checklist:
task.md - Walkthrough:
walkthrough.md