Skip to content

Architecture

Cestercian edited this page Aug 8, 2026 · 1 revision

Architecture

SwiftUI app, MVVM-ish, four layers. Data flows top-down; nothing depends upward.

Screens/        (~48 SwiftUI views: root + Signup/ + Settings/ + ArtistWizard/)
  ↓ read/observe
State/          (14 ObservableObject stores — injected once in ArtistantApp.swift)
  ↓ call
Repositories/   (31 files — protocol seam; real + Fake* twins for UI tests)
  ↓ fan out to
Services/       (SupabaseClient, AuthService, PushService, CalendarSync, Payments/, …)
  → supabase/   (migrations + Edge Functions)

Counts drift — trust ls / grep over this diagram. There is no GRDB / SQLite cache (removed in the v1 remediation).

Layer rules

  • Stores own shared / cross-screen state (RoleStore, BookingStore, MessageStore, TabRouter, …).
  • Screens may read repositories directly for screen-local data — the Fake* seam still holds.
  • Repositories are the data boundary. Protocol-backed so XCUITest swaps Fake* impls + seeds via DEBUG-only -uitest-* launch args. Production builds never touch fakes (real-data-only since session 11).
  • No ViewModels folder — view state lives in stores or @State; repositories return plain Models/ structs.

Config pipeline

Configs/*.xcconfig  →  Info.plist $(VAR) substitution  →  AppEnvironment typed accessors

Real keys live only in gitignored Configs/*.local.xcconfig.

Key folders

Path Role
Sources/Artistant/Screens/ UI surfaces
Sources/Artistant/State/ ObservableObject stores + Persistence
Sources/Artistant/Repositories/ Data boundary
Sources/Artistant/Services/ Network + platform
Sources/Artistant/Theme/ Tokens (AppType, Space, Color, …)
Sources/Artistant/Components/ Shared UI primitives
supabase/migrations/ Schema history (monotonic, never edit applied)
supabase/functions/ Edge Functions (~20)
project.yml xcodegen source of truth — regenerate after file add/remove

Full file-by-file map: HANDOFF.md §3.

Sibling web client

artistant-web (Next.js on Vercel) shares the same Supabase backend. Schema + Edge Functions originate in this iOS repo; the web repo catches up afterward.

Clone this wiki locally