Skip to content

Architecture

This section covers the technical architecture of DiveSuite: decisions, system design, and database schema.

DiveSuite follows a layered architecture with clear separation of concerns:

graph TB
subgraph "UI Layer"
RN[React Native Screens]
end
subgraph "State Management"
ZS[Zustand Stores]
end
subgraph "Service Layer"
PS[Planning Service]
LS[Logging Service]
AS[Analysis Service]
AI[AI Service]
end
subgraph "Core Layer"
DE[Deco Engine<br/>Rust/WASM]
DAL[Data Access Layer<br/>Repositories]
end
subgraph "Storage"
DB[(WatermelonDB<br/>SQLite)]
FS[File Storage]
end
RN --> ZS
ZS --> PS & LS & AS & AI
PS --> DE
PS & LS & AS --> DAL
AI -.->|"advisory only"| PS
DAL --> DB
LS --> FS
DecisionChoiceRationale
AD-01UUID v4 primary keysGlobal uniqueness for offline-first sync
AD-02WatermelonDBBuilt-in sync, lazy loading, RN-optimized
AD-03Rust/WASM deco engineType safety, performance, cross-platform
AD-04ZustandLightweight state management, no boilerplate
AD-055-tab navigationPlan, Log, Community, Stats, Profile
AD-06i18nexti18n from day one (EN + DE)
AD-07AI behind interfaceNever coupled to UI or deco engine
AD-08Offline-firstLocal DB is source of truth
AD-09UI library TBDEvaluate in M0 (Tamagui, Paper, Gluestack)
AD-10Feature-based foldersCode organized by feature, not layer
AD-11Opt-in analyticsPrivacy-first, GDPR compliant
LayerTechnology
FrameworkReact Native + Expo
LanguageTypeScript (strict mode)
Deco EngineRust -> WebAssembly
DatabaseWatermelonDB (SQLite)
StateZustand
i18ni18next
Navigationexpo-router
StylingTBD (Tamagui, Paper, or Gluestack)