# rajatpayaal/iot-restro-app architecture

> Architecture diagram of the GitHub repository rajatpayaal/iot-restro-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajatpayaal/iot-restro-app
- Repository: https://github.com/rajatpayaal/iot-restro-app

## Overview

IoT Restro combines a MealDB-backed menu and recipe browser with account/profile screens and restaurant device controls. The principal evidenced flow is home menu loading, category selection, and meal-detail retrieval; details expose ingredients and a YouTube recipe link. Ordering, order history, and kitchen delivery are documented capabilities, but their implementation is not present in the sampled code, so those links are marked unverified. IoT control is represented separately; its device protocol is not shown.

Main entry points: [`app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java`](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java) (Home menu), [`app/src/main/java/com/iot/iotrestaurantapp/api/FoodApi.java`](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/api/FoodApi.java) (Food API), [`app/src/main/java/com/iot/iotrestaurantapp/view/home/HomePresenter.java`](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/home/HomePresenter.java) (Menu presenter), [`app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailActivity.java`](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailActivity.java) (Meal details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_menu["Menu browsing"]
  node_home["Home menu<br/>[HomeActivity.java]"]
  node_home_presenter["Menu presenter<br/>[HomePresenter.java]"]
  node_category_activity["Category tabs"]
  node_category_fragment["Category meals"]
  node_detail["Meal details"]
  node_detail_presenter["Detail presenter"]
  node_menu_adapters["Menu adapters"]
  node_category_adapter["Category pager"]
end

subgraph group_data["Meal data"]
  node_food_api["Food API<br/>[FoodApi.java]"]
  node_food_client["API client<br/>[FoodClient.java]"]
  node_utils["API utility<br/>[Utils.java]"]
  node_categories["Category model<br/>[Categories.java]"]
  node_meals["Meal model<br/>[Meals.java]"]
end

subgraph group_account["Account access"]
  node_login["Login and registration"]
  node_profile["Profile management<br/>[MainActivity.java]"]
end

subgraph group_restaurant["Dining features"]
  node_iot_controls["Light and fan controls"]
  node_iot_cpp["IoT device code<br/>[iot_start.c++]"]
  node_orders["Ordering and order book"]
end

node_diner(("Diner"))
node_mealdb{{"TheMealDB"}}
node_firebase{{"Firebase services"}}
node_kitchen{{"Restaurant kitchen"}}
node_youtube{{"YouTube recipes"}}

node_home -->|"requests menu"| node_home_presenter
node_home_presenter -->|"gets API"| node_utils
node_utils -->|"creates client"| node_food_client
node_food_client -->|"connects to"| node_mealdb
node_home_presenter -.->|"requests data"| node_food_api
node_food_api -->|"maps response"| node_categories
node_food_api -->|"maps response"| node_meals
node_home -->|"renders menu"| node_menu_adapters
node_home -->|"opens category"| node_category_activity
node_category_activity -->|"sets pager"| node_category_adapter
node_category_adapter -->|"creates pages"| node_category_fragment
node_category_fragment -->|"opens meal"| node_detail
node_detail -->|"requests meal"| node_detail_presenter
node_detail_presenter -->|"gets API"| node_utils
node_detail_presenter -.->|"requests details"| node_food_api
node_detail -->|"opens video"| node_youtube
node_diner -.->|"uses app"| node_login
node_login -.->|"opens profile"| node_profile
node_profile -->|"uses account storage"| node_firebase
node_home -->|"opens controls"| node_iot_controls
node_iot_controls -.->|"controls devices"| node_iot_cpp
node_diner -.->|"places and reviews"| node_orders
node_orders -.->|"sends orders"| node_kitchen

click node_home "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java"
click node_home_presenter "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/home/HomePresenter.java"
click node_category_activity "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/category/CategoryActivity.java"
click node_category_fragment "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/category/CategoryFragment.java"
click node_detail "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailActivity.java"
click node_detail_presenter "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailPresenter.java"
click node_menu_adapters "https://github.com/rajatpayaal/iot-restro-app/tree/main/app/src/main/java/com/iot/iotrestaurantapp/adapter"
click node_category_adapter "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/adapter/ViewPagerCategoryAdapter.java"
click node_food_api "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/api/FoodApi.java"
click node_food_client "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/api/FoodClient.java"
click node_utils "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/Utils.java"
click node_categories "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/model/Categories.java"
click node_meals "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/model/Meals.java"
click node_login "https://github.com/rajatpayaal/iot-restro-app/tree/main/app/src/main/java/com/iot/iotrestaurantapp/view/home"
click node_profile "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/home/MainActivity.java"
click node_iot_controls "https://github.com/rajatpayaal/iot-restro-app/tree/main/app/src/main/java/com/iot/iotrestaurantapp/view/home"
click node_iot_cpp "https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/iot_start.c%2B%2B"
click node_orders "https://github.com/rajatpayaal/iot-restro-app/tree/main/app/src/main/java/com/iot/iotrestaurantapp/view"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_home_presenter,node_category_activity,node_category_fragment,node_detail,node_detail_presenter,node_menu_adapters,node_category_adapter toneBlue
class node_food_api,node_food_client,node_utils,node_categories,node_meals toneAmber
class node_login,node_profile toneMint
class node_iot_controls,node_iot_cpp,node_orders toneRose
class node_diner,node_mealdb,node_firebase,node_kitchen,node_youtube toneIndigo
```

## Components

### Menu browsing

- [Home menu](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java): `app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java`
- [Menu presenter](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/home/HomePresenter.java): `app/src/main/java/com/iot/iotrestaurantapp/view/home/HomePresenter.java`
- [Category tabs](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/category/CategoryActivity.java): `app/src/main/java/com/iot/iotrestaurantapp/view/category/CategoryActivity.java`
- [Category meals](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/category/CategoryFragment.java): `app/src/main/java/com/iot/iotrestaurantapp/view/category/CategoryFragment.java`
- [Meal details](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailActivity.java): `app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailActivity.java`
- [Detail presenter](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailPresenter.java): `app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailPresenter.java`
- [Menu adapters](https://github.com/rajatpayaal/iot-restro-app/tree/main/app/src/main/java/com/iot/iotrestaurantapp/adapter): `app/src/main/java/com/iot/iotrestaurantapp/adapter`
- [Category pager](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/adapter/ViewPagerCategoryAdapter.java): `app/src/main/java/com/iot/iotrestaurantapp/adapter/ViewPagerCategoryAdapter.java`

### Meal data

- [Food API](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/api/FoodApi.java): `app/src/main/java/com/iot/iotrestaurantapp/api/FoodApi.java`
- [API client](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/api/FoodClient.java): `app/src/main/java/com/iot/iotrestaurantapp/api/FoodClient.java`
- [API utility](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/Utils.java): `app/src/main/java/com/iot/iotrestaurantapp/Utils.java`
- [Category model](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/model/Categories.java): `app/src/main/java/com/iot/iotrestaurantapp/model/Categories.java`
- [Meal model](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/model/Meals.java): `app/src/main/java/com/iot/iotrestaurantapp/model/Meals.java`

### Account access

- [Login and registration](https://github.com/rajatpayaal/iot-restro-app/tree/main/app/src/main/java/com/iot/iotrestaurantapp/view/home): `app/src/main/java/com/iot/iotrestaurantapp/view/home`
- [Profile management](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/java/com/iot/iotrestaurantapp/view/home/MainActivity.java): `app/src/main/java/com/iot/iotrestaurantapp/view/home/MainActivity.java`

### Dining features

- [Light and fan controls](https://github.com/rajatpayaal/iot-restro-app/tree/main/app/src/main/java/com/iot/iotrestaurantapp/view/home): `app/src/main/java/com/iot/iotrestaurantapp/view/home`
- [IoT device code](https://github.com/rajatpayaal/iot-restro-app/blob/main/app/src/main/iot_start.c%2B%2B): `app/src/main/iot_start.c++`
- [Ordering and order book](https://github.com/rajatpayaal/iot-restro-app/tree/main/app/src/main/java/com/iot/iotrestaurantapp/view): `app/src/main/java/com/iot/iotrestaurantapp/view`

### Other components

- **Diner**
- **TheMealDB**
- **Firebase services**
- **Restaurant kitchen**
- **YouTube recipes**

## Connections

- Home menu → Menu presenter: requests menu (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java`)
- Menu presenter → API utility: gets API (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/home/HomePresenter.java`)
- API utility → API client: creates client (evidence: `app/src/main/java/com/iot/iotrestaurantapp/Utils.java`)
- API client → TheMealDB: connects to (evidence: `app/src/main/java/com/iot/iotrestaurantapp/api/FoodClient.java`)
- Menu presenter → Food API: requests data
- Food API → Category model: maps response (evidence: `app/src/main/java/com/iot/iotrestaurantapp/api/FoodApi.java`)
- Food API → Meal model: maps response (evidence: `app/src/main/java/com/iot/iotrestaurantapp/api/FoodApi.java`)
- Home menu → Menu adapters: renders menu (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java`)
- Home menu → Category tabs: opens category (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java`)
- Category tabs → Category pager: sets pager (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/category/CategoryActivity.java`)
- Category pager → Category meals: creates pages (evidence: `app/src/main/java/com/iot/iotrestaurantapp/adapter/ViewPagerCategoryAdapter.java`)
- Category meals → Meal details: opens meal (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/category/CategoryFragment.java`)
- Meal details → Detail presenter: requests meal (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailActivity.java`)
- Detail presenter → API utility: gets API (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailPresenter.java`)
- Detail presenter → Food API: requests details
- Meal details → YouTube recipes: opens video (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/detail/DetailActivity.java`)
- Diner → Login and registration: uses app
- Login and registration → Profile management: opens profile (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/home/Register.java`)
- Profile management → Firebase services: uses account storage (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/home/MainActivity.java`)
- Home menu → Light and fan controls: opens controls (evidence: `app/src/main/java/com/iot/iotrestaurantapp/view/home/HomeActivity.java`)
- Light and fan controls → IoT device code: controls devices
- Diner → Ordering and order book: places and reviews (evidence: `readme.md`)
- Ordering and order book → Restaurant kitchen: sends orders (evidence: `readme.md`)
