┌──────────┐ │ Onboard │ └─────┬────┘ │ ┌─────▼────┐ │ Auth │ └─────┬────┘ │ ┌─────▼────────┐ │ MainTab │ │ ┌──┬──┬──┐ │ │ │🏗 │📁 │⚙ │ │ │ └──┴──┴──┘ │ └──────────────┘

Navigation

Screen flow, tab bar routing, deep linking, and URL schemes.

┌────────┐ │ Routes │ ├────────┤ │ /build │ │ /proj │ │ /chat │ │ /task │ └────────┘
Developer Docs Archon iOS · Swift · SwiftUI API v1

Navigation

Screen flow, tab bar routing, deep linking, and URL schemes.

Navigation Flow

Archon uses a linear onboarding flow that resolves into a tab-based main interface:

┌─────────────────────────────────────────────────────────┐
│                    NAVIGATION FLOW                       │
├─────────────────────────────────────────────────────────┤
│                                                         │
│  ┌───────────┐     ┌───────────┐     ┌──────────────┐  │
│  │  Launch   │────▶│ AuthCheck │────▶│ Onboarding   │  │
│  └───────────┘     └─────┬─────┘     │ (if needed)  │  │
│                          │           └──────┬───────┘  │
│                    has session              │           │
│                          │           ┌──────▼───────┐  │
│                          └──────────▶│  MainTabView │  │
│                                      └──────┬───────┘  │
│                                             │           │
│                         ┌───────────┬───────┴──────┐   │
│                         ▼           ▼              ▼   │
│                    ┌─────────┐ ┌─────────┐ ┌────────┐  │
│                    │Builder  │ │Projects │ │Settings│  │
│                    │  Tab    │ │  Tab    │ │  Tab   │  │
│                    └─────────┘ └─────────┘ └────────┘  │
│                                                         │
└─────────────────────────────────────────────────────────┘

Onboarding → Auth → Main

1. App Launch
ArchonApp creates RootView which checks authentication state on appear. If a valid session exists in the Keychain, it skips directly to the main interface.
2. Onboarding (First Launch)
New users see a walkable onboarding carousel. At the end, they tap "Get Started" which presents the auth sheet (Sign In / Create Account / Apple Sign In).
3. Authentication
After successful auth, the session token is stored in the Keychain and the app navigates to MainTabView with an animation.
4. Main Tab Interface
MainTabView is a TabView with three tabs: Builder (default), Projects, and Settings. Each tab has its own navigation stack.

Tab Bar

The tab bar uses a custom design with SF Symbols:

Builder Tab house.fill
The AI chat interface for creating apps. Contains a NavigationStack that can push to task detail, code browser, and live preview screens.
Projects Tab folder.fill
Lists all user projects with search and filtering. Pushes to project detail which contains code browser and preview.
Settings Tab gearshape.fill
Account info, subscription management, theme toggle, and sign out. Uses List with Section grouping.

Deep Linking

Archon supports URL-based deep linking via a custom URL scheme:

archon://builder                  → Opens Builder tab
archon://projects                 → Opens Projects tab
archon://projects/{id}            → Opens specific project
archon://builder/chat/{id}        → Opens chat session
archon://builder/task/{id}        → Opens task detail
archon://settings                 → Opens Settings tab

Navigation Stack Management

Each tab maintains its own NavigationStack with independent state. When switching tabs, the navigation state of the previous tab is preserved.

Sheet & Full-Screen Covers

Authentication Sheet
Presented as a .sheet modifier from onboarding. Dismissed after successful sign-in.
Live Preview
Presented as a .fullScreenCover for immersive testing. Has its own close button and navigation.
Settings Detail
Account and subscription details push within the Settings navigation stack.

State Restoration

The app preserves tab selection across launches. The last active tab is stored in UserDefaults and restored on next launch. Navigation stack depth is not persisted — each tab starts at root on relaunch.