How sanjeevyadavit/magento_react_native works
MageCart is a React Native Magento 2 shopping app. The visible user flow enters the app, navigates among home, categories, and cart, and can open login or signup; login requests a customer token, stores it, and returns to the main tabs. The repository also includes profile navigation, Magento REST access, persistent user state, localization, and theming. Several screens and API helpers are identified by the source index but were not excerpted, so their internal behavior is not inferred here.
Main entry points: AppNavigation.tsx Navigation · LoginScreen.tsx Login screen · apiClient.ts HTTP client · useUserStore.ts User store
Components 19
App navigation
- App entry
src/App.tsx - Navigation
src/navigation/AppNavigation.tsx - Home screen
src/screens/home/HomeScreen.tsx - Categories
src/screens/categories/CategoriesScreen.tsx - Cart screen
src/screens/cart/CartScreen.tsx - Login screen
src/screens/login/LoginScreen.tsx - Signup screen
src/screens/signup/SignupScreen.tsx - Profile screen
src/screens/profile/ProfileScreen.tsx
Magento access
- Guest auth API
src/api/guestApi.ts - REST service
src/api/apiService.ts - HTTP client
src/api/apiClient.ts - Store config
config/index.ts
User state
- User store
src/store/useUserStore.ts - Persistence helper
src/store/createPersistentStore.ts
Presentation
- Theme provider
src/theme/ThemeProvider.tsx - Theme hook
src/theme/useTheme.ts - Localization
src/i18n/i18n.ts
Other components
- App user
- Magento REST
Connections 20
- App user → Navigation: opens app
- App entry → Navigation: renders
src/App.tsx - App entry → Theme provider: wraps in
src/App.tsx - Navigation → Home screen: registers
src/navigation/AppNavigation.tsx - Navigation → Categories: registers
src/navigation/AppNavigation.tsx - Navigation → Cart screen: registers
src/navigation/AppNavigation.tsx - Navigation → Login screen: registers
src/navigation/AppNavigation.tsx - Navigation → Signup screen: registers
src/navigation/AppNavigation.tsx - Navigation → Profile screen: registers
src/navigation/AppNavigation.tsx - Login screen → Guest auth API: requests login
src/screens/login/LoginScreen.tsx - Guest auth API → REST service: uses
src/api/guestApi.ts - REST service → HTTP client: sends requests
src/api/apiService.ts - HTTP client → Magento REST: calls REST
src/api/apiClient.ts - HTTP client → Store config: reads config
src/api/apiClient.ts - Login screen → User store: saves token
src/screens/login/LoginScreen.tsx - Navigation → User store: checks token
src/navigation/AppNavigation.tsx - User store → Persistence helper: created with
src/store/useUserStore.ts - Home screen → Theme hook: uses theme
src/screens/home/HomeScreen.tsx - Theme hook → Theme provider: reads theme
src/theme/useTheme.ts - Navigation → Localization: uses translations