How pixeljenz/sealine-mobile works
Purpose and Runtime
This is an Expo/React Native universal mobile app using Expo Router file-based navigation. It implements a phone-oriented onboarding flow plus a post-onboarding tab experience. It runs through Expo on iOS, Android, web, development builds, or Expo Go.
Primary runtime configuration is in package.json and app.json; application routes live under app/.
Application Entry and Route Shell
Expo Router enters through the root route structure in app/_layout.tsx. This layout is the top-level navigation boundary and should own shared providers, global navigation configuration, and transitions between onboarding and main application areas.
app/index.tsx is the root index route and likely acts as the initial routing decision or launch screen. app/splash.tsx is a dedicated splash route rather than platform-native splash configuration alone.
Onboarding State Machine
The main product-specific architecture is a multi-step onboarding sequence:
• Phone collection: app/phone-entry.tsx
• One-time-password verification: app/otp-entry.tsx
• Legal consent: app/legal-acceptance.tsx
• Profile completion: app/profile-setup.tsx
• Cross-device continuation: app/device-handoff.tsx
Control should move forward only after each stage’s local validation/API outcome. Back navigation, retry behavior, persisted onboarding state, and authenticated-session establishment are key boundaries that should remain centralized rather than duplicated across screens.
The intended flow may be further specified in onboard_flow.md.
API Boundary
api/mockOnboardingApi.ts is the repository’s explicit service boundary for onboarding operations. It likely simulates phone submission, OTP verification, profile creation, or handoff behavior in lieu of a backend.
UI route components should call this module rather than embedding transport or mock behavior directly. Replacing the mock with a real identity/onboarding service should preserve this boundary and introduce handling for authentication tokens, request failures, retries, and secure persistence.
Main Authenticated Experience
The post-onboarding app is organized as a tab navigator:
• Tab navigator definition: app/(tabs)/_layout.tsx
• Primary tab: app/(tabs)/index.tsx
• Explore tab: app/(tabs)/explore.tsx
The (tabs) route group is a navigation-only namespace and separates authenticated/main-product navigation from standalone onboarding routes. app/modal.tsx is a separate modal route and should be treated as an overlay flow managed by the root navigator.
Shared Presentation Layer
Reusable cross-screen UI is under components/, including platform-aware tab behavior in components/haptic-tab.tsx and themed primitives in components/themed-text.tsx and components/themed-view.tsx.
Theme decisions are centralized in constants/theme.ts, with system appearance integration via hooks/use-color-scheme.ts and hooks/use-color-scheme.web.ts. This establishes a platform boundary: native and web color-scheme behavior may differ, while consuming screens should use shared themed abstractions.
Infrastructure and External Dependencies
Expo provides bundling, native runtime integration, and multi-platform execution; Expo Router provides navigation based on the app/ filesystem. There is no real backend, database, authentication provider, or external SaaS integration represented in the tree; onboarding backend behavior is currently mocked at api/mockOnboardingApi.ts.
Project-level TypeScript and Expo settings are defined by tsconfig.json and app.json. The root package.json is the operational entry for dependency installation and Expo startup.
Main entry points: app/_layout.tsx Root Route Shell · (tabs)/_layout.tsx Tab Navigator · themed-view.tsx Themed Primitives · mockOnboardingApi.ts Mock Onboarding API
Components 20
Expo Runtime
- Package Scripts · Dependency installation and Expo startup entry.
package.json - Expo Config · Expo platform and app configuration.
app.json - Expo Platform · Runs the app on native, web, development builds, and Expo Go.
Navigation
- Expo Router · Builds navigation from the app filesystem.
- Root Route Shell · Central provider, transition, and navigation boundary.
app/_layout.tsx - Launch Decision · Initial route or launch-state decision.
app/index.tsx - Splash Route
app/splash.tsx - Modal Overlay · Overlay flow managed by the root navigator.
app/modal.tsx
Onboarding
- Phone Entry
app/phone-entry.tsx - OTP Verification
app/otp-entry.tsx - Legal Consent
app/legal-acceptance.tsx - Profile Setup
app/profile-setup.tsx - Device Handoff
app/device-handoff.tsx - Mock Onboarding API · Replaceable boundary for onboarding requests and outcomes.
api/mockOnboardingApi.ts
Authenticated App
- Tab Navigator · Navigation-only route group for the main product.
app/(tabs)/_layout.tsx - Primary Tab
app/(tabs)/index.tsx - Explore Tab
app/(tabs)/explore.tsx
Shared Presentation
- Themed Primitives · Cross-screen themed text and view abstractions.
components/themed-view.tsx - Theme System · Central theme with native and web color-scheme integration.
constants/theme.ts - Haptic Tab
components/haptic-tab.tsx
Connections 25
- Package Scripts → Expo Platform: starts
- Expo Config → Expo Platform: configures
- Expo Platform → Expo Router: hosts
- Expo Router → Root Route Shell: enters
- Root Route Shell → Launch Decision: initial route
- Root Route Shell → Splash Route: navigates
- Root Route Shell → Modal Overlay: presents
- Launch Decision → Phone Entry: begins onboarding
- Phone Entry → OTP Verification: validated phone
- OTP Verification → Legal Consent: verified OTP
- Legal Consent → Profile Setup: accepted
- Profile Setup → Device Handoff: profile complete
- Device Handoff → Tab Navigator: session established
- Phone Entry → Mock Onboarding API: submits phone
- OTP Verification → Mock Onboarding API: verifies code
- Profile Setup → Mock Onboarding API: creates profile
- Device Handoff → Mock Onboarding API: continues device flow
- Root Route Shell → Tab Navigator: owns main area
- Tab Navigator → Primary Tab: hosts
- Tab Navigator → Explore Tab: hosts
- Tab Navigator → Haptic Tab: uses
- Themed Primitives → Theme System: consumes
- Root Route Shell → Themed Primitives: shared UI
- Primary Tab → Themed Primitives: uses
- Explore Tab → Themed Primitives: uses