How developers-b11/erythraeanlogistics works
Project Type and Purpose
• This is a React Native mobile client application (iOS and Android).
• It uses Redux (with slices under src/store), React Navigation (under src/navigation), and communicates with external services (REST APIs and WebSocket).
High-Level Architectural Components
a. Native Shells
– Android (android/…)
– iOS (ios/…)
b. JavaScript Layer
– Entry point (index.js → App.js)
– UI Presentation
• src/components (stateless, reusable UI elements)
• src/assets (images, fonts, SVGs)
– Container/Screens
• src/containers (connect components to state & side effects)
– Navigation
• src/navigation/authStack & appStack
• AppNavigation.js toggles auth vs app flows
– State Management
• src/store (Redux Toolkit slices for auth, user, socket, common)
• Services (src/store/services) for API clients
– Side-Effects & Data Flow
• Async calls to backend REST endpoints
• WebSocket client (src/store/socket/socketSlice.js)
c. External Systems
– Backend REST APIs (e.g., OTP, orders, notifications)
– WebSocket or Socket.io server (real-time messaging)
– Firebase services (google-services.json, GoogleService-Info.plist) for analytics/push
– Authentication provider (could be custom or Firebase Auth)
Relationships & Interactions
• User taps button → Container dispatches Redux action → Thunk in services layer calls REST API → Response updates store → Connected component re-renders.
• WebSocket middleware listens to server push → Emits Redux events → UI updates (e.g., chat, notifications).
• Navigation flows: authStack (login/signup/splash) vs appStack (home, orders, settings).
Architectural Patterns & Principles
• Unidirectional Data Flow (Redux)
• Presentational vs Container components
• Feature-based module structure (components/constants/layout/view, containers grouped by feature)
• React Navigation for screen routing
• Native bridge for platform-specific modules (Flipper integration, Google services)