Skip to content

JS1820/Taskflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TaskFlow — Full‑Stack Starter (Flask + React + Postgres + Docker)

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

1) Quick Start (Docker)

Requirements: Docker Desktop or Docker Engine + docker-compose

# From project root
docker compose up --build

First time: tables are auto-created by Flask on startup.

Register & Login

  1. Open http://localhost:5173
  2. Click Create account, register a new user
  3. You’ll be auto‑signed in; create tasks on the left, see your list on the right

2) Run Locally (no Docker)

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

3) API Overview

  • POST /api/auth/register{ email, password }
  • POST /api/auth/login → returns { access_token, user }
  • GET /api/tasks (JWT) → list current user’s tasks
  • POST /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.


4) AWS EC2 (one simple way)

  1. Launch Ubuntu EC2 (t2.micro ok). Open security group ports 80, 5000, 5173 (for dev) or set up a reverse proxy (nginx) for production.
  2. SSH into the instance, install Docker:
    curl -fsSL https://get.docker.com | sh
    sudo usermod -aG docker $USER && newgrp docker
  3. Copy this repo to the server (git clone or scp the zip).
  4. In project root, run:
    docker compose up --build -d
  5. 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.


5) CI (GitHub Actions)

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.


6) Project Structure

taskflow/
  backend/          # Flask API + JWT + Postgres
  frontend/         # React + Vite + Tailwind
  docker-compose.yml

7) Notes & Next Steps

  • 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

About

Team Productivity Web App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published