How recraftrelic/recraft-react-native-dating-app works
Project type and purpose
• This is a full-stack mobile front-end application (a React Native dating-app boilerplate).
• The app’s goal is to provide a reusable, fully functional dating app with swipe, chat, video-call, payment, and profile features.
File structure
• Top-level:
• App.tsx / index.js: entry point
• android/ & ios/: native host projects and build pipelines (Gradle, Xcode, Fastlane)
• components/: reusable UI (Base, HOC, UI)
• pages/: screen containers (e.g., Login, Matching, VideoCall, Payment)
• router/: navigation setup via react-router-native
• store/: Redux store and reducers (e.g., config reducer)
• config/: constants, themes, languages, validation rules
• hooks/: custom React hooks (useTheme, useLanguage, etc.)
• images/: static assets and previews
• metro.config.js, babel.config.js: JS bundling/transpilation
• Patterns:
• Container/presentational separation: pages (containers) vs components (presentational)
• Redux for global state
• React hooks and HOCs for cross-cutting concerns
README for additional insights
• Mentions documentation for folder structure, constants, hooks, pages
a. Main components
1. Mobile App JS Layer
– Entry (App.tsx)
– Router (router/index.tsx)
– Pages (pages/* → containers/screens)
– Components (components/Base, components/UI, HOC)
– Hooks & Config (hooks/*, config/*)
– State Management (store/index.ts, store/reducers/*)
2. Bundler & Transpiler
– Metro (metro.config.js)
– Babel (babel.config.js)
3. Native Host Runtimes
– Android (android/app → MainActivity.java / Gradle, Fastlane pipelines)
– iOS (ios/recraftReactNativeBaseApp → AppDelegate.m, CocoaPods)
4. Native Modules & Third-Party SDKs
– Image Picker
– Deck Swiper
– Payment SDK (Stripe or native)
– Video Call (WebRTC or native)
5. External Services
– Authentication / User API (REST or GraphQL endpoints)
– Chat / Messaging service
– Media server (if video call uses external signaling)
– Payment Gateway
– Analytics / Crash Reporting
b. Relationships & interactions
• The App entry boots the Router, rendering Pages.
• Pages use Components for UI, Hooks for side effects (theme, language), and connect to Redux for state.
• Redux actions may call API services (external).
• JS Layer communicates to Native Host via the React Native bridge for camera, storage, video call.
• Metro bundles JS → delivered to JS runtime in native apps.
• Fastlane/Gradle (Android) and CocoaPods/Xcode (iOS) manage native builds and deployments.
c. Architectural patterns
• Layered architecture: Presentation → Domain → Data → Infrastructure
• Container (Pages) vs Presentational (Components)
• Redux for single source of truth
• Hook-based side effects and context (config, theme, language)
• Router for declarative navigation
d. Key technologies/frameworks
• React Native + TypeScript
• React Router Native
• Redux
• Metro & Babel
• Native build tools (Gradle, Xcode, Fastlane, CocoaPods)