Skip to main content

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/)

  • NavigationAppNavigator, 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:

LayerRoleAllowed to use
api/Services that talk to Supabase/backendcore config, types
domain/Types, stores (Zustand), business logiccore, own api (via services)
ui/Screens, components, feature-specific hookscore, 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)

FeaturePurpose
authLogin, signup, onboarding, forgot password, lock auth
notesHome, list, detail, reminders
categoriesCategory list and management
feedSocial feed, posts, comments, profiles, create post
notificationsNotifications list, push
settingsProfile, privacy, lock setup, plans, about, help
adminDashboard, user list/detail/edit, send notification

See Features for per-feature docs.