Project Workshop — React Kanban Board
This is a portfolio submission, not a copy-and-run tutorial. A reviewer must be able to clone it, configure it without guessing, execute the critical path, observe a deliberate failure, run the tests, and understand the most important…
- What you are building
- Architecture
- Acceptance criteria
- Suggested repository structure
- Build plan: vertical slices
React · TypeScript · custom hooks
Expected effort: 30–48 focused hours · Minimum meaningful tests: 12What you are building
This is a portfolio submission, not a copy-and-run tutorial. A reviewer must be able to clone it, configure it without guessing, execute the critical path, observe a deliberate failure, run the tests, and understand the most important design decision from the README.
Architecture
Critical interaction
Ownership table
| Boundary | Owns | Must not own |
|---|---|---|
| Interface | Parsing, protocol validation, identity extraction, status or presentation mapping | Core business invariants |
| Application/domain | Authorization inputs, state transitions, orchestration, transaction intent | Framework globals or raw transport objects |
| Repository/gateway | One persistence or external protocol, bounded retries, error translation | Product policy |
| Background/UI projection | Recoverable derived state and delivery progress | Hidden authoritative truth |
| Operations | Configuration, health, deployment, telemetry, recovery | Business decisions encoded only in dashboards |
Acceptance criteria
| ID | Required behavior | Evidence |
|---|---|---|
| AC-1.1 | JSX transpilation to React.createElement produces the specified behavior inside JSX & components | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-1.2 | functional components + props destructuring produces the specified behavior inside JSX & components | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-1.3 | children prop and composition pattern produces the specified behavior inside JSX & components | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-1.4 | controlled vs uncontrolled components produces the specified behavior inside JSX & components | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-1.5 | key prop and reconciliation produces the specified behavior inside JSX & components | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.1 | useState: initial value/updater/batching (React 18) produces the specified behavior inside Props, state & useEffect | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.2 | lifting state up and prop drilling problem produces the specified behavior inside Props, state & useEffect | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.3 | immutable state updates (spread/Array methods) produces the specified behavior inside Props, state & useEffect | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.4 | useEffect dependencies, cleanup, common mistakes (stale closure/infinite loop) produces the specified behavior inside Props, state & useEffect | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.5 | useLayoutEffect vs useEffect produces the specified behavior inside Props, state & useEffect | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.1 | && vs ternary vs early return patterns produces the specified behavior inside Suspense & error boundaries | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.2 | React.lazy + Suspense for code splitting produces the specified behavior inside Suspense & error boundaries | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.3 | Error boundary class component produces the specified behavior inside Suspense & error boundaries | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.4 | react-error-boundary library produces the specified behavior inside Suspense & error boundaries | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.1 | Fragment and keyed Fragment produces the specified behavior inside Rendering edge cases | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.2 | derived state anti-pattern produces the specified behavior inside Rendering edge cases | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.3 | Strict Mode development double invoke produces the specified behavior inside Rendering edge cases | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.4 | event handler errors vs Error Boundaries produces the specified behavior inside Rendering edge cases | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.5 | Suspense data-source requirements produces the specified behavior inside Rendering edge cases | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
Suggested repository structure
1app/2├── routes-or-app-router/3├── components/{ui,features,errors}/4├── hooks/5├── lib/{api,auth,schemas,query-keys}/6├── state/7├── styles/8├── tests/{unit,integration,e2e}/9└── package.jsonBuild plan: vertical slices
| Milestone | Capability | First implementation | Exit condition |
|---|---|---|---|
| 1 | JSX & components | JSX transpilation to React.createElement; functional components + props destructuring; children prop and composition pattern | Demonstration plus focused tests |
| 2 | Props, state & useEffect | useState: initial value/updater/batching (React 18); lifting state up and prop drilling problem; immutable state updates (spread/Array methods) | Demonstration plus focused tests |
| 3 | Suspense & error boundaries | && vs ternary vs early return patterns; React.lazy + Suspense for code splitting; Error boundary class component | Demonstration plus focused tests |
| 4 | Rendering edge cases | Fragment and keyed Fragment; derived state anti-pattern; Strict Mode development double invoke | Demonstration plus focused tests |
| 5 | Hardening and delivery | Security, recovery, telemetry, performance, documentation | Full acceptance suite and recorded demonstration |
For each milestone, first create a failing acceptance test or a reproducible command. Implement the thinnest path to an observable result, add the nearest durable invariant, inject one expected failure, and refactor only after evidence protects the behavior.
Reference vertical slice
1import { useEffect, useState } from 'react';2
3type Task = { id: string; title: string; done: boolean };4
5export function TaskList({ initial }: { initial: Task[] }) {6 const [tasks, setTasks] = useState(initial);7
8 useEffect(() => {9 const controller = new AbortController();10 refreshTasks(controller.signal).then(setTasks).catch(error => {11 if (error.name !== 'AbortError') report(error);12 });13 return () => controller.abort();14 }, []);15
16 return <ul>{tasks.map(task => (17 <li key={task.id}>18 <button onClick={() => setTasks(current => current.map(item => item.id === task.id ? { ...item, done: !item.done } : item))}>19 {task.done ? '✓' : '○'} {task.title}20 </button>21 </li>22 ))}</ul>;23}Expected result
1The list preserves state by task ID, updates immutably, and aborts the refresh when unmounted.Code reading
| Line | Code | Explanation |
|---|---|---|
| 1 | import { useEffect, useState } from 'react'; | Imports the named dependency; import executes the module once per interpreter cache and binds selected names here. |
| 3 | type Task = { id: string; title: string; done: boolean }; | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 5 | export function TaskList({ initial }: { initial: Task[] }) { | Implements the next tsx statement in the example's data flow. |
| 6 | const [tasks, setTasks] = useState(initial); | Binds a JavaScript value used by the component or operation. |
| 8 | useEffect(() => { | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 9 | const controller = new AbortController(); | Binds a JavaScript value used by the component or operation. |
| 10 | refreshTasks(controller.signal).then(setTasks).catch(error => { | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 11 | if (error.name !== 'AbortError') report(error); | Evaluates the condition and enters this branch only when it is truthy. |
| 12 | }); | Implements the next tsx statement in the example's data flow. |
| 13 | return () => controller.abort(); | Returns the observable result to the caller and ends this invocation. |
| 14 | }, []); | Implements the next tsx statement in the example's data flow. |
| 16 | return | Returns the observable result to the caller and ends this invocation. |
| 17 | | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 18 | | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 19 | {task.done ? '✓' : '○'} {task.title} | Implements the next tsx statement in the example's data flow. |
| 20 | | Implements the next tsx statement in the example's data flow. |
| 21 | | Implements the next tsx statement in the example's data flow. |
| 22 | ))}; | Implements the next tsx statement in the example's data flow. |
| 23 | } | Implements the next tsx statement in the example's data flow. |
Risk register
| Area | Failure to reproduce | Required design response |
|---|---|---|
| JSX & components | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. | Use stable domain IDs as keys and compose with children. |
| Props, state & useEffect | Array indexes break identity when items reorder, and mutating props/state prevents reliable change reasoning. | Use stable domain IDs as keys and compose with children. |
| Suspense & error boundaries | Suspense does not automatically handle every client fetch library or event-handler exception. | Place boundaries around meaningful product regions and preserve retry paths. |
| Rendering edge cases | Suspense does not automatically handle every client fetch library or event-handler exception. | Place boundaries around meaningful product regions and preserve retry paths. |
Engineering checklist for this stack
- To do: provide keyboard and screen-reader operation
- To do: model loading, empty, error, and permission states
- To do: cancel obsolete requests and streams
- To do: validate network data at runtime
- To do: keep server and local UI state in appropriate owners
Test strategy
Implement at least 12 meaningful cases. A long list of shallow happy-path tests does not satisfy the requirement.
| Risk class | Minimum | Examples |
|---|---|---|
| Happy path and contract | 2 | Correct output, status/schema, durable state |
| Validation and boundaries | 2 | Empty, malformed, extreme, unsupported transition |
| Authorization or trust boundary | 1 | Missing identity, wrong tenant/role, injection or unsafe content |
| Failure and recovery | 2 | Timeout, retry, rollback, reconnect, dependency outage |
| Duplicate or concurrency | 1 | Same identity twice, racing update, redelivery |
| Performance and operations | 4 | Query bound, lag, p95, resource limit, telemetry |
Representative test scaffold
1import { render, screen } from '@testing-library/react';2import userEvent from '@testing-library/user-event';3
4it('shows a recoverable error when the mutation fails', async () => {5 server.use(http.post('/api/action', () => HttpResponse.json({ detail: 'failed' }, { status: 503 })));6 render(<Feature />);7 await userEvent.click(screen.getByRole('button', { name: /submit/i }));8 expect(await screen.findByRole('alert')).toHaveTextContent(/try again/i);9});Failure drills
- Stop the primary external dependency during the critical path. Capture the failure, cleanup, telemetry, and recovery.
- Repeat the same operation with the same stable identity. Prove one logical outcome or document why repetition is forbidden.
- Crash after durable state changes but before the response, acknowledgement, or projection. Re-run and reconcile.
- Submit the largest supported input and one slightly larger input.
- Remove one permission and prove denial without state change or information leakage.
- Roll back the change or restore the dependency, then run a smoke test and reconciliation check.
Performance experiment
State the dataset, payload distribution, concurrency, rate, duration, cache state, and resource limits before measuring. Publish p50, p95, p99, throughput, error rate, and the technology-specific correctness signal such as query count, consumer lag, duplicate effects, rendered updates, token cost, or recall. Change one variable at a time and retain raw output.
Submission package
- Complete source with a locked/reproducible environment.
- README.md with problem, architecture, setup, commands, configuration, assumptions, and trade-offs.
- Acceptance and risk-focused tests with a short explanation of what mocks intentionally do not cover.
- One design record explaining the most consequential choice and a rejected alternative.
- Security notes, sample non-secret configuration, and cleanup commands.
- A demonstration record: terminal transcript, screenshots, trace, query plan, or metrics dashboard.
- A 5–8 minute walkthrough following input → validation → state → failure → evidence.
Grading rubric
| Dimension | Weight | Full-credit evidence |
|---|---|---|
| Product behavior | 25 | Acceptance criteria pass through real public boundaries |
| Architecture and ownership | 20 | Responsibilities and state authority are explicit |
| Tests and recovery | 20 | Important negative, duplicate, concurrent, and outage cases pass |
| Security and data correctness | 15 | Least privilege, validation, constraints, and secret handling are demonstrated |
| Performance and operations | 10 | Reproducible measurement, useful telemetry, and rollback/recovery |
| Documentation and explanation | 10 | A new reviewer can reproduce and defend the result |
Mastery check
How well can you recall this?
Finished this lesson?