# emmanuelchucks/react-native-uber-clone architecture

> Architecture diagram of the GitHub repository emmanuelchucks/react-native-uber-clone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/emmanuelchucks/react-native-uber-clone
- Repository: https://github.com/emmanuelchucks/react-native-uber-clone

## Overview

##### Project type and purpose
- This is a cross‐platform mobile application (React Native + Expo) that clones core Uber features: selecting origin/destination, viewing rides, estimating fare and travel time.
- There is no custom backend; the app talks directly to external mapping / routing APIs (e.g., Google Maps, Directions, Places).

##### File structure
- Top‐level:
- App.tsx – entry point
- app/ – Redux setup (store.ts, hooks.ts) and navigationSlice.ts for global state (origin, destination, travelTimeInformation)
- components/ – reusable UI building blocks (Map, NavOptions, NavigateCard, RideOptionsCard, etc.)
- screens/ – three main screens (HomeScreen, EatsScreen, MapScreen)
- assets/ – images and screenshots
- config files – babel.config.js, tsconfig.json, app.json, env.d.ts
- Patterns:
- A single‐page mobile app with React Navigation handling screen transitions
- Redux Toolkit for state management (MVC‐light pattern: components dispatch actions, selectors read state)
- API calls for distance/time estimation and map rendering lives inside Map.tsx and slices (not shown, but implied)

##### Key details from the README
- Cross‐platform support (iOS, Android, Web) via Expo
- Features: pick origin/destination, choose ride type, calculate fare/time
- No mention of a proprietary backend – relies on remote services

##### Detailed capture of essential elements
- Every screen name and major component in the UI layer
- NavigationSlice and store.ts as the single source of truth

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        App["App.tsx"]:::frontend
        subgraph "Screens"
            direction TB
            Home["HomeScreen"]:::frontend
            Eats["EatsScreen"]:::frontend
            MapScreen["MapScreen"]:::frontend
        end
        subgraph "Components"
            direction TB
            MapComp["Map"]:::frontend
            NavOptions["NavOptions"]:::frontend
            NavFavorites["NavFavorites"]:::frontend
            NavigateCard["NavigateCard"]:::frontend
            RideOptionsCard["RideOptionsCard"]:::frontend
            HomeNav["HomeNavigation"]:::frontend
            MapNav["MapScreenNavigation"]:::frontend
        end
    end

    %% State Layer
    subgraph "State Layer"
        direction TB
        Store["store.ts"]:::state
        NavSlice["navigationSlice.ts"]:::state
        Hooks["hooks.ts"]:::state
    end

    %% External Services
    subgraph "External Services"
        direction TB
        MapsAPI["Maps/Geocoding/Directions API"]:::external
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        ExpoCLI["Expo CLI & Bundler"]:::build
        BabelConfig["babel.config.js"]:::build
        TSConfig["tsconfig.json"]:::build
        EnvTypes["env.d.ts"]:::build
        Assets[".expo-shared/assets.json"]:::build
        AppStores["App Stores / Web Host"]:::build
    end

    %% Relationships
    User["User"] -->|taps UI| App
    App -->|renders screens| Home
    App -->|renders screens| Eats
    App -->|renders screens| MapScreen
    Home --> NavOptions
    Home --> NavFavorites
    MapScreen --> MapComp
    MapScreen --> NavigateCard
    MapScreen --> RideOptionsCard
    HomeNav --> Home
    MapNav --> MapScreen

    Home -->|dispatch| Store
    Eats -->|dispatch| Store
    MapScreen -->|dispatch| Store
    Store -->|state| Home
    Store -->|state| Eats
    Store -->|state| MapScreen

    MapComp -->|GET /directions| MapsAPI
    MapsAPI -->|response| NavSlice

    ExpoCLI -->|bundle & deploy| App
    ExpoCLI --> BabelConfig
    ExpoCLI --> TSConfig
    ExpoCLI --> EnvTypes
    ExpoCLI --> Assets
    ExpoCLI --> AppStores

    %% Click Events
    click App "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/App.tsx"
    click Home "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/screens/HomeScreen.tsx"
    click Eats "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/screens/EatsScreen.tsx"
    click MapScreen "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/screens/MapScreen.tsx"
    click MapComp "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/components/Map.tsx"
    click NavOptions "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/components/NavOptions.tsx"
    click NavFavorites "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/components/NavFavorites.tsx"
    click NavigateCard "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/components/NavigateCard.tsx"
    click RideOptionsCard "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/components/RideOptionsCard.tsx"
    click HomeNav "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/components/HomeNavigation.tsx"
    click MapNav "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/components/MapScreenNavigation.tsx"
    click Store "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/app/store.ts"
    click NavSlice "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/app/slices/navigationSlice.ts"
    click Hooks "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/app/hooks.ts"
    click BabelConfig "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/babel.config.js"
    click TSConfig "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/tsconfig.json"
    click EnvTypes "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/env.d.ts"
    click Assets "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/.expo-shared/assets.json"
    click ExpoCLI "https://github.com/emmanuelchucks/react-native-uber-clone/blob/main/app.json"

    %% Styles
    classDef frontend fill:#bbdefb,stroke:#1e88e5,stroke-width:1px
    classDef state fill:#c8e6c9,stroke:#43a047,stroke-width:1px
    classDef external fill:#ffe0b2,stroke:#fb8c00,stroke-width:1px
    classDef build fill:#e0e0e0,stroke:#757575,stroke-width:1px
```
