TaskFlow is a modern, cloud-ready task manager with an AI assistant that helps you prioritize tasks, generate a daily plan, and keep momentum. Built as a real-world, production-style project to showcase backend + AI + cloud skills.
docker compose up -d --build
docker compose exec api alembic upgrade headThen open:
- Backend API docs: http://localhost:8000/docs
- Frontend: http://localhost:5173
- Task Management: Projects, tasks, due dates, statuses, tags
- AI Assistant: OpenAI-powered prioritization with rationale and daily plan generation
- Search & Filters: By project, status, tags, due range
- Auth: Register/login with JWT tokens
- Fast APIs: FastAPI + Pydantic + OpenAPI docs
- Scalable DB: PostgreSQL + SQLAlchemy + Alembic migrations
- Caching & Rate Limiting: Redis-backed with per-user limits
- DevOps Ready: Docker, CI/CD (GitHub Actions), Prometheus metrics, AWS ECS deployment
┌─────────────────────────────┐
│ React (Vite + Tailwind) │
└──────────────┬──────────────┘
│ HTTPS (JWT)
┌──────────────▼──────────────┐
│ FastAPI Backend │
│ - /auth, /tasks, /projects │
│ - /ai/prioritize, /metrics │
└──────────────┬──────────────┘
│
┌─────────┼──────────┐
│ │ │
┌────▼─┐ ┌───▼──┐ ┌────▼────────┐
│Redis │ │ PG │ │ OpenAI API │
│cache │ │ DB │ │ (external) │
└──────┘ └──────┘ └─────────────┘
- Frontend: React (Vite), Tailwind, React Query
- Backend: Python, FastAPI, Pydantic, SQLAlchemy, Alembic, JWT
- Databases: PostgreSQL, Redis
- AI: OpenAI GPT-4, rule-based fallback
- DevOps: Docker, Docker Compose, GitHub Actions, AWS ECS + RDS + ECR
- Testing: pytest, httpx, React Testing Library
taskflow/
├── backend/
│ ├── app/
│ │ ├── main.py (FastAPI app and routes)
│ │ ├── config.py (settings via pydantic)
│ │ ├── models.py (SQLAlchemy models)
│ │ ├── schemas.py (Pydantic DTOs)
│ │ ├── deps.py (dependencies: db, auth)
│ │ ├── routers/
│ │ │ ├── auth.py
│ │ │ ├── tasks.py
│ │ │ ├── projects.py
│ │ │ └── ai.py
│ │ ├── services/
│ │ │ ├── ai.py (rule-based + LLM adapter)
│ │ │ └── tasks.py (business logic)
│ │ └── utils/ (hashing, rate limit, logging)
│ ├── alembic/ (DB migrations)
│ ├── tests/ (pytest)
│ ├── Dockerfile
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── hooks/
│ │ ├── App.tsx
│ │ └── main.tsx
│ ├── vite.config.ts
│ ├── Dockerfile
│ └── package.json
├── docker-compose.yml
├── .env.example
└── README.md
DATABASE_URL=postgresql+psycopg://taskflow:taskflow@db:5432/taskflow
REDIS_URL=redis://cache:6379/0
JWT_SECRET=your_super_secret_key_change_this
OPENAI_API_KEY=sk-your_openai_key_here
AI_PROVIDER=openai
CORS_ORIGINS=http://localhost:5173
LOG_LEVEL=INFO
VITE_API_BASE=http://localhost:8000
# Build and start all services
docker compose up -d --build
# Run migrations
docker compose exec api alembic upgrade head
# Check logs
docker compose logs -f api
# Stop
docker compose downBackend:
cd backend
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reloadFrontend:
cd frontend
npm install
npm run devPOST /auth/register— email, password → access_token, refresh_tokenPOST /auth/login— email, password → access_token, refresh_tokenPOST /auth/refresh— refresh_token → access_token
GET /tasks?status=&project_id=&due_from=&due_to=&skip=0&limit=20— list tasksPOST /tasks— create taskGET /tasks/{id}— get taskPATCH /tasks/{id}— update taskDELETE /tasks/{id}— delete task
GET /projects— list projectsPOST /projects— create projectPATCH /projects/{id}— update projectDELETE /projects/{id}— delete project
POST /ai/prioritize— prioritize a list of tasks with OpenAI
Example request:
{
"tasks": [
{
"title": "Finish OS HW2",
"due_at": "2025-02-01T17:00:00Z",
"estimated_minutes": 120,
"importance": 5
},
{
"title": "Apply to 5 SWE internships",
"due_at": null,
"estimated_minutes": 90,
"importance": 4
}
]
}Example response:
{
"results": [
{
"title": "Finish OS HW2",
"score": 0.91,
"rationale": "Imminent deadline; high importance; manageable effort."
},
{
"title": "Apply to 5 SWE internships",
"score": 0.78,
"rationale": "Career critical; no hard deadline; schedule today if time remains."
}
],
"plan": [
"14:00-16:00 Finish OS HW2",
"16:15-17:45 Apply to internships",
"18:00-19:00 Break and review progress"
]
}GET /healthz— health checkGET /readyz— readiness checkGET /metrics— Prometheus metrics
docker compose exec api pytest -vcd frontend
npm test- Build and push images to ECR:
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <account-id>.dkr.ecr.us-east-1.amazonaws.com
docker build -t taskflow-api backend/
docker tag taskflow-api:latest <account-id>.dkr.ecr.us-east-1.amazonaws.com/taskflow-api:latest
docker push <account-id>.dkr.ecr.us-east-1.amazonaws.com/taskflow-api:latest-
Create ECS task definition, service, load balancer (see Terraform in
/infraor AWS Console) -
Create RDS Postgres and ElastiCache Redis in same VPC
-
Set environment variables in ECS task definition
- Push repo to GitHub
- Connect to Render/Railway
- Add Postgres and Redis add-ons
- Set environment variables
- Deploy
GitHub Actions workflow (.github/workflows/ci.yml):
- Run pytest and frontend tests on every PR
- Build Docker images
- Push to ECR on main branch
- Deploy to ECS on tag
- Cold start: ~2s (FastAPI startup)
- Median latency (GET /tasks): ~45ms (local, with cache)
- Monthly cost (AWS ECS + RDS + ECR): ~$50–100 depending on instance sizing