Frontend Architecture Blueprint
Recommended Layering
app/ → routing + page composition
features/ → business modules per domain
components/ → reusable UI components
lib/ → shared utility, API, config
types/ → shared types/contracts
Data Flow Principles
- UI → use-case/action → API client → mapping → UI model
- Avoid letting UI components depend directly on API transport details.
State Strategy
- Server state: query/cache pattern.
- Local UI state: component scoped.
- Use global state only for cross-feature concerns.