# ebrahimgad123/netflix_clone_reactnative_app architecture

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

- Interactive diagram: https://gitdiagram.com/ebrahimgad123/netflix_clone_reactnative_app
- Repository: https://github.com/ebrahimgad123/netflix_clone_reactnative_app

## Overview

##### Project type and purpose
- This is a React Native mobile application bootstrapped with Expo (“create-expo-app”) for browsing and saving movies.
- It uses file-based routing for screens (under the app folder), a Redux Toolkit store for state management, and calls out to an external movie API via a small service layer.

##### File structure
- Top-level “android” folder: the native Android project managed by Expo.
- “app” folder: file-based routing directory; each .tsx file or subfolder is a screen (index.tsx, profile.tsx, [id].tsx, etc.).
- “compoonent” (sic) folder: reusable UI components (FlatListComponent, HorizontalFlatList, SearchBox).
- “services”: api.ts (REST client), useFetch.ts (data-fetching hook).
- “store”: Redux Toolkit slice (savedMoviesSlice.ts), store setup (index.ts).
- Config files: babel.config.js, metro.config.js, tailwind.config.js, tsconfig.json, and .env for secrets.

##### README for additional insights
- Confirms it’s an Expo project using file-based routing.
- No custom backend—purely client side, fetching from external services.
- You “start” by running Expo, which spins up Metro and bundles JS for Android/iOS.

