How to design a to-do app (frontend)
The first sections are free. The deep dives, level expectations and quiz are part of Pro.
On this page
- The problem
- Clarifying questions
- The requirements menu
- Non-functional requirements
- Core entities
- The API
- The high-level design
- What breaks first
- The deep dives
- Entity fields
- Ticking a task off at once, and the server saying no
- Reordering
- The same list on two devices
- Variants
- What each level is expected to show
- The 30-second answer
- Quiz
The problem
A web client for lists of tasks that someone adds, edits, ticks off and drags into order, kept in step with the same lists on their phone and laptop. The answer turns on one fact: the screen has to change before the server has agreed, so the client needs a store it can roll back, a change id on each edit so a retry is harmless, and a way for each device to ask what changed since it last looked instead of reloading everything.
Clarifying questions
| Ask | Why it matters | A typical answer |
|---|---|---|
Is each list private to one person, or shared with others? | A private list means conflicts come from the same person on two devices, which is rare and can be settled simply. A shared list makes concurrent edits common and changes how much merging the client must do. | Private today: one person, several devices. Sharing a list with other people is out of scope, though it is a natural closing question. |
How long can a list get, and does the order matter? | A list that sorts by date has no reorder problem at all. A manually ordered list sizes how much a single drag must save, and whether the list needs virtualization. | Up to 300 active tasks in one list, in an order the person chooses by dragging or with the keyboard. |
What does the server give me: a plain task API, or a sync API with tokens and a push channel? | If the server can hand back changes since a token and nudge clients, the client's sync engine is small. If it offers just per-task endpoints, with no changes-since call and no push, the client is left polling and has to work around a reload limit. | Both: a |
Does it have to work with no connection, or just survive a patchy one? | Full offline use means a local database as the source of truth and a plan for long-queued changes. Surviving a bad signal means a change queue that persists and flushes when the connection returns. | Survive a patchy connection: an edit on the train must not be lost, and must reach the laptop when the phone reconnects. A fully offline product is a variant, not the core. |
How fast does a tick or a drag need to feel, and how fast should the first tasks appear? | These two numbers decide whether the client can wait for the server before painting, and whether the first paint can depend on a network call. | A tap or drag answers within 200 milliseconds, and the first tasks show within 2.5 seconds. |
Are reminders, repeating tasks, attachments or comments in scope? | Each is a product of its own: repeating tasks need date rules, attachments need uploads, and reminders need a server-side scheduler. Any of them can swallow the round. | All out of scope. The round is about the list itself: add, edit, tick, reorder, and keeping devices in step. |
Non-functional requirements
| Requirement | What it forces |
|---|---|
A tick or a drag answers within 200 milliseconds | The checkbox and the dragged row must repaint from the client store before any network call returns, so a change is applied to the store first and sent afterwards. It also keeps heavy work, such as re-sorting a long list, out of the tap handler. |
The first tasks show within 2.5 seconds | The first paint can't depend on a full sync of all lists. Load the open list first, show tasks kept in local storage from the last visit while the fetch runs, and sync the other lists afterwards. |
A list holds up to 300 active tasks | A reorder must not write a position to each task below the move, since that would be hundreds of writes for one drag. It also means the list is long enough that re-rendering all rows on each change needs care, though short enough that virtualization is a judgment call rather than a must. |
No change is lost or applied twice when a request is retried | Each change carries an id the server remembers, so a retry after a timeout is recognized and skipped. Changes wait in a queue that outlives the request, and the queue is persisted so a page reload on a bad connection does not drop them. |
A change on one device shows on another without a manual reload | A sync engine on each device that asks for changes since its last token when the tab becomes visible, when the connection returns and on a nudge from the server, within a reload budget of 100 full fetches per person every 15 minutes. |
Core entities
| Entity | What it holds |
|---|---|
List | A named collection of tasks with its own place among the person's lists. |
Task | One row in a list, with its done state and its position. |
Pending change | A single edit the person made that the server has not yet accepted. |
Sync state | What this device knows about how far it has caught up with the server. |
The API
| Endpoint | Notes |
|---|---|
| The first load of a list. The token that comes back is the starting point for incremental syncs; the client stores it with the list. |
| The main write path. The client sends its pending changes in order, each carrying an id of its own; the server answers per change (accepted or an error), maps temporary ids to real ones, and in the same response returns what changed elsewhere since the token. One round trip both pushes and pulls. |
| The catch-up read, used when the tab regains focus, when the connection returns and after a server nudge. It is far cheaper than reloading lists, and it is the call that keeps devices under the full-reload limit. |
| A single-field write for the simple case. The header carries the same change id the queue holds, so a retried |
The high-level design
Step 1 of 4
View, store, server
Start with the smallest client that works: the task list view reads from a client store that holds tasks by id and each list as an ordered array of ids, and the store talks to the server directly. A tick writes PATCH /tasks/{id} and the store updates when the answer comes back. It shows the data flow, and it already fails the brief: on a slow connection the checkbox does not change for as long as the request takes, well past the 200 milliseconds a tap gets, and a refusal has nothing to undo because nothing was shown.
What breaks first
The deep dives
Ticking a task off at once, and the server saying no. Someone on a slow phone connection ticks a task. The server takes a while and then refuses, because the task was deleted on another device. What do they see at each moment, and what does the client do with the change it already showed?
Reordering. Someone drags the last task of a 300-task list to the top on their phone while the same list is open on their laptop. What does the client send, how many tasks change, and what does the laptop show?
The same list on two devices. Someone renames a task on their phone on a train with a patchy signal while the same list is open on their laptop at home. How does the laptop find out, what happens to the edit while the phone has no signal, and what if both devices changed the same task?
Concepts this guide uses
Sources
- Rollout: Todoist API essential guide (rate limits for full and partial sync)
- Scalekit blog: Todoist MCP vs Todoist API for AI agents (command uuid idempotency, temp_id, sync_token)
- pkg.go.dev: todoist-api-go sync package (Command with uuid and temp_id)
- Todoist help: Usage limits in Todoist
- Microsoft Graph: todoTask delta
- Microsoft Graph: Use delta query to track changes
- Microsoft Q&A: Graph delta API, delta token expiration and handling 410 resyncRequired
- TanStack Query: Optimistic updates
- Figma blog: Realtime editing of ordered sequences
- web.dev: Interaction to Next Paint (INP)
- web.dev: Web Vitals
- W3C ARIA Authoring Practices Guide: Example listboxes with rearrangeable options
- MDN: Page Visibility API
- MDN: Navigator: onLine property