The challenge
A Kanban board looks simple until you make it correct: cards move between columns while positions stay contiguous, users can only touch their own data, and the UI feels instant even when the server is slow or fails.
I wanted one codebase that shows both halves done properly, and that a reviewer can run, test and read.
How I approached it
- 01
A versioned API with a uniform error envelope
Everything lives under
/api/v1with Form Request validation, API Resources and one JSON error shape. Auth routes are rate limited, and unauthenticated calls return a JSON 401 even without an Accept header (a bug the tests caught). - 02
Authorization in Policies, not controllers
Projects and tasks are protected by ownership Policies, with tests that assert 403 for other users' records and 404 for missing ones.
- 03
Reordering inside a transaction
Moving a card within or across columns rewrites positions in a single database transaction, keeping them contiguous. A test proves the whole move rolls back if a write fails midway.
- 04
Optimistic UI with rollback
Board state is a pure reducer. Moves apply instantly, and if the request fails the board rolls back to a snapshot. The demo has a 'Simulate network failure' switch so you can watch it happen.
- 05
One typed API interface, two adapters
The front end depends on a single
Apiinterface with anhttpAdapter(real Laravel) and amockAdapter(in-memory, localStorage). A shared contract test suite runs against the mock, and the unused adapter is tree-shaken out of each build. - 06
Drag and drop that works with a keyboard
Cards use HTML5 drag and drop plus labelled move buttons and live-region announcements, and the task editor is a native accessible
<dialog>.
Deliberate trade-offs
- The hosted demo uses the mock adapter, because the portfolio is a static site. The real HTTP adapter is unit tested with a stubbed fetch and smoke-tested by hand against a local Laravel server, but it has no automated browser test against a live API.
- Tokens are kept in localStorage for simplicity, and rollback uses a snapshot, so overlapping in-flight edits could interact badly. Both are documented in the README.
What I built
- Designed the REST API, policies, validation and the transactional reorder endpoint.
- Wrote 36 PHPUnit feature tests covering auth, token revocation, rate limiting, 422/403/404 cases and reorder rollback.
- Built the Kanban board, task dialog, due-date highlighting, priority badges, light/dark mode and responsive layout.
- Wrote 46 Vitest tests: adapter contract, board reducer, components and app-level flows including keyboard moves and rollback.
- Added a CI workflow and a README with an API table, architecture notes and run instructions.
What this project demonstrates
- Laravel and React built together, with one contract between them
- Policies, validation and transactions on the back end
- Optimistic UI, rollback and accessible drag and drop on the front end
- 82 automated tests across both halves