This document defines the app flow, scope, and engineering rules to prevent duplicate components and inconsistent patterns.
Primary routes live under src/app.
- Public entry:
src/app/page.tsxandsrc/app/(public) - Auth:
src/app/auth/* - Onboarding:
src/app/onboarding - Dashboard:
src/app/dashboard - Marketplace:
src/app/marketplace/* - Collaborations:
src/app/collaborations/* - Notifications:
src/app/notifications - Messages:
src/app/messages/* - Payments:
src/app/payments/* - Profile & Settings:
src/app/profile/*,src/app/settings/* - Streaming & Analytics:
src/app/streaming,src/app/analytics
- Global client state: Redux Toolkit (single store).
- Server state: @tanstack/react-query (queries/mutations, caching, invalidation).
- Local UI state: React
useState/useReducerinside components. - Disallowed: parallel state stores (e.g., Zustand, Recoil, MobX) for global state.
- Use react-hot-toast only.
- Centralize toast helpers in
src/lib/toast(single wrapper) and import from there. - Do not mix toast systems (no
sonnerin new code).
- No external UI frameworks: no MUI, Chakra, AntD, Mantine.
- Use Tailwind + local components in
src/components. - Use Radix primitives only through our own wrappers in
src/components/ui. - Before creating a new component, search for an existing one:
rg -n "ComponentName" src/components
- All HTTP calls go through
src/lib/api/*using the sharedapiClient. - No direct
fetchin components (except Next.js route handlers). - Keep API request/response typing in
src/types/*.
- Pages:
src/app/**/page.tsxonly. - Shared UI:
src/components/ui/*. - Feature components:
src/components/<feature>/*. - Feature hooks:
src/hooks/features/*. - API hooks:
src/hooks/features/*should callsrc/lib/api/*only. - State:
src/store/*(Redux Toolkit slices).
- Do not create a new file if a similar component exists.
- Reach out to the administrator if there is need to create a file/folder or use a library for a particular feature
- Prefer extending existing components over creating variants.
- All new shared patterns must be documented here.
- Global state: Redux Toolkit.
- Toasts: react-hot-toast.
- Data fetching: @tanstack/react-query.
- If you must deviate, open a short PR comment or add a note here explaining the reason.