Fullstack CourseLearn by building
Back to roadmap

Week 2 — Managing State, Escape Hatches & Data

Days 1–2 build React state and Effects fluency; days 3–5 apply Redux Toolkit and TanStack Query to Nest-backed data — then ship a Todo mini-project (RTK + Query).

End-of-week mini-project · practice only

Todo app (RTK + Query)

Ship a Todo UI where unfinished draft text lives in Redux Toolkit and the todo list comes from TanStack Query (Nest or a stub).

Definition. A Todo mini-project is a client that separates unfinished composer state (RTK) from server-backed todo rows (TanStack Query + Axios cookies), matching this course’s ownership rule.

In simpler words. Type a draft in Redux. When you save, Query talks to Nest (or a mock). Never store the Nest list in Redux.

Deliverables

  • configureStore + createSlice for draft text / selected todo id / filter chrome
  • typed useAppDispatch / useAppSelector; Provider on the client tree
  • useQuery list + useMutation create/toggle/delete with invalidateQueries on success
  • Axios withCredentials for cookie JWT; no JWT in localStorage
  • Honest loading / empty / error UI; disable submit while mutation pending

Acceptance checklist

- [ ] RTK owns draft + selection (not the Nest todos array)
- [ ] Query owns the list; onSuccess clears draft + invalidateQueries
- [ ] Redux DevTools shows draft updates as you type
- [ ] Cookie credentials path works (or documented stub)
- [ ] Empty ≠ loading; mutation errors visible on the form
- [ ] No JWT in localStorage

Tips

  • If Nest Todos API is not ready, mock the HTTP contract first, then swap the queryFn.
  • Reuse the same ownership table you will need for Week 4 Notes UI.
  • Practice filterDraft vs appliedFilters if you add search — typing should not refetch every keystroke.