# vegan-food/vegetarian_restaurant_front-end architecture

> Architecture diagram of the GitHub repository vegan-food/vegetarian_restaurant_front-end, 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/vegan-food/vegetarian_restaurant_front-end
- Repository: https://github.com/vegan-food/vegetarian_restaurant_front-end

## Overview

##### Project type and purpose
- This is a single-page React application bootstrapped with Create React App.
- It serves as a restaurant ordering system (user pages: home, cart, payment, profile; manager pages: dashboard, food management, order list, profile).
- State is managed via Redux; data comes from local JSON and remote APIs (e.g., Google login, payment gateway).

##### File structure
- Top-level: public (static HTML, manifest), src (all React code), package.json (dependencies), README.
- src/index.js: app entrypoint; src/AppPage.jsx (core router).
- src/components: reusable UI (Header, Footer, Banner, About, Sidebar).
- src/pages: page-level components organized by feature (home, cart, payment, profile, auth, dashboard, manager).
- src/features/menu.jsx: specific feature module.
- src/hooks/database.jsx: custom hook(s) for data fetching.
- src/redux/api.jsx: API client (thunks or RTK Query).
- src/data: local JSON (meal_data, discounts, order_history).
- src/lib/google_login.jsx: OAuth integration.
- Styling: CSS files colocated with components/pages.

##### Key insights from README
- Standard CRA scripts (start, build, test).
- No backend code here—assumes external API(s).
- Mentions react-bootstrap/bootstrap (UI framework).

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Browser / React SPA"
        subgraph "Entry & Routing"
            Entry["index.js"]:::state
            Router["AppPage.jsx"]:::state
        end

        subgraph "UI Layer"
            subgraph "Pages"
                HP["HomePage"]:::ui
                CP["CartPage"]:::ui
                PayP["PaymentPage"]:::ui
                ProfP["ProfilePage"]:::ui
                AuthL["LoginPage"]:::ui
                DashU["UserDashboard"]:::ui
                subgraph "Manager Pages"
                    MD["ManagerDashboard"]:::ui
                    MF["ManagerFoodList"]:::ui
                    MO["ManagerOrderList"]:::ui
                    MP["ManagerProfile"]:::ui
                end
            end
            subgraph "Shared Components"
                Header["Header"]:::ui
                FooterS["Footer"]:::ui
                Banner["Banner"]:::ui
                AboutG["About"]:::ui
                SideBarP["SidebarProfile"]:::ui
            end
        end

        subgraph "State & Data Layer"
            Store["Redux Store"]:::state
            API["api.jsx (API Client)"]:::state
            Hooks["database.jsx (Hooks)"]:::state
            GoogleLogin["google_login.jsx"]:::state
            subgraph "Local JSON Data"
                Meal["meal_data.json"]:::state
                Disc["discount.json"]:::state
                OrderH["order_history.json"]:::state
            end
        end

        subgraph "Feature Modules"
            MenuF["menu.jsx"]:::state
        end

        subgraph "Constants & Assets"
            Const["color_constants.js"]:::state
            Assets["Images & SVGs"]:::state
        end
    end

    Backend(("Backend API")):::external
    OAuth(("Google OAuth")):::external
    PaymentG(("Payment Gateway")):::external

    Entry --> Router
    Router --> HP
    Router --> CP
    Router --> PayP
    Router --> ProfP
    Router --> AuthL
    Router --> DashU
    Router --> MD

    HP --> Header
    HP --> FooterS
    CP --> Header
    CP --> FooterS
    PayP --> Header
    PayP --> FooterS

    HP --> Store
    CP --> Store
    PayP --> Store
    ProfP --> Store
    AuthL --> Store
    DashU --> Store
    MD --> Store

    Store --> API
    API --> Backend
    Hooks --> Backend
    Hooks --> Meal
    Hooks --> Disc
    Hooks --> OrderH

    MenuF --> Store
    Const --> Store
    Assets --> HP

    GoogleLogin --> OAuth
    GoogleLogin --> Store

    PayP --> PaymentG

    classDef ui fill:#e0f7ff,stroke:#0277bd
    classDef state fill:#e8f5e9,stroke:#2e7d32
    classDef external fill:#fff3e0,stroke:#ef6c00

    click Entry "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/index.js"
    click Router "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/AppPage.jsx"
    click Header "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/components/Header.jsx"
    click FooterS "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/components/Footer.jsx"
    click Banner "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/components/Banner.js"
    click AboutG "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/components/About.jsx"
    click SideBarP "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/components/SideBarProfile.js"
    click HP "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/home/HomePage.jsx"
    click CP "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/cart/CartPage.jsx"
    click PayP "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/payment/PaymentPage.jsx"
    click ProfP "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/profile/ProfilePage.jsx"
    click AuthL "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/auth/login.jsx"
    click DashU "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/dashboard/dashboard.jsx"
    click MD "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/Manager/ManagerDashboard/ManagerDashboard.jsx"
    click MF "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/Manager/FoodManagement/ManagerFoodList.jsx"
    click MO "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/Manager/ManagerOrderList/ManagerOrderList.jsx"
    click MP "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/pages/Manager/ManagerProfile/ManagerProfile.jsx"
    click API "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/redux/api.jsx"
    click Hooks "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/hooks/database.jsx"
    click Meal "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/data/meal_data.json"
    click Disc "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/data/discount.json"
    click OrderH "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/data/order_history.json"
    click MenuF "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/features/menu.jsx"
    click Const "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/constant/color_constants.js"
    click GoogleLogin "https://github.com/vegan-food/vegetarian_restaurant_front-end/blob/main/src/lib/google_login.jsx"
```
