Architecture
The codebase uses a feature-based layout with clear separation between app shell, core shared code, and feature modules.
Top-level layout
src/
├── app/ # App shell: navigation, global state
├── core/ # Shared: config, theme, design-system, hooks, utils, types
└── features/ # Feature modules (api | domain | ui per feature)
App (src/app/)
- Navigation —
AppNavigator,MainTabNavigator,navigationRef. - State — Global stores: theme, storage, snackbar (app-wide UI state).
No business logic here; only routing and app-level state.
Core (src/core/)
Shared across features:
- config — Supabase client.
- theme — Colors, typography, spacing, note colors.
- design-system — Primitives:
Text,Button,Input,Card,Snackbar. - hooks — e.g. network status, capture actions.
- utils — Storage, encryption, constants, category icons.
- types — Shared TypeScript types.
Core does not import from features/.
Features (src/features/<name>/)
Each feature has three layers:
| Layer | Role | Allowed to use |
|---|---|---|
| api/ | Services that talk to Supabase/backend | core config, types |
| domain/ | Types, stores (Zustand), business logic | core, own api (via services) |
| ui/ | Screens, components, feature-specific hooks | core, domain (not api directly) |
Rules:
- api — No UI, no stores; only API calls and data shaping.
- domain — No UI components; state and logic only.
- ui — Uses domain (stores); calls api only through domain or services exposed by domain.
Path aliases
@/app/*→src/app/*@/core/*→src/core/*@/features/*→src/features/*
Use these in imports instead of long relative paths.
Feature list (current)
| Feature | Purpose |
|---|---|
| auth | Login, signup, onboarding, forgot password, lock auth |
| notes | Home, list, detail, reminders |
| categories | Category list and management |
| feed | Social feed, posts, comments, profiles, create post |
| notifications | Notifications list, push |
| settings | Profile, privacy, lock setup, plans, about, help |
| admin | Dashboard, user list/detail/edit, send notification |
See Features for per-feature docs.