Module Invariants
-
Feature Ownership
- Each module represents a single feature or domain.
- A module owns the UI composition, interaction logic, and data wiring for its feature.
-
UI Composition Layer
- Modules are allowed to return JSX.
- Modules compose:
- components from
components/ - data from
services/ - feature-specific state and logic
- components from
-
No Primitive UI Definitions
- Modules must not define low-level or reusable UI primitives.
- All shared or generic UI must live in
components/.
-
Service-Driven Data Access
- Modules must not perform direct API or GraphQL calls.
- All data access must go through
services/.
-
Controlled Side Effects
- Side effects are allowed only via
services/. - Modules must not perform direct network, storage, or global state mutations.
- Side effects are allowed only via
-
Error Handling Boundary
- Modules may catch
AppErroronly to:- map errors to UI states
- trigger navigation or recovery flows
- Modules must not suppress or silently ignore errors.
- Modules may catch
-
Explicit Public Surface
- Internal files must not be imported across modules.