TaskFlow is a small task manager I built so I could test software I own from end to end. The app is deliberately simple. The point is the testing around it: unit, API and E2E suites, plus a set of bugs I planted on purpose and the tests that catch them.
It's a companion to my QA Engineering Journey.
The app is Node and Express with SQLite (better-sqlite3) and a single static HTML page for the UI. Vitest runs the unit tests, Supertest the API tests and Playwright the E2E tests. GitHub Actions runs all of them.
npm install
npm start # http://localhost:3000
npm test # unit + API testsAuth uses tokens. POST /api/auth/login returns a token, which you send as
Authorization: Bearer <token>. Every /api/tasks route needs a token and only works on the
signed-in user's own tasks.
Register and login share a rate limit of 20 requests per minute per client IP. Past that they
answer 429 with a Retry-After header. Set AUTH_RATE_LIMIT to change the limit, or to 0 to
turn it off; load tests do that so they measure the server, not the limiter.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /health |
no | health check, returns { "status": "ok" } |
| POST | /api/auth/register |
no | create account (400 missing fields, 409 taken) |
| POST | /api/auth/login |
no | returns { token } (401 invalid credentials) |
| POST | /api/auth/logout |
yes | invalidate current token (204) |
| GET | /api/tasks |
yes | list the user's tasks |
| GET | /api/tasks/:id |
yes | get one (404 missing, 403 not owner) |
| POST | /api/tasks |
yes | create (400 invalid input) |
| PUT | /api/tasks/:id |
yes | full update (404, 403 or 400) |
| DELETE | /api/tasks/:id |
yes | delete (204, or 404 or 403) |
The rules are simple. A title is required, status is one of todo, doing or done, due_date
is optional but must be a real YYYY-MM-DD date, and users can only reach their own tasks.
Every layer runs in CI.
npm test # unit + API (Vitest + Supertest)
npm run test:e2e # E2E (Playwright starts the app itself)- docs/TEST-STRATEGY.md explains the test pyramid, what each layer owns and the techniques used.
- docs/BUGS-FOUND.md covers the 4 seeded bugs and the tests that caught them, plus a real stored XSS found in a later test audit.
I built it in seven milestones. The counts below are what each milestone added at the time.
- Scaffold: app skeleton, SQLite, a tasks endpoint and green CI.
- The app: register, log in and log out, full task CRUD, the business rules and access control.
- Unit tests: 27 validator cases using equivalence partitioning and boundary values, including impossible dates.
- API tests: 28 cases covering auth, the full CRUD lifecycle, 400/401/404 responses and the 403 for another user's task.
- E2E tests: Playwright journeys for the main flow, a failed login, a session that survives a reload, and adding and deleting tasks.
- Seeded bugs: 4 planted bugs, each caught by a test (see docs/BUGS-FOUND.md).
- Docs: the test strategy, this README and the CI badge.
- ESLint and Prettier, both enforced in CI (
npm run lint,npm run format:check). - Coverage with
npm run test:coverage. The HTML report is atcoverage/index.html. - CI runs three parallel jobs on every push and PR: lint and format, unit and API tests with coverage, and E2E. Coverage is reported, not gated.
- CONTRIBUTING, SECURITY, issue and PR templates, Dependabot and an MIT LICENSE.
.editorconfigand.node-versionkeep environments consistent.
It runs on any host that keeps a Node process alive. A Render Blueprint
(render.yaml) is included, and DEPLOY.md walks through the steps.
taskflow-under-test/
├── src/
│ ├── app.js server.js db.js auth.js validators.js
│ ├── routes/ auth.js tasks.js
│ └── middleware/ requireAuth.js
├── public/index.html # auth + tasks UI (data-testid hooks for E2E)
├── tests/
│ ├── unit/ *.test.js (pure functions, no server)
│ ├── api/ smoke / auth / tasks
│ └── e2e/ journey.spec.js
├── docs/ TEST-STRATEGY.md BUGS-FOUND.md
└── .github/workflows/ci.yml # lint job · unit+API job · E2E job
The original plan is in the journey repo: TaskFlow project brief.
