System architectureTrace launch, state, and dependencies

Follow one path at a time

Choose a map, then select a step to inspect its responsibility, outgoing path, source location, excerpt, and audited hash.

One root state machine owns configuration failure, splash, onboarding, phone auth, customer KYC bootstrap, and entry into ContentView.

9 traced steps

Selected step · entry

App entry

Alva_Online_TradingApp creates RootView unless hosted unit tests are running.

Leads to

  • Configuration valid?

Source evidence

  • Alva Online Trading/App/Alva_Online_TradingApp.swiftAlva_Online_TradingApp.body

    The production scene installs RootView.

    Audited SHA-256: 3771d8170ad088f67c2b80c14f6e91ef4fdc399a36396bbaac2f7cc0065162dd

Flutter to SwiftUI

Use familiar Flutter concepts as an entry point, while preserving the ownership and lifecycle rules already present in this SwiftUI app.

Practical mappings for reading IC-Trade's SwiftUI architecture
FlutterSwiftUIHow IC-Trade uses itCautionEvidence
Widget + build()View + bodyRootView, ContentView, and feature views are value descriptions; SwiftUI recreates them as state changes.Do not treat a View struct as a long-lived controller.
1 source
  • Alva Online Trading/App/RootView.swiftRootView.routedContent
StatefulWidget local State@State / @FocusStateTab selection, route arrays, filters, sheets, and search text stay local to the owning view.Moving local state into a global object makes routing harder to reason about.
1 source
  • Alva Online Trading/App/ContentView.swiftAppTab.visibleTabs(for:)
ValueChanged / controlled property@BindingChild controls bind to parent-owned form, filter, and selection values.Use Binding only when the parent truly owns the value.
1 source
  • Alva Online Trading/Features/KYC/KYCFlowView.swiftKYCFlowView
ChangeNotifier + ProviderObservableObject + @StateObject/@ObservedObjectKYCApplicationStore is created once by AuthenticatedCustomerRoot; AppAuthSessionStore is observed from AppDependencies.@StateObject owns lifetime; @ObservedObject observes an owner elsewhere.
2 sources
  • Alva Online Trading/App/RootView.swiftRootView.routedContent
  • Alva Online Trading/Features/KYC/KYCApplicationStore.swiftKYCApplicationStore
InheritedWidget / Provider read@Environment / environment valuesLocale, dismiss, Reduce Motion, and other platform values flow through the view tree.AppDependencies is passed explicitly; do not invent a second environment-based dependency graph.
1 source
  • Alva Online Trading/App/RootView.swiftRootView.routedContent
Navigator 2.0 / GoRouterNavigationStack(path:) + Hashable routeContentView keeps one [AppRoute] per tab and maps each case to a destination.Do not collapse the paths into one global stack; tab history would leak across tabs.
2 sources
  • Alva Online Trading/App/AppRoute.swiftAppRoute
  • Alva Online Trading/App/ContentView.swiftAppTab.visibleTabs(for:)
initState async kickoff.task(id:)Customer bootstrap and remote feature loads start with view lifetime and cancel when identity changes or the view disappears.Keep UI mutation on MainActor and make requests idempotent.
1 source
  • Alva Online Trading/App/RootView.swiftRootView.routedContent
SharedPreferences@AppStorage / UserDefaultsOnboarding, language, watchlist preferences, and demo KYC persistence live locally.Local persistence is not customer-account sync and must not be presented as durable backend data.
2 sources
  • Alva Online Trading/Features/Watchlist/WatchlistView.swiftWatchlistView @AppStorage
  • Alva Online Trading/Features/KYC/PersistentDemoKYCApplicationRepository.swiftPersistentDemoKYCApplicationRepository
UI isolate@MainActorRoot state, dependency assembly, stores, and UI-facing repositories use main-actor isolation.Do not block MainActor with parsing or network work; return to it only for UI state.
2 sources
  • Alva Online Trading/App/RootView.swiftRootView.routedContent
  • Alva Online Trading/App/AppDependencies.swiftAppDependencies