{"id":31892537,"url":"https://github.com/syed007hassan/flask-celery-flower","last_synced_at":"2026-05-09T02:19:22.468Z","repository":{"id":313071510,"uuid":"1049918364","full_name":"Syed007Hassan/flask-celery-flower","owner":"Syed007Hassan","description":"A complete demonstration of asynchronous task processing using Flask, Celery, Redis, and Flower for monitoring.","archived":false,"fork":false,"pushed_at":"2025-09-03T17:52:39.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-21T06:26:15.745Z","etag":null,"topics":["celery","flask","flower","redis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Syed007Hassan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-03T17:25:38.000Z","updated_at":"2025-09-03T17:52:43.000Z","dependencies_parsed_at":"2025-09-03T19:41:23.907Z","dependency_job_id":"e7833683-610d-4d76-9410-ab77612bd070","html_url":"https://github.com/Syed007Hassan/flask-celery-flower","commit_stats":null,"previous_names":["syed007hassan/flask-celery-flower"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Syed007Hassan/flask-celery-flower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syed007Hassan%2Fflask-celery-flower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syed007Hassan%2Fflask-celery-flower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syed007Hassan%2Fflask-celery-flower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syed007Hassan%2Fflask-celery-flower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Syed007Hassan","download_url":"https://codeload.github.com/Syed007Hassan/flask-celery-flower/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syed007Hassan%2Fflask-celery-flower/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32804672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","flask","flower","redis"],"created_at":"2025-10-13T08:53:00.750Z","updated_at":"2026-05-09T02:19:22.437Z","avatar_url":"https://github.com/Syed007Hassan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask + Celery + Redis + Flower Demo\n\nA complete demonstration of asynchronous task processing using Flask, Celery, Redis, and Flower for monitoring.\n\n## Architecture Overview\n\n```mermaid\nflowchart TD\n    subgraph Client [\"🌐 Client Layer\"]\n        Browser[\"🖥️ Web Browser\u003cbr/\u003eUser Interface\"]\n    end\n    \n    subgraph WebApp [\"🚀 Web Application Layer\"]\n        Flask[\"⚡ Flask Server\u003cbr/\u003ePort 5000\u003cbr/\u003eRoutes \u0026 Views\u003cbr/\u003eTask Submission\"]\n    end\n    \n    subgraph Processing [\"⚙️ Background Processing Layer\"]\n        Worker[\"🔄 Celery Worker\u003cbr/\u003eTask Execution\u003cbr/\u003eProgress Tracking\u003cbr/\u003eError Handling\"]\n        Monitor[\"🌺 Flower Dashboard\u003cbr/\u003ePort 5555\u003cbr/\u003eReal-time Monitoring\u003cbr/\u003eTask Management\"]\n    end\n    \n    subgraph Data [\"💾 Data \u0026 Message Layer\"]\n        Redis[\"🚀 Redis Server\u003cbr/\u003ePort 6379\u003cbr/\u003eMessage Broker\u003cbr/\u003eResult Backend\u003cbr/\u003eIn-Memory Store\"]\n    end\n    \n    Browser -.-\u003e|\"HTTP Requests\u003cbr/\u003eForm Submissions\"| Flask\n    Flask --\u003e|\"Task Queue\u003cbr/\u003edivision.delay()\u003cbr/\u003eprocess_text.delay()\"| Redis\n    Redis --\u003e|\"Task Dispatch\u003cbr/\u003eFIFO Queue\"| Worker\n    Worker --\u003e|\"Store Results\u003cbr/\u003eUpdate Progress\"| Redis\n    Flask -.-\u003e|\"Fetch Results\u003cbr/\u003eAsyncResult()\"| Redis\n    Browser -.-\u003e|\"Monitor Tasks\u003cbr/\u003eReal-time View\"| Monitor\n    Monitor --\u003e|\"Query Metrics\u003cbr/\u003eWorker Stats\"| Redis\n    \n    classDef client fill:#667eea,stroke:#764ba2,stroke-width:3px,color:#fff\n    classDef webapp fill:#f093fb,stroke:#f5576c,stroke-width:3px,color:#fff\n    classDef processing fill:#4facfe,stroke:#00f2fe,stroke-width:3px,color:#fff\n    classDef storage fill:#43e97b,stroke:#38f9d7,stroke-width:3px,color:#fff\n    classDef component fill:#ffffff,stroke:#333,stroke-width:2px,color:#333\n    \n    class Client client\n    class WebApp webapp\n    class Processing processing\n    class Data storage\n    class Browser,Flask,Worker,Monitor,Redis component\n```\n\n## Component Description\n\n| Component | Purpose | Port | Technology |\n|-----------|---------|------|------------|\n| **Flask App** | Web interface for task submission | 5000 | Python Flask |\n| **Celery Worker** | Background task processor | - | Celery |  \n| **Redis** | Message broker \u0026 result backend | 6379 | Redis Server |\n| **Flower** | Task monitoring dashboard | 5555 | Celery Flower |\n\n## Project Structure\n\n```text\nsrc/\n├── app.py              # Flask web application\n├── tasks.py            # Celery task definitions  \n├── make_celery.py      # Celery worker entry point\n├── templates/\n│   └── home.html       # Web interface template\n├── static/\n│   └── style.css       # Application styles\n└── logs/\n    └── celery.log      # Worker logs\n```\n\n## Quick Start\n\n### 1. Install Dependencies\n\n```bash\n# Install Poetry if you haven't already\ncurl -sSL https://install.python-poetry.org | python3 -\n\n# Install project dependencies\npoetry install\n```\n\n### 2. Start Redis Server\n\n```bash\n# Check if Redis is running\nredis-cli ping\n\n# If no PONG response, start Redis\nredis-server --daemonize yes\n```\n\n### 3. Run All Services\n\n#### Option A: Automatic (All in Background)\n\n```bash\n# Start all services automatically\ncd src\npoetry run celery -A make_celery worker --pool=solo --loglevel=info -f logs/celery.log \u0026\npoetry run celery -A make_celery flower --port=5555 \u0026\ncd .. \u0026\u0026 poetry run flask --app src/app --debug run\n```\n\n#### Option B: Manual (Separate Terminals)\n\n**Terminal 1 - Celery Worker:**\n\n```bash\ncd src\npoetry run celery -A make_celery worker --pool=solo --loglevel=info -f logs/celery.log\n```\n\n**Terminal 2 - Flower Monitor:**\n\n```bash\ncd src  \npoetry run celery -A make_celery flower --port=5555\n```\n\n**Terminal 3 - Flask App:**\n\n```bash\npoetry run flask --app src/app --debug run\n```\n\n## Access Points\n\n| Service | URL | Description |\n|---------|-----|-------------|\n| **Flask Web App** | \u003chttp://127.0.0.1:5000\u003e | Main application interface |\n| **Flower Dashboard** | \u003chttp://127.0.0.1:5555\u003e | Task monitoring and management |\n\n## Features\n\n### Available Tasks\n\n1. **Division Task** - Mathematical division with progress tracking\n2. **Text Processing Task** - Text transformation with repeat functionality\n\n### Demo Capabilities\n\n- ✅ **Task Submission** - Submit background tasks via web interface\n- ✅ **Progress Tracking** - Real-time task progress updates\n- ✅ **Error Handling** - Graceful error management and user feedback  \n- ✅ **Result Display** - View task results and status\n- ✅ **Live Monitoring** - Monitor tasks in Flower dashboard\n\n### Testing Tasks Manually\n\n```python\n# Start Flask shell\npoetry run flask shell\n\n# Submit division task\nfrom tasks import divide\ntask = divide.delay(10, 2)\nprint(f\"Task ID: {task.id}, Status: {task.status}\")\n\n# Submit text processing task  \nfrom tasks import process_text\ntask = process_text.delay(\"Hello World\", 3)\nprint(f\"Task ID: {task.id}, Status: {task.status}\")\n```\n\n## Architecture Benefits\n\n- **Scalability**: Tasks processed asynchronously without blocking web requests\n- **Reliability**: Redis provides persistent message queuing and result storage  \n- **Monitoring**: Flower dashboard offers real-time task visibility\n- **Flexibility**: Easy to add new task types and scale workers\n\n## References\n\n- [Flask-Celery Integration Patterns](https://flask.palletsprojects.com/en/3.0.x/patterns/celery/)\n- [Celery Best Practices](https://docs.celeryq.dev/en/stable/userguide/tasks.html)\n- [Redis Configuration](https://redis.io/documentation)\n- [Flower Monitoring](https://flower.readthedocs.io/en/latest/)\n\n---\n\n**Perfect for learning Flask + Celery + Redis + Flower integration! 🚀**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyed007hassan%2Fflask-celery-flower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyed007hassan%2Fflask-celery-flower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyed007hassan%2Fflask-celery-flower/lists"}