Skip to content

CONFIG: Setup Zustand Store Root and Devtools #13

@nayan458

Description

@nayan458

Task: Setup Zustand Store Root and Devtools

Type: Infrastructure
Milestone: M0-Project - Foundation
Estimate: S

What This Enables

Any client-side state that lives outside React Query (auth session, UI state, theme preference). Blocks auth store and global UI state work.

Deliverables

  • src/store/index.ts : store root / barrel export
  • src/store/auth.store.ts : example slice: user, token, setToken, clearSession
  • src/store/ui.store.ts : example slice: theme, sidebarOpen
  • Redux DevTools wired via zustand/middleware devtools wrapper
  • Persist middleware configured for auth slice (sessionStorage or localStorage decide and document)

Acceptance Criteria

  • Store slices are importable via @/store
  • Redux DevTools browser extension shows named store actions
  • clearSession() wipes persisted auth state correctly
  • No business logic in stores; stores hold state and simple setters only

Notes

  • Use the immer middleware only if nested state becomes necessary; avoid it by default
  • Keep stores flat; nested objects in Zustand cause subtle re-render bugs

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttype: infraProject setup, tooling, config, or architecture — not feature work

Type

No fields configured for Task.

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions