# muskan-773/foodreels architecture

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

- Interactive diagram: https://gitdiagram.com/muskan-773/foodreels
- Repository: https://github.com/muskan-773/foodreels

## Overview

FoodReels lets restaurants publish short food videos and users discover, search, like, save, and share them. The main flow is partner authentication and optional AI description generation, followed by video upload and feed publication; users then browse reels and interact with them. The frontend also provides restaurant and user profiles, saved collections, and video detail views. Backend edges follow the shown route/controller wiring and controller dependencies; some frontend capabilities are documented or indexed but their implementation was not excerpted, so those connections are omitted where unverified.

Main entry points: [`frontend/src/routes/AppRoutes.jsx`](https://github.com/muskan-773/foodreels/blob/main/frontend/src/routes/AppRoutes.jsx) (Page routes), [`backend/src/controllers/food.controllers.js`](https://github.com/muskan-773/foodreels/blob/main/backend/src/controllers/food.controllers.js) (Food operations), [`backend/src/middlewares/auth.middleware.js`](https://github.com/muskan-773/foodreels/blob/main/backend/src/middlewares/auth.middleware.js) (JWT authentication), [`backend/src/app.js`](https://github.com/muskan-773/foodreels/blob/main/backend/src/app.js) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["React app<br/>[App.jsx]"]
  node_routes["Page routes<br/>[AppRoutes.jsx]"]
  node_reel_feed["Reel feed<br/>[ReelFeed.jsx]"]
  node_home["Home feed<br/>[Home.jsx]"]
  node_search["Food search<br/>[Search.jsx]"]
  node_saved["Saved collection<br/>[Saved.jsx]"]
  node_video_detail["Video detail<br/>[VideoPlayer.jsx]"]
  node_user_profile["User profile<br/>[UserProfile.jsx]"]
  node_partner_auth_ui["Partner registration"]
  node_user_auth_ui["User registration<br/>[UserRegister.jsx]"]
  node_create_food["Create food reel<br/>[CreateFood.jsx]"]
  node_partner_profile["Restaurant profile<br/>[Profile.jsx]"]
end

subgraph group_routing["API routing and auth"]
  node_api_app["Express API<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_food_routes["Food routes<br/>[food.routes.js]"]
  node_partner_routes["Partner routes"]
  node_auth_middleware["JWT authentication<br/>[auth.middleware.js]"]
end

subgraph group_content["Content and engagement"]
  node_food_controller["Food operations"]
  node_food_model[("Food records<br/>[food.model.js]")]
  node_likes_model[("Like records<br/>[likes.model.js]")]
  node_saves_model[("Saved records<br/>[save.model.js]")]
end

subgraph group_identity["Identity and profiles"]
  node_auth_controller["Account operations<br/>[auth.controller.js]"]
  node_partner_controller["Partner profiles"]
  node_user_model[("User records<br/>[user.model.js]")]
  node_partner_model[("Partner records")]
end

subgraph group_integrations["External services"]
  node_storage["Video storage client<br/>[storage.service.js]"]
  node_ai_service["Description generation<br/>[ai.service.js]"]
end

node_user(("Food explorer"))
node_partner(("Restaurant partner"))
node_imagekit["ImageKit"]
node_gemini["Google Gemini"]

node_app -->|"renders"| node_routes
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_saved
node_routes -->|"routes to"| node_search
node_routes -->|"routes to"| node_video_detail
node_routes -->|"routes to"| node_user_profile
node_routes -->|"routes to"| node_partner_profile
node_routes -->|"routes to"| node_create_food
node_routes -->|"routes to"| node_partner_auth_ui
node_routes -->|"routes to"| node_user_auth_ui
node_home -->|"renders"| node_reel_feed
node_saved -->|"renders"| node_reel_feed
node_search -->|"fetches food"| node_api_app
node_user -.->|"browses"| node_home
node_user -.->|"searches"| node_search
node_user -.->|"views saved"| node_saved
node_user -.->|"views profile"| node_user_profile
node_partner -.->|"publishes reel"| node_create_food
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_food_routes
node_api_app -->|"mounts"| node_partner_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_food_routes -->|"dispatches"| node_food_controller
node_partner_routes -->|"dispatches"| node_partner_controller
node_auth_routes -->|"guards identity"| node_auth_middleware
node_food_routes -->|"guards actions"| node_auth_middleware
node_partner_routes -->|"guards updates"| node_auth_middleware
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_controller -->|"reads and writes"| node_partner_model
node_auth_middleware -->|"loads user"| node_user_model
node_auth_middleware -->|"loads partner"| node_partner_model
node_partner_controller -->|"manages profile"| node_partner_model
node_partner_controller -->|"loads partner food"| node_food_model
node_food_controller -->|"reads and writes"| node_food_model
node_food_controller -->|"updates likes"| node_likes_model
node_food_controller -->|"updates saves"| node_saves_model
node_food_controller -->|"uploads video"| node_storage
node_food_controller -->|"requests description"| node_ai_service
node_storage -.->|"uploads file"| node_imagekit
node_ai_service -.->|"generates text"| node_gemini

click node_app "https://github.com/muskan-773/foodreels/blob/main/frontend/src/App.jsx"
click node_routes "https://github.com/muskan-773/foodreels/blob/main/frontend/src/routes/AppRoutes.jsx"
click node_reel_feed "https://github.com/muskan-773/foodreels/blob/main/frontend/src/components/ReelFeed.jsx"
click node_home "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/Home.jsx"
click node_search "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/Search.jsx"
click node_saved "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/Saved.jsx"
click node_video_detail "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/VideoPlayer.jsx"
click node_user_profile "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/UserProfile.jsx"
click node_partner_auth_ui "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/auth/FoodPartnerRegister.jsx"
click node_user_auth_ui "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/auth/UserRegister.jsx"
click node_create_food "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/food-partner/CreateFood.jsx"
click node_partner_profile "https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/food-partner/Profile.jsx"
click node_api_app "https://github.com/muskan-773/foodreels/blob/main/backend/src/app.js"
click node_auth_routes "https://github.com/muskan-773/foodreels/blob/main/backend/src/routes/auth.routes.js"
click node_food_routes "https://github.com/muskan-773/foodreels/blob/main/backend/src/routes/food.routes.js"
click node_partner_routes "https://github.com/muskan-773/foodreels/blob/main/backend/src/routes/food-partner.routes.js"
click node_auth_middleware "https://github.com/muskan-773/foodreels/blob/main/backend/src/middlewares/auth.middleware.js"
click node_auth_controller "https://github.com/muskan-773/foodreels/blob/main/backend/src/controllers/auth.controller.js"
click node_partner_controller "https://github.com/muskan-773/foodreels/blob/main/backend/src/controllers/food-partner.controller.js"
click node_user_model "https://github.com/muskan-773/foodreels/blob/main/backend/src/models/user.model.js"
click node_partner_model "https://github.com/muskan-773/foodreels/blob/main/backend/src/models/foodpartner.model.js"
click node_food_controller "https://github.com/muskan-773/foodreels/blob/main/backend/src/controllers/food.controllers.js"
click node_food_model "https://github.com/muskan-773/foodreels/blob/main/backend/src/models/food.model.js"
click node_likes_model "https://github.com/muskan-773/foodreels/blob/main/backend/src/models/likes.model.js"
click node_saves_model "https://github.com/muskan-773/foodreels/blob/main/backend/src/models/save.model.js"
click node_storage "https://github.com/muskan-773/foodreels/blob/main/backend/src/services/storage.service.js"
click node_ai_service "https://github.com/muskan-773/foodreels/blob/main/backend/src/services/ai.service.js"

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_app,node_routes,node_reel_feed,node_home,node_search,node_saved,node_video_detail,node_user_profile,node_partner_auth_ui,node_user_auth_ui,node_create_food,node_partner_profile toneBlue
class node_api_app,node_auth_routes,node_food_routes,node_partner_routes,node_auth_middleware toneAmber
class node_food_controller,node_food_model,node_likes_model,node_saves_model toneMint
class node_auth_controller,node_partner_controller,node_user_model,node_partner_model toneRose
class node_storage,node_ai_service,node_user,node_partner,node_imagekit,node_gemini toneIndigo
```

## Components

### Frontend experience

- [React app](https://github.com/muskan-773/foodreels/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Page routes](https://github.com/muskan-773/foodreels/blob/main/frontend/src/routes/AppRoutes.jsx): `frontend/src/routes/AppRoutes.jsx`
- [Reel feed](https://github.com/muskan-773/foodreels/blob/main/frontend/src/components/ReelFeed.jsx): `frontend/src/components/ReelFeed.jsx`
- [Home feed](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/Home.jsx): `frontend/src/pages/general/Home.jsx`
- [Food search](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/Search.jsx): `frontend/src/pages/general/Search.jsx`
- [Saved collection](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/Saved.jsx): `frontend/src/pages/general/Saved.jsx`
- [Video detail](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/VideoPlayer.jsx): `frontend/src/pages/general/VideoPlayer.jsx`
- [User profile](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/general/UserProfile.jsx): `frontend/src/pages/general/UserProfile.jsx`
- [Partner registration](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/auth/FoodPartnerRegister.jsx): `frontend/src/pages/auth/FoodPartnerRegister.jsx`
- [User registration](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/auth/UserRegister.jsx): `frontend/src/pages/auth/UserRegister.jsx`
- [Create food reel](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/food-partner/CreateFood.jsx): `frontend/src/pages/food-partner/CreateFood.jsx`
- [Restaurant profile](https://github.com/muskan-773/foodreels/blob/main/frontend/src/pages/food-partner/Profile.jsx): `frontend/src/pages/food-partner/Profile.jsx`

### API routing and auth

- [Express API](https://github.com/muskan-773/foodreels/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth routes](https://github.com/muskan-773/foodreels/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Food routes](https://github.com/muskan-773/foodreels/blob/main/backend/src/routes/food.routes.js): `backend/src/routes/food.routes.js`
- [Partner routes](https://github.com/muskan-773/foodreels/blob/main/backend/src/routes/food-partner.routes.js): `backend/src/routes/food-partner.routes.js`
- [JWT authentication](https://github.com/muskan-773/foodreels/blob/main/backend/src/middlewares/auth.middleware.js): `backend/src/middlewares/auth.middleware.js`

### Content and engagement

- [Food operations](https://github.com/muskan-773/foodreels/blob/main/backend/src/controllers/food.controllers.js): `backend/src/controllers/food.controllers.js`
- [Food records](https://github.com/muskan-773/foodreels/blob/main/backend/src/models/food.model.js): `backend/src/models/food.model.js`
- [Like records](https://github.com/muskan-773/foodreels/blob/main/backend/src/models/likes.model.js): `backend/src/models/likes.model.js`
- [Saved records](https://github.com/muskan-773/foodreels/blob/main/backend/src/models/save.model.js): `backend/src/models/save.model.js`

### Identity and profiles

- [Account operations](https://github.com/muskan-773/foodreels/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Partner profiles](https://github.com/muskan-773/foodreels/blob/main/backend/src/controllers/food-partner.controller.js): `backend/src/controllers/food-partner.controller.js`
- [User records](https://github.com/muskan-773/foodreels/blob/main/backend/src/models/user.model.js): `backend/src/models/user.model.js`
- [Partner records](https://github.com/muskan-773/foodreels/blob/main/backend/src/models/foodpartner.model.js): `backend/src/models/foodpartner.model.js`

### External services

- [Video storage client](https://github.com/muskan-773/foodreels/blob/main/backend/src/services/storage.service.js): `backend/src/services/storage.service.js`
- [Description generation](https://github.com/muskan-773/foodreels/blob/main/backend/src/services/ai.service.js): `backend/src/services/ai.service.js`

### Other components

- **Food explorer**
- **Restaurant partner**
- **ImageKit**
- **Google Gemini**

## Connections

- React app → Page routes: renders (evidence: `frontend/src/App.jsx`)
- Page routes → Home feed: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routes → Saved collection: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routes → Food search: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routes → Video detail: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routes → User profile: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routes → Restaurant profile: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routes → Create food reel: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routes → Partner registration: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Page routes → User registration: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Home feed → Reel feed: renders (evidence: `frontend/src/pages/general/Home.jsx`)
- Saved collection → Reel feed: renders (evidence: `frontend/src/pages/general/Saved.jsx`)
- Food search → Express API: fetches food (evidence: `frontend/src/pages/general/Search.jsx`)
- Food explorer → Home feed: browses (evidence: `README.md`)
- Food explorer → Food search: searches (evidence: `README.md`)
- Food explorer → Saved collection: views saved (evidence: `README.md`)
- Food explorer → User profile: views profile (evidence: `README.md`)
- Restaurant partner → Create food reel: publishes reel (evidence: `README.md`)
- Express API → Auth routes: mounts (evidence: `backend/src/app.js`)
- Express API → Food routes: mounts (evidence: `backend/src/app.js`)
- Express API → Partner routes: mounts (evidence: `backend/src/app.js`)
- Auth routes → Account operations: dispatches (evidence: `backend/src/routes/auth.routes.js`)
- Food routes → Food operations: dispatches (evidence: `backend/src/routes/food.routes.js`)
- Partner routes → Partner profiles: dispatches (evidence: `backend/src/routes/food-partner.routes.js`)
- Auth routes → JWT authentication: guards identity (evidence: `backend/src/routes/auth.routes.js`)
- Food routes → JWT authentication: guards actions (evidence: `backend/src/routes/food.routes.js`)
- Partner routes → JWT authentication: guards updates (evidence: `backend/src/routes/food-partner.routes.js`)
- Account operations → User records: reads and writes (evidence: `backend/src/controllers/auth.controller.js`)
- Account operations → Partner records: reads and writes (evidence: `backend/src/controllers/auth.controller.js`)
- JWT authentication → User records: loads user (evidence: `backend/src/middlewares/auth.middleware.js`)
- JWT authentication → Partner records: loads partner (evidence: `backend/src/middlewares/auth.middleware.js`)
- Partner profiles → Partner records: manages profile (evidence: `backend/src/controllers/food-partner.controller.js`)
- Partner profiles → Food records: loads partner food (evidence: `backend/src/controllers/food-partner.controller.js`)
- Food operations → Food records: reads and writes (evidence: `backend/src/controllers/food.controllers.js`)
- Food operations → Like records: updates likes (evidence: `backend/src/controllers/food.controllers.js`)
- Food operations → Saved records: updates saves (evidence: `backend/src/controllers/food.controllers.js`)
- Food operations → Video storage client: uploads video (evidence: `backend/src/controllers/food.controllers.js`)
- Food operations → Description generation: requests description (evidence: `backend/src/controllers/food.controllers.js`)
- Video storage client → ImageKit: uploads file (evidence: `backend/src/services/storage.service.js`)
- Description generation → Google Gemini: generates text (evidence: `README.md`)
