Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.34 KB

File metadata and controls

62 lines (45 loc) · 2.34 KB
title Todo App
version 0.1
status draft
created 2026-05-15
last_updated 2026-05-15
source hand-written
owner santosh

Todo App

Overview

A small web-based todo list application where a single user can manage tasks: add, view, mark complete, and delete. Built as a two-tier web app (separate frontend and backend processes) to exercise SAM's planning + contract-driven build pipeline on a realistic, demoable system.

Goals

  • A user can manage their todos in a browser without errors.
  • Frontend and backend run on separate ports and talk through a real HTTP API.
  • App works when launched via npm run dev from a fresh checkout.

Non-Goals

  • Authentication / multi-user / accounts
  • Persistent storage across server restarts
  • Mobile-specific layouts
  • Internationalization

Users

Single user. No accounts. Primary journey: open browser → see existing todos → add new todo → complete or delete existing.

Functional Requirements

  • Add todo: user types a title and submits; the new todo appears immediately at the top of the list.
  • List todos: all todos visible with title and completion state, newest first.
  • Mark complete: user toggles a todo's completion state; visual state updates.
  • Delete todo: user removes a todo; it disappears from the list.
  • Validation: title is required, non-empty, length ≤ 200 characters. Invalid input returns a clear inline error.

Non-Functional Requirements

  • API endpoints respond p95 < 50ms (in-memory store; trivial).
  • No JS runtime errors in the browser console for any happy-path or validation-rejection flow.
  • CORS configured for the Vite dev origin only — no wildcards.
  • Bootable: npm install && npm run dev from a fresh clone starts both processes without manual intervention.

Technical Constraints

  • Frontend: React 18 + Vite + TypeScript, served on http://localhost:5174.
  • Backend: Fastify + TypeScript, served on http://localhost:3001.
  • Layout: npm workspaces with client/ and server/ packages.
  • Storage: in-memory Map in the server process — no database in v1.
  • Concurrent dev: root npm run dev script uses concurrently to start both workspaces.

Out of Scope

  • User accounts, authentication, sessions
  • Database / persistent storage
  • Drag-to-reorder, tag editing, filtering, search
  • Mobile-specific responsive behavior