- Green for state management
- Orange for network/services
- Gray for native/Expo runtime
- Related files/folders in containers with light borders (e.g., group all “app/” screens).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors and runtime
    User["Mobile Device (User)"]:::external
    ExpoRuntime["Expo Runtime & Metro Bundler"]:::runtime
    AndroidNative["Android Project (android/)"]:::native
    ExternalAPI["External Movie API"]:::externalAPI

    %% JS Application Layer
    subgraph "React Native App (JS Layer)"
        direction TB

        subgraph "File-based Routing (app/)"
            direction TB
            MovieListScreen["index.tsx"]:::screens
            ProfileScreen["profile.tsx"]:::screens
            SavedScreen["saved.tsx"]:::screens
            SearchScreen["search.tsx"]:::screens
            MovieDetailScreen["[id].tsx"]:::screens
            LayoutApp["_layout.tsx"]:::screens
            LayoutRoot["app/_layout.tsx"]:::screens
        end

        subgraph "UI Components (compoonent/)"
            direction TB
            FlatListComp["FlatListComponent.tsx"]:::components
            HorizontalFlatList["HorizontalFlatList.tsx"]:::components
            SearchBoxComp["SearchBoxComponent.tsx"]:::components
        end

        subgraph "State Management (store/)"
            direction TB
            StoreSetup["store/index.ts"]:::state
            SavedMoviesSlice["savedMoviesSlice.ts"]:::state
        end

        subgraph "Services Layer (services/)"
            direction TB
            APIClient["api.ts"]:::service
            FetchHook["useFetch.ts"]:::service
        end

        subgraph "Assets (assets/)"
            direction TB
            Fonts["fonts/"]:::assets
            IconsAsset["icons/"]:::assets
            ImagesAsset["images/"]:::assets
        end

        subgraph "Config & Env"
            direction TB
            EnvFile[".env"]:::config
            MetroConfig["metro.config.js"]:::config
            BabelConfig["babel.config.js"]:::config
            TSConfig["tsconfig.json"]:::config
            TailwindConfig["tailwind.config.js"]:::config
        end

        subgraph "Constants & Types"
            direction TB
            IconsConst["icons.ts"]:::constants
            ImagesConst["images.ts"]:::constants
            Interfaces["interfaces.d.ts"]:::constants
            NativewindTypings["nativewind-env.d.ts"]:::constants
            GlobalStyles["app/global.css"]:::constants
        end
    end

    %% Flows
    User -->|"tap UI"| MovieListScreen
    MovieListScreen -->|"uses component"| FlatListComp
    SearchScreen -->|"uses component"| SearchBoxComp
    MovieListScreen -->|"layout via"| LayoutApp
    LayoutApp -->|"root layout"| LayoutRoot

    FlatListComp -->|"dispatch action"| StoreSetup
    SearchBoxComp -->|"dispatch action"| StoreSetup
    StoreSetup -->|"contains slice"| SavedMoviesSlice

    SavedMoviesSlice -->|"thunk/effect calls"| APIClient
    FetchHook -->|"calls"| APIClient
    APIClient -->|"fetchMovies() request"| ExternalAPI
    ExternalAPI -->|"response"| APIClient
    APIClient -->|"returns data"| FetchHook
    FetchHook -->|"dispatch update"| StoreSetup
    StoreSetup -->|"updates state"| SavedMoviesSlice
    SavedMoviesSlice -->|"provides data"| MovieListScreen

    Fonts -->|"loaded by"| ExpoRuntime
    IconsAsset -->|"loaded by"| ExpoRuntime
    ImagesAsset -->|"loaded by"| ExpoRuntime

    EnvFile -->|"provides keys to"| APIClient
    MetroConfig -->|"configures"| ExpoRuntime
    BabelConfig -->|"configures"| ExpoRuntime
    TSConfig -->|"type-checks"| ReactNativeApp
    TailwindConfig -->|"styles via NativeWind"| ReactNativeApp
    GlobalStyles -->|"applies to UI"| MovieListScreen

    ExpoRuntime -->|"bridges JS calls"| AndroidNative
    AndroidNative -->|"runs native modules"| ExpoRuntime

    %% External API dashed
    ExternalAPI -.->|"third-party service"| ReactNativeApp

    %% Click events
    click MovieListScreen "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/app/(app)/index.tsx"
    click ProfileScreen "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/app/(app)/profile.tsx"
    click SavedScreen "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/app/(app)/saved.tsx"
    click SearchScreen "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/app/(app)/search.tsx"
    click MovieDetailScreen "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/app/movies/[id].tsx"
    click LayoutApp "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/app/(app)/_layout.tsx"
    click LayoutRoot "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/app/_layout.tsx"
    click FlatListComp "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/compoonent/FlatListComponent.tsx"
    click HorizontalFlatList "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/compoonent/HorizontalFlatList.tsx"
    click SearchBoxComp "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/compoonent/SearchBoxComponent.tsx"
    click StoreSetup "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/store/index.ts"
    click SavedMoviesSlice "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/store/savedMoviesSlice.ts"
    click APIClient "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/services/api.ts"
    click FetchHook "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/services/useFetch.ts"
    click Fonts "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/tree/main/assets/fonts/"
    click IconsAsset "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/tree/main/assets/icons/"
    click ImagesAsset "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/tree/main/assets/images/"
    click EnvFile "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/.env"
    click MetroConfig "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/metro.config.js"
    click BabelConfig "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/babel.config.js"
    click TSConfig "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/tsconfig.json"
    click TailwindConfig "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/tailwind.config.js"
    click GlobalStyles "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/app/global.css"
    click IconsConst "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/constants/icons.ts"
    click ImagesConst "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/constants/images.ts"
    click Interfaces "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/interfaces/interfaces.d.ts"
    click NativewindTypings "https://github.com/ebrahimgad123/netflix_clone_reactnative_app/blob/main/nativewind-env.d.ts"

    %% Styles
    classDef screens fill:#D0E8FF,stroke:#0288D1,color:#000
    classDef components fill:#BBDEFB,stroke:#1976D2,color:#000
    classDef state fill:#C8E6C9,stroke:#388E3C,color:#000
    classDef service fill:#FFE0B2,stroke:#FB8C00,color:#000
    classDef assets fill:#E0E0E0,stroke:#616161,color:#000
    classDef config fill:#F3E5F5,stroke:#8E24AA,color:#000
    classDef constants fill:#FFECB3,stroke:#FBC02D,color:#000
    classDef runtime fill:#CFD8DC,stroke:#455A64,color:#000
    classDef native fill:#B0BEC5,stroke:#546E7A,color:#000
    classDef externalAPI stroke-dasharray: 5 5,stroke:#FF5722,color:#000
    classDef external fill:#FFFFFF,stroke:#000,color:#000
```
