#This read me has been changed by Pradeep. A 3-tier Task Management application for teaching DevOps concepts. Features user authentication, task CRUD operations, and modern deployment practices.
- ✅ User Authentication - Secure login/registration with password hashing
- ✅ Task Management - Complete CRUD operations for tasks
- ✅ Real-time Updates - AJAX-powered status toggling
- ✅ Responsive UI - Mobile-friendly Tailwind CSS interface
- 🐳 Docker Ready - Development containers with hot reload
- ☸️ Kubernetes Deployments - Production-ready manifests
- 🔄 CI/CD Pipeline - Automated testing and deployment
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ Database │
│ │ │ │ │ │
│ • HTML/Tailwind │───▶│ • Flask App │───▶│ • PostgreSQL │
│ • JavaScript │ │ • SQLAlchemy │ │ • External VM │
│ • AJAX │ │ • Authentication│ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Docker and Docker Compose
- Git
# Clone and navigate to the project
git clone <repository-url>
cd task-manager/app
# Copy environment variables
cp .env.example .env
# Start all services (database will be auto-initialized)
docker-compose up --build
# Access at http://localhost:8000
# Demo login: demo / demo123
The application handles database setup automatically:
For Development (Docker Compose):
- Tables created automatically on first run
- Demo user and sample tasks inserted via
init_db.py
- Database ready check ensures proper startup sequence
- No manual setup required
For Production with Flask-Migrate:
# Initialize migrations (first time only)
python setup_migrations.py
# For schema changes
flask db migrate -m "Description of changes"
flask db upgrade
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start PostgreSQL container
docker run -d --name taskmanager-db \
-e POSTGRES_USER=todouser \
-e POSTGRES_PASSWORD=todopass \
-e POSTGRES_DB=todoapp \
-p 5432:5432 postgres:15-alpine
# Run the application
python app.py
# Run tests with coverage
docker-compose run web pytest --cov=. --cov-report=html
- Kubernetes cluster
- PostgreSQL database (external VM)
- Docker registry access
# Build production image
docker build -t taskmanager:latest .
# Push to your registry
docker push your-registry/taskmanager:latest
# Update image in k8s/02-web-app.yaml
# Update DATABASE_URL in k8s/00-namespace-secrets.yaml
# Deploy to Kubernetes
kubectl apply -f k8s/
# Check deployment
kubectl get pods -n taskmanager
DATABASE_URL
: PostgreSQL connection to external VMSECRET_KEY
: Secure random key for Flask sessions
- Security: Password hashing, CSRF protection, input validation
- CI/CD: Separate workflows for testing and deployment
- Scalability: Kubernetes HPA, resource management
- Health Monitoring: Built-in health checks and probes
task-manager/
├── app.py # Main Flask application
├── models.py # Database models
├── templates/ # HTML templates
├── static/ # CSS/JS assets
├── k8s/ # Kubernetes manifests
├── .github/workflows/ # CI/CD pipelines
├── Dockerfile # Production container
├── Dockerfile.dev # Development container
├── docker-compose.yml # Local development
└── requirements.txt # Python dependencies
- Use
docker-compose logs -f web
to follow application logs - Reset database:
docker-compose down -v && docker-compose up -d
- Access pgAdmin at http://localhost:8080 (admin@taskmanager.local / admin123)
Happy Learning! 🚀