# shashank-reddy-pulipelly/react-native-app-project architecture

> Architecture diagram of the GitHub repository shashank-reddy-pulipelly/react-native-app-project, 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/shashank-reddy-pulipelly/react-native-app-project
- Repository: https://github.com/shashank-reddy-pulipelly/react-native-app-project

## Overview

##### Project type and purpose
- This is a standalone React Native mobile app (appears to be a restaurant menu/reservation app built as part of a Coursera course).
- It uses Redux for state management, React Navigation for routing, fetches data from a remote server, and includes UI components, shared utilities, assets, and styling.

##### File structure and map to architectural components
- App.js: application entry point—initializes Redux store and root navigator.
- redux/: Redux setup—ActionTypes, ActionCreators (network calls and dispatch), reducers (dishes, comments, promotions, leaders, favorites), configureStore.
- routes/: React Navigation configuration—stack navigators (aboutStack, homeStack) and drawer navigator (drawer).
- screens/: top‐level “container” screen components hooked into navigators.
- components/: presentational UI components used within screens (MenuComponent, DishdetailComponent, LoginComponent, etc.).
- shared/: cross‐cutting utilities—baseUrl (API endpoint), data mappings (dishes, comments, promotions, leaders), common header and card helpers.
- assets/ & Nunito/: image and font assets.
- styles/: global style definitions.

##### Main architectural building blocks
a. Mobile Client
– App entry point
– Navigation layer (Drawer & Stack)
– Screen containers
– UI Components
– Assets & Styles
b. State Management
– Redux store (configureStore.js)
– Action creators (async fetch to API)
– Reducers updating state slices
c. Data Services
– shared/baseUrl.js
– fetch endpoints inside ActionCreators
d. External Backend
– Remote REST API at baseUrl

##### Interactions and data flow
- On startup, App.js sets up Redux Provider and navigation.
- Navigator chooses initial screen (e.g., Home).
- Screen dispatches ActionCreator to fetch data from API.
- ActionCreator performs fetch(baseUrl + resource), dispatches success or failure.
- Reducer updates state.
- Screen (connected via mapStateToProps) re-renders presentational components with new data.
- User interactions (e.g. tap “Favorite”) dispatch further actions to update favorites slice.
- Navigation actions trigger new stacks/screens.

##### Architectural patterns
- Flux/Redux pattern (unidirectional data flow)
- Container (screen) vs Presentational (components) separation
- Modular navigation (drawer + stack)
- Shared utilities for API and UI consistency

