This repository documents my learning journey with Apache Airflow, along with two practical projects:
- ✅ A Random Quote Generator DAG in Airflow
- ✅ A Flask-based Web Application
It includes all the source code, solutions to errors encountered during setup and execution, and a learning documentation for future reference.
This project demonstrates how to use Apache Airflow for automated workflow scheduling by building a DAG that generates a random motivational quote and stores it in a .csv file every time it's triggered.
- Uses
randomanddatetimemodules. - Quotes are stored with timestamps in a CSV file.
- Manual triggering through the Airflow UI.
dags/ └── random_quote_dag.py output/ └── quotes.csv
markdown Copy Edit
- Apache Airflow
- Python 3.11
- Docker (for containerized orchestration)
- Airflow CLI & Web UI
This is a basic Flask web app to demonstrate setting up a simple route with interactive HTML templates. It showcases how to:
- Handle HTTP GET and POST requests
- Connect backend logic with frontend using Jinja2 templates
flask_app/ ├── app.py ├── templates/ │ └── index.html └── static/
yaml Copy Edit
- Flask
- Python
- HTML/CSS (basic)
| ❌ Error | 💡 Solution |
|---|---|
ps: command not found in Airflow container |
Installed using apt-get update && apt-get install procps |
Airflow 501 error on localhost |
Fixed by mapping ports properly in docker-compose.yml and restarting the container |
webserver.log not found |
Ensured Airflow started correctly with airflow webserver and confirmed logs path |
| ❌ Issue | 💡 Solution |
|---|---|
| App not launching | Checked port binding and ensured Flask app was run using python app.py |
| Template not found | Corrected template folder path or renamed file to match Flask routing |
- Gained hands-on experience with Airflow DAGs and scheduling workflows.
- Learned how to deploy and test Flask apps.
- Explored Dockerized development environments.
- Understood the importance of logs, permissions, and CLI tools in debugging.
workspace/ ├── dags/ │ └── random_quote_dag.py ├── flask_app/ │ ├── app.py │ └── templates/ └── docs/ └── airflow_learning_documentation.pdf
yaml Copy Edit
cd flask_app
python app.py
Airflow DAG (Docker):
bash
Copy
Edit
docker-compose up airflow-webserver