Feature module structure for SuperHabits. Use when adding or modifying features: *.data.ts, *.domain.ts, *Screen.tsx, routing, or core/ui/ components.
Every feature in SuperHabits follows a strict three-file structure. Apply this pattern for all new features and when modifying existing ones.
features/{featureName}/ {featureName}.data.ts ← data layer (SQLite CRUD) {featureName}.domain.ts ← pure business logic (no DB) {featureName}Screen.tsx ← React Native screen component
Route file (thin wrapper): app/(tabs)/{featureName}.tsx
features/overview/ — OverviewScreen.tsx only (dashboard tab). No {overview}.data.ts / {overview}.domain.ts in this folder; it composes data from existing modules.features/shared/ — cross-feature UI (GitHubHeatmap, ActivityPreviewStrip). Not a tab-routed module.RoutineDetailScreen.tsxWorkoutSessionScreen.tsxWorkoutScreen.tsxfeatures/workout/Each feature may include types.ts that re-exports entity types from @/core/db/types and defines local types (e.g. MealType, CalorieEntryTotals in features/calories/types.ts). Screens import from ./types, not from @/core/db/types directly, unless there is a deliberate exception.
nextPomodoroState(), PomodoroState type (Vitest-covered; screen may wire labels through this helper)DO NOT create one-off styled containers in screen files. Extend core/ui/ instead, or use NativeWind className directly on View/Text.