# recraftrelic/recraft-react-native-dating-app architecture

> Architecture diagram of the GitHub repository recraftrelic/recraft-react-native-dating-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/recraftrelic/recraft-react-native-dating-app
- Repository: https://github.com/recraftrelic/recraft-react-native-dating-app

## Overview

##### 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)

## Diagram (Mermaid)

```mermaid
graph TD
    %% JavaScript Layer
    subgraph "JavaScript Layer"
        IDX["index.js"]:::presentation
        APP["App.tsx"]:::presentation
        ROUTER["router/index.tsx"]:::presentation
        PAGES["pages/"]:::presentation
        COMP_BASE["components/Base/"]:::presentation
        COMP_HOC["components/HOC/"]:::presentation
        COMP_UI["components/UI/"]:::presentation
        HOOKS["hooks/"]:::domain
        CONFIG["config/"]:::domain
        STORE["store/index.ts"]:::data
        REDUCERS["store/reducers/"]:::data
    end

    %% Bundling & Transpilation
    subgraph "Bundling & Transpilation"
        METRO["metro.config.js"]:::bundler
        BABEL["babel.config.js"]:::bundler
    end

    %% Native Modules & SDKs
    subgraph "Native Modules & SDKs"
        IMG_PICK["Image Picker"]:::infra
        ICONS["Vector Icons"]:::infra
        SWIPER["Deck Swiper"]:::infra
        VIDEO["Video Call SDK"]:::infra
        PAYMENT_SDK["Payment SDK"]:::infra
    end

    %% Native Host Runtimes
    subgraph "Native Host Runtimes"
        subgraph Android
            A_MAIN("MainActivity.java"):::android
            A_APP("MainApplication.java"):::android
            A_GRADLE("build.gradle"):::android
            A_FASTLANE("Fastlane CI/CD"):::android
        end
        subgraph iOS
            I_APPDELEGATE("AppDelegate.m"):::ios
            I_PODFILE("Podfile"):::ios
        end
    end

    %% External Services
    subgraph "External Services"
        AUTH["Auth/User API"]:::external
        CHAT["Chat/Messaging Service"]:::external
        MEDIA["Media Server"]:::external
        PAY["Payment Gateway"]:::external
        ANALYTICS["Analytics/Crash Reporting"]:::external
    end

    %% Relationships
    IDX -->|boots| APP
    APP -->|initializes| ROUTER
    ROUTER -->|renders| PAGES
    PAGES -->|uses| COMP_BASE
    PAGES -->|uses| COMP_HOC
    PAGES -->|uses| COMP_UI
    PAGES -->|connects| STORE
    PAGES -->|invokes| HOOKS
    PAGES -->|reads| CONFIG
    STORE -->|composes| REDUCERS
    STORE -->|dispatches thunks| AUTH
    STORE -->|dispatches thunks| CHAT
    STORE -->|dispatches thunks| PAY
    STORE -->|reports| ANALYTICS

    APP -->|bridges| IMG_PICK
    APP -->|bridges| ICONS
    APP -->|bridges| SWIPER
    APP -->|bridges| VIDEO
    APP -->|bridges| PAYMENT_SDK

    METRO -->|bundles| APP
    BABEL -->|transpiles| APP

    APP -->|runs on| A_MAIN
    APP -->|runs on| I_APPDELEGATE

    A_GRADLE -->|builds| A_MAIN
    A_GRADLE -->|builds| A_APP
    A_FASTLANE -->|CI/CD| A_GRADLE

    I_PODFILE -->|manages| I_APPDELEGATE

    MEDIA -->|signal| VIDEO

    %% Click Events
    click IDX "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/index.js"
    click APP "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/App.tsx"
    click ROUTER "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/router/index.tsx"
    click PAGES "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/pages/"
    click COMP_BASE "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/components/Base/"
    click COMP_HOC "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/components/HOC/"
    click COMP_UI "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/components/UI/"
    click HOOKS "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/hooks/"
    click CONFIG "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/config/"
    click STORE "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/store/index.ts"
    click REDUCERS "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/store/reducers/"
    click METRO "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/metro.config.js"
    click BABEL "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/babel.config.js"
    click A_MAIN "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/android/app/src/main/java/com/recraftreactnativedatingapp/MainActivity.java"
    click A_APP "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/android/app/src/main/java/com/recraftreactnativedatingapp/MainApplication.java"
    click A_GRADLE "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/android/app/build.gradle"
    click A_FASTLANE "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/android/fastlane/"
    click I_APPDELEGATE "https://github.com/recraftrelic/recraft-react-native-dating-app/blob/master/ios/recraftReactNativeBaseApp/AppDelegate.m"
    click I_PODFILE "https://github.com/recraftrelic/recraft-react-native-dating-app/tree/master/ios/Podfile"

    %% Styles
    classDef presentation fill:#cce5ff,stroke:#2e6da4
    classDef domain fill:#dff0d8,stroke:#3c763d
    classDef data fill:#fcf8e3,stroke:#8a6d3b
    classDef infra fill:#d9edf7,stroke:#31708f
    classDef external fill:#f5f5f5,stroke:#cccccc
    classDef bundler fill:#fff2cc,stroke:#e2b13c
    classDef android fill:#f0e68c,stroke:#bdb76b
    classDef ios fill:#e6e6fa,stroke:#9370db
```