##### Final checklist
- Clear, concise labels.
- Asynchronous paths (e.g., fetch calls).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Mobile Client"
        subgraph "App Entry"
            App["App.js"]:::entry
        end
        subgraph "Navigation"
            HomeStack["homeStack.js"]:::nav
            AboutStack["aboutStack.js"]:::nav
            Drawer["drawer.js"]:::nav
        end
        subgraph "Screens"
            MainScreen["MainComponent.js"]:::screen
            AboutScreen["About.js"]:::screen
            MenuScreen["MenuComponent.js"]:::screen
            DishDetailScreen["DishdetailComponent.js"]:::screen
        end
        subgraph "UI Components"
            MenuComp["MenuComponent.js"]:::component
            DishDetailComp["DishdetailComponent.js"]:::component
            HomeComp["HomeComponent.js"]:::component
            ContactComp["ContactComponent.js"]:::component
            AboutComp["AboutComponent.js"]:::component
            ResComp["ReservationComponent.js"]:::component
            FavComp["FavoriteComponent.js"]:::component
            LoginComp["LoginComponent.js"]:::component
            LoadingComp["LoadingComponent.js"]:::component
            MainComp["MainComponent.js"]:::component
        end
        subgraph "Styles & Assets"
            Styles["globalStyles.js"]:::styles
            Assets["assets/"]:::assets
            Fonts["Nunito/"]:::assets
        end
    end

    subgraph "State Management"
        Store["configureStore.js"]:::store
        ActionTypes["ActionTypes.js"]:::store
        ActionCreators["ActionCreators.js"]:::store
        subgraph "Reducers"
            Dishes["dishes.js"]:::store
            Comments["comments.js"]:::store
            Promotions["promotions.js"]:::store
            Leaders["leaders.js"]:::store
            Favorites["favorites.js"]:::store
        end
    end

    subgraph "Shared Utilities"
        BaseURL["baseUrl.js"]:::util
        HeaderUtil["header.js"]:::util
        CardUtil["card.js"]:::util
        SharedDishes["dishes.js"]:::util
        SharedComments["comments.js"]:::util
        SharedPromos["promotions.js"]:::util
        SharedLeaders["leaders.js"]:::util
    end

    Backend["Remote API (baseUrl)"]:::external

    %% Connections
    App --> Navigation
    Navigation --> MainScreen
    Navigation --> AboutScreen
    Navigation --> MenuScreen
    Navigation --> DishDetailScreen
    MainScreen -->|dispatch| ActionCreators
    AboutScreen -->|dispatch| ActionCreators
    MenuScreen -->|dispatch| ActionCreators
    DishDetailScreen -->|dispatch| ActionCreators
    ActionCreators -->|fetch| Backend
    Backend -->|response| ActionCreators
    ActionCreators -->|dispatch| Store
    Store -->|provides state| MainScreen
    Store -->|provides state| AboutScreen
    Store -->|provides state| MenuScreen
    Store -->|provides state| DishDetailScreen
    Store --> Dishes
    Store --> Comments
    Store --> Promotions
    Store --> Leaders
    Store --> Favorites
    MainScreen --> MainComp
    AboutScreen --> AboutComp
    MenuScreen --> MenuComp
    DishDetailScreen --> DishDetailComp
    MainScreen --> HomeComp
    MainScreen --> ContactComp
    MainScreen --> ResComp
    MainScreen --> FavComp
    MainScreen --> LoginComp
    MainScreen --> LoadingComp

    %% Click Events
    click App "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/App.js"
    click Store "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/redux/configureStore.js"
    click ActionTypes "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/redux/ActionTypes.js"
    click ActionCreators "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/redux/ActionCreators.js"
    click Dishes "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/redux/dishes.js"
    click Comments "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/redux/comments.js"
    click Promotions "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/redux/promotions.js"
    click Leaders "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/redux/leaders.js"
    click Favorites "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/redux/favorites.js"
    click HomeStack "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/routes/homeStack.js"
    click AboutStack "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/routes/aboutStack.js"
    click Drawer "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/routes/drawer.js"
    click MainScreen "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/screens/MainComponent.js"
    click AboutScreen "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/screens/About.js"
    click MenuScreen "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/screens/MenuComponent.js"
    click DishDetailScreen "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/screens/DishdetailComponent.js"
    click MenuComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/MenuComponent.js"
    click DishDetailComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/DishdetailComponent.js"
    click HomeComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/HomeComponent.js"
    click ContactComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/ContactComponent.js"
    click AboutComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/AboutComponent.js"
    click ResComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/ReservationComponent.js"
    click FavComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/FavoriteComponent.js"
    click LoginComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/LoginComponent.js"
    click LoadingComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/LoadingComponent.js"
    click MainComp "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/components/MainComponent.js"
    click BaseURL "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/shared/baseUrl.js"
    click HeaderUtil "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/shared/header.js"
    click CardUtil "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/shared/card.js"
    click SharedDishes "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/shared/dishes.js"
    click SharedComments "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/shared/comments.js"
    click SharedPromos "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/shared/promotions.js"
    click SharedLeaders "https://github.com/shashank-reddy-pulipelly/react-native-app-project/blob/master/shared/leaders.js"

    %% Styles
    classDef entry fill:#cde,stroke:#333,stroke-width:1px
    classDef nav fill:#fdd835,stroke:#333
    classDef screen fill:#bbdefb,stroke:#333
    classDef component fill:#bbdefb,stroke:#333
    classDef styles fill:#90caf9,stroke:#333
    classDef assets fill:#90caf9,stroke:#333
    classDef store fill:#a5d6a7,stroke:#333
    classDef util fill:#ce93d8,stroke:#333
    classDef external fill:#ef9a9a,stroke:#333
```
