# mohdfahad1/foody architecture

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

- Interactive diagram: https://gitdiagram.com/mohdfahad1/foody
- Repository: https://github.com/mohdfahad1/foody

## Overview

##### Main Components
- Mobile App Shell – Represent the core mobile client powered by Expo. This is the container in which the app runs on iOS, Android, and possibly as a web app.
- Routing and Screens:
- The “app” directory shows a file-based routing architecture. Highlight “index.jsx” along with the nested “(main)” folder containing “home.jsx” (presumably the landing screen) and “recipeDetail” with dynamic routing ([idMeal].jsx).
- Shared “_layout.jsx”, which likely implements a common layout or navigation framework.
- Reusable UI Components – Illustrate the “components” directory housing reusable Visual/UI pieces such as “areas”, “categories”, “dropdown”, “loading”, and “recipes”. These modules likely display portions of the recipe app’s interface and can be shown as sub-components consumed by various screens.
- Assets – Create a section for static assets like fonts and images from the “assets” folder.
- Helper Utilities – The “helpers” directory (e.g., image.js) should be depicted as utility modules that support the app functionality.
- Configuration and Build Tools – Include ancillary items such as Babel, Tailwind, Metro, and TypeScript configurations (babel.config.js, tailwind.config.js, tsconfig.json, metro.config.js). These enable the build, styling, and cross-platform functionalities.

##### Relationships and Interactions
- Link screens (inside the “app” folder) to Reusable Components from the “components” directory. For instance, the “home.jsx” might render UI pieces like “recipes.jsx” or “categories.jsx”.
- Assets section to both the UI components and screens, indicating that components consume these static resources.
- Finally, include a block for Configuration/Build Tools at the side to signify the overall development environment that supports the app’s build and styling.

##### Architectural Patterns & Design Principles
- File-based Routing: Emphasize that the architecture leverages Expo’s file-based routing. Clearly highlight the directory structure with nested routes which simplifies the navigation logic.
- Separation of Concerns: The division between screen-level components (in “app”) and presentational/reusable UI components (in “components”) is a key pattern. Utility functions (in “helpers”) aid in keeping view components clean.
- Modern Tooling: The presence of Tailwind for styling (as indicated by tailwind.config.js and nativewind-env.d.ts) combined with TypeScript shows a commitment to maintaining scalable and type-safe code.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Mobile Environment
    MS["Mobile App Shell (Expo)"]:::app

    %% Routing & Screens (app folder)
    subgraph "Routing & Screens (app folder)"
        IDX["index.jsx"]:::routing
        LAYOUT["_layout.jsx"]:::routing
        HOME["Home Screen (home.jsx)"]:::screen
        RECIPE["Recipe Detail Screen ([idMeal].jsx)"]:::screen
    end

    %% Reusable UI Components
    subgraph "Reusable UI Components"
        COMP1["Areas"]:::component
        COMP2["Categories"]:::component
        COMP3["Dropdown"]:::component
        COMP4["Loading"]:::component
        COMP5["Recipes"]:::component
    end

    %% Assets
    subgraph "Assets"
        FONTS["Fonts"]:::assets
        IMAGES["Images"]:::assets
    end

    %% Helper Utilities
    UTIL["Image Helper (image.js)"]:::helper

    %% Configuration & Build Tools
    subgraph "Configuration & Build Tools"
        BABEL["Babel (babel.config.js)"]:::config
        TAILWIND["Tailwind (tailwind.config.js)"]:::config
        METRO["Metro (metro.config.js)"]:::config
        TSC["TypeScript (tsconfig.json)"]:::config
    end

    %% Relationships
    MS -->|"launches"| IDX
    IDX -->|"applies_layout"| LAYOUT
    LAYOUT -->|"renders"| HOME
    LAYOUT -->|"renders"| RECIPE
    HOME -->|"uses"| COMP5
    HOME -->|"uses"| COMP2
    RECIPE -->|"uses"| COMP5
    COMP5 -->|"processes_image"| UTIL
    FONTS -->|"used_by"| HOME
    IMAGES -->|"used_by"| COMP5
    IMAGES -->|"used_by"| RECIPE
    BABEL --- MS
    TAILWIND --- MS
    METRO --- MS
    TSC --- MS

    %% Click Events
    click MS "https://github.com/mohdfahad1/foody/blob/main/app.json"
    click IDX "https://github.com/mohdfahad1/foody/blob/main/app/index.jsx"
    click LAYOUT "https://github.com/mohdfahad1/foody/blob/main/app/_layout.jsx"
    click HOME "https://github.com/mohdfahad1/foody/blob/main/app/(main)/home.jsx"
    click RECIPE "https://github.com/mohdfahad1/foody/blob/main/app/(main)/recipeDetail/[idMeal].jsx"
    click COMP1 "https://github.com/mohdfahad1/foody/blob/main/components/areas.jsx"
    click COMP2 "https://github.com/mohdfahad1/foody/blob/main/components/categories.jsx"
    click COMP3 "https://github.com/mohdfahad1/foody/blob/main/components/dropdown.jsx"
    click COMP4 "https://github.com/mohdfahad1/foody/blob/main/components/loading.jsx"
    click COMP5 "https://github.com/mohdfahad1/foody/blob/main/components/recipes.jsx"
    click FONTS "https://github.com/mohdfahad1/foody/tree/main/assets/fonts"
    click IMAGES "https://github.com/mohdfahad1/foody/tree/main/assets/images"
    click UTIL "https://github.com/mohdfahad1/foody/blob/main/helpers/image.js"
    click BABEL "https://github.com/mohdfahad1/foody/blob/main/babel.config.js"
    click TAILWIND "https://github.com/mohdfahad1/foody/blob/main/tailwind.config.js"
    click METRO "https://github.com/mohdfahad1/foody/blob/main/metro.config.js"
    click TSC "https://github.com/mohdfahad1/foody/blob/main/tsconfig.json"

    %% Styles
    classDef app fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef routing fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef screen fill:#FADBD8,stroke:#C0392B,stroke-width:2px;
    classDef component fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef assets fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
    classDef helper fill:#FCF3CF,stroke:#F1C40F,stroke-width:2px;
    classDef config fill:#D6EAF8,stroke:#3498DB,stroke-width:2px;
```
