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