How mayromyller/fidelizi-test-mobile works
Main Components
a. Mobile Runtime
• Expo / React-Native Engine
• Platform Bridges (iOS / Android native modules)
b. App Container
• App.tsx (entry point)
• Providers (AuthContextProvider, ReStyle ThemeProvider, Zustand store)
• Metro bundler
c. Navigation Layer
• Root Navigator (src/routes/index.ts)
• Auth Stack (SignInScreen)
• App Stack (Home → AmountSpent → ContactUser → RegisterUser → StampEarn)
d. Presentation Layer (Screens & UI Components)
• Screens (src/screens/…)
• Shared UI Components (src/components/ui/**)
e. Business-Logic Layer (Features / Vertical Slices)
• Auth Feature (authTypes, useAuthSignIn, useAuthSignOut, useAuthStorage)
• User Feature (useSetUser, useSetPhone, userPersistService, Zustand store)
• Stamp Feature (parseCurrencyToNumber, formatValueToCurrency, useCalculateStamp)
f. Infrastructure / Persistence
• Storage Interface (src/storage/storage.ts)
• AsyncStorage Implementation (src/storage/implementations/async-storage.ts)
• UserPersistService
g. External Services & Tools
• AsyncStorage Native Module
• Expo Go App / Developer Tools
Relationships & Data Flow
• App.tsx loads Providers
• AuthContextProvider initializes auth state (reads from AsyncStorage via storage interface)
• Navigation renders either Auth Stack or App Stack based on auth state
• Screens invoke Feature hooks (e.g. useAuthSignIn calls Auth infra → Storage)
• Business logic returns results to screens
• Screens dispatch updates to User/Stamp stores (Zustand)
• Stores persist changes through infrastructure layer
Architectural Patterns
• Vertical Slice: each feature bundle contains types, application hooks, infra adapters
• Unidirectional Data Flow: Screens → Feature Hooks → Infra → Persistence → Store → Screens
• Context / Provider Pattern for cross-cutting concerns (AuthContextProvider)
• State Management via Zustand for user / stamp data
• Theming with @shopify/restyle
Essential Elements Checklist
– Arrowheads for data/control flow
– Group boundaries for folders or subsystems
– Callouts for external dependencies (Expo, Native Modules)