This is a minimal, production‑minded starter for your TaskFlow app:
- Backend: Flask, JWT auth, SQLAlchemy, Postgres
- Frontend: React (Vite), Tailwind
- Dev: Docker Compose (db + backend + frontend)
- CI: simple syntax/build checks
Requirements: Docker Desktop or Docker Engine + docker-compose
# From project root
docker compose up --build
- Frontend: http://localhost:5173
- API: http://localhost:5000/api
- Postgres: localhost:5432 (db=taskflow / user=taskflow / pass=taskflow)
First time: tables are auto-created by Flask on startup.
- Open http://localhost:5173
- Click Create account, register a new user
- You’ll be auto‑signed in; create tasks on the left, see your list on the right
Backend
cd backend
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Edit .env (copy from .env.example) then export it, or set env inline:
export DATABASE_URL=sqlite:///taskflow.db
export JWT_SECRET_KEY=change-me
python app.py
Frontend
cd frontend
npm install
cp .env.example .env # Ensure VITE_API_URL points to your backend (http://localhost:5000)
npm run dev
POST /api/auth/register
→{ email, password }
POST /api/auth/login
→ returns{ access_token, user }
GET /api/tasks
(JWT) → list current user’s tasksPOST /api/tasks
(JWT) →{ title, description? }
PUT /api/tasks/:id
(JWT) →{ title?, description?, is_done? }
DELETE /api/tasks/:id
(JWT)
Add header: Authorization: Bearer <token>
for protected routes.
- Launch Ubuntu EC2 (t2.micro ok). Open security group ports 80, 5000, 5173 (for dev) or set up a reverse proxy (nginx) for production.
- SSH into the instance, install Docker:
curl -fsSL https://get.docker.com | sh sudo usermod -aG docker $USER && newgrp docker
- Copy this repo to the server (git clone or scp the zip).
- In project root, run:
docker compose up --build -d
- Optional: add a domain + nginx reverse proxy later. For a quick dev demo, visit
http://EC2_PUBLIC_IP:5173
For production, build the frontend (
npm run build
) and serve via nginx, and restrict public access to only port 80/443.
This workflow checks Python syntax and builds the frontend:
.github/workflows/ci.yml
You’ll need a repo to push this project. Secrets are only needed if you later push images to Docker Hub/GHCR.
taskflow/
backend/ # Flask API + JWT + Postgres
frontend/ # React + Vite + Tailwind
docker-compose.yml
- Add migrations (Alembic/Flask-Migrate) before evolving schemas
- Add unit tests (pytest) and linters (ruff/flake8, eslint)
- Harden CORS & JWT settings, use HTTPS behind a reverse proxy
- Replace dev secrets with real secrets (env vars or Secrets Manager)
- Add role-based permissions if needed