Core Principles
- One direction for data: Components → Hooks (React Query) →
lib/actions(services) → HTTP adapters. - Server data is not in stores: Stores keep IDs/filters/UI flags only.
- Shareable state belongs in the URL: filters/sort/page are linkable & restorable.
- Hooks are pure behavior: UX (toasts/navigation) stays in components.
- One list shape across the app:
{ items, page?, totalPages?, nextCursor?, hasNextPage }. - Test seams, not guts: adapters few; services most; hooks behavior; a handful of E2E flows.
Short, timeless, and enforced by our PR checklist and ESLint rules.
Last updated on