Phase 1 of 7

Local Development Environment

Run a baseline multi-container TaskFlow stack locally with repeatable startup behavior and end-to-end task management working through the UI.

Overview

Stand up the full local development stack: API, frontend, Postgres, and Redis. The API should expose REST endpoints for tasks and health. The frontend should support creating, listing, and completing tasks. Both services must be containerised with multi-stage Dockerfiles and wired together in a Compose file. This is the foundation everything else builds on — no phase advances without a working, repeatable local environment.

What to build

Deliverables

Advance only when these outputs exist in your code or compose definitions.

  1. REST API with endpoints: GET /health, GET /api/tasks, POST /api/tasks, PATCH /api/tasks/:id, DELETE /api/tasks/:id
  2. Frontend with task list view, create task form, and mark-complete action
  3. Multi-stage Dockerfile for the API (build stage + slim runtime stage)
  4. Multi-stage Dockerfile for the frontend (build stage + nginx or node serve stage)
  5. docker-compose.dev.yml wiring api, frontend, db (postgres:16-alpine), and redis (redis:7-alpine)
  6. .env.example listing every required environment variable with placeholder values
  7. README section describing how to clone, configure, and start the stack

Done when

Success criteria

These are acceptance indicators, not a checklist to start from.

  • docker compose -f docker-compose.dev.yml up -d starts all four services without errors
  • All services show as healthy or running in docker compose ps within 30 seconds
  • GET http://localhost:8000/health returns HTTP 200 with a JSON body
  • POST /api/tasks creates a task; GET /api/tasks returns it; the frontend reflects the change
  • Stopping and restarting the stack with docker compose down && docker compose up -d preserves all task data
  • No plaintext secrets appear in docker-compose.dev.yml or any committed file
  • Both API and frontend containers restart automatically if they crash

Verification

Testing and validation

Run these in order. Confirm each result before moving to the next step.

  1. docker compose -f docker-compose.dev.yml up -d

    — all four containers should start

  2. docker compose ps

    — confirm api, frontend, db, and redis are all Up or healthy

  3. curl http://localhost:8000/health

    — expect HTTP 200 and a JSON response with status ok

  4. curl http://localhost:8000/api/tasks

    — expect HTTP 200 and an empty array on a fresh start

  5. curl -X POST http://localhost:8000/api/tasks -H 'Content-Type: application/json' -d '{"title":"Test task","description":"From capstone phase 1"}'

    — expect HTTP 201 and a task object with an id

  6. Open http://localhost:3000 in a browser and confirm the task you just created appears in the list
  7. Mark the task as complete in the UI and confirm the UI updates without a page reload

  8. docker compose down && docker compose up -d

    — confirm the task you created still exists after restart