# ouadie-pro/food-app architecture

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

- Interactive diagram: https://gitdiagram.com/ouadie-pro/food-app
- Repository: https://github.com/ouadie-pro/food-app

## Overview

The tree shows two recipe-management implementations: a Next.js application with its own pages and API, and a separate React/Express stack. Their product flows cover recipe browsing and management, user registration/sign-in, and saved or personal recipe views. The sampled Next.js routes confirm database, token, and image-upload behavior; the legacy router/controller wiring and most UI-to-API calls were not sampled, so those links are omitted.

Main entry points: [`world-recipes/lib/connectDb.js`](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/lib/connectDb.js) (DB connection), [`frontend/src/App.jsx`](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/App.jsx) (React router), [`world-recipes/app/api/recipe/add/route.js`](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/add/route.js) (Create recipe), [`world-recipes/app/api/recipe/[id]/edit/route.js`](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/%5Bid%5D/edit/route.js) (Edit recipe)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_next_ui["Next.js experience"]
  node_next_home["Recipe home<br/>[page.js]"]
  node_next_add_page["Add recipe page<br/>[page.js]"]
  node_next_edit_page["Edit recipe page<br/>[page.js]"]
  node_next_favs_page["Favorites page<br/>[page.js]"]
  node_next_mine_page["My recipes page<br/>[page.js]"]
  node_next_contact["Contact page<br/>[page.js]"]
  node_next_nav["Navigation<br/>[Navbar.jsx]"]
  node_next_all["Recipe listing<br/>[AllRecipes.jsx]"]
  node_next_login["Login modal<br/>[LoginModal.jsx]"]
end

subgraph group_next_api["Next.js API"]
  node_api_recipe_list["List recipes<br/>[route.js]"]
  node_api_recipe_one["Get recipe<br/>[route.js]"]
  node_api_recipe_add["Create recipe<br/>[route.js]"]
  node_api_recipe_edit["Edit recipe<br/>[route.js]"]
  node_api_recipe_delete["Delete recipe<br/>[route.js]"]
  node_api_register["Register user<br/>[route.js]"]
  node_api_signin["Sign in<br/>[route.js]"]
  node_api_user_get["Get user<br/>[route.js]"]
  node_api_user_delete["Delete user<br/>[route.js]"]
end

subgraph group_next_data["Data and integrations"]
  node_connect_db["DB connection<br/>[connectDb.js]"]
  node_verify_token["Token verification<br/>[verifyToken.js]"]
  node_recipe_model["Recipe model<br/>[Recipe.js]"]
  node_user_model["User model<br/>[User.js]"]
  node_mongo[("MongoDB")]
  node_cloudinary["Cloudinary"]
end

subgraph group_legacy_ui["React experience"]
  node_legacy_app["React router<br/>[App.jsx]"]
  node_legacy_home["Home view<br/>[Home.jsx]"]
  node_legacy_add["Add recipe view<br/>[AddRecipes.jsx]"]
  node_legacy_mine["My recipes view<br/>[MyRecipes.jsx]"]
  node_legacy_favs["Favorites view<br/>[MyFavRecipes.jsx]"]
  node_legacy_edit["Edit recipe view<br/>[EditRecipe.jsx]"]
  node_legacy_nav["Navigation<br/>[Navbar.jsx]"]
  node_legacy_list["Recipe listing<br/>[AllRecipes.jsx]"]
  node_legacy_form["Recipe form<br/>[InputFrom.jsx]"]
end

subgraph group_legacy_api["Express backend"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_next_home
node_visitor -->|"opens"| node_next_add_page
node_visitor -->|"opens"| node_next_edit_page
node_visitor -->|"opens"| node_next_favs_page
node_visitor -->|"opens"| node_next_mine_page
node_visitor -->|"opens"| node_next_contact
node_api_recipe_list -->|"connects"| node_connect_db
node_api_recipe_list -->|"queries"| node_recipe_model
node_api_recipe_one -->|"connects"| node_connect_db
node_api_recipe_one -->|"reads"| node_mongo
node_api_recipe_add -->|"connects"| node_connect_db
node_api_recipe_add -->|"verifies"| node_verify_token
node_api_recipe_add -.->|"uploads image"| node_cloudinary
node_api_recipe_add -->|"creates"| node_recipe_model
node_api_recipe_edit -->|"connects"| node_connect_db
node_api_recipe_edit -->|"verifies"| node_verify_token
node_api_recipe_edit -->|"updates"| node_mongo
node_api_recipe_edit -.->|"uploads image"| node_cloudinary
node_api_recipe_delete -->|"connects"| node_connect_db
node_api_recipe_delete -->|"deletes"| node_mongo
node_api_register -->|"connects"| node_connect_db
node_api_register -->|"creates user"| node_user_model
node_api_signin -->|"connects"| node_connect_db
node_api_signin -->|"finds user"| node_user_model
node_api_user_get -->|"connects"| node_connect_db
node_api_user_get -->|"reads"| node_user_model
node_api_user_delete -->|"connects"| node_connect_db
node_api_user_delete -->|"deletes"| node_user_model
node_legacy_app -->|"routes"| node_legacy_home
node_legacy_app -->|"routes"| node_legacy_add
node_legacy_app -->|"routes"| node_legacy_mine
node_legacy_app -->|"routes"| node_legacy_favs
node_legacy_app -->|"routes"| node_legacy_edit

click node_next_home "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/page.js"
click node_next_add_page "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/addRecipe/page.js"
click node_next_edit_page "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/editRecipe/%5Bid%5D/page.js"
click node_next_favs_page "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/myFavRecipes/page.js"
click node_next_mine_page "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/myRecipes/page.js"
click node_next_contact "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/contact/page.js"
click node_next_nav "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/components/Navbar.jsx"
click node_next_all "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/components/AllRecipes.jsx"
click node_next_login "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/components/LoginModal.jsx"
click node_api_recipe_list "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/route.js"
click node_api_recipe_one "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/%5Bid%5D/route.js"
click node_api_recipe_add "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/add/route.js"
click node_api_recipe_edit "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/%5Bid%5D/edit/route.js"
click node_api_recipe_delete "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/%5Bid%5D/delete/route.js"
click node_api_register "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/user/register/route.js"
click node_api_signin "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/user/signin/route.js"
click node_api_user_get "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/user/%5Bid%5D/route.js"
click node_api_user_delete "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/user/%5Bid%5D/delete/route.js"
click node_connect_db "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/lib/connectDb.js"
click node_verify_token "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/lib/verifyToken.js"
click node_recipe_model "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/models/Recipe.js"
click node_user_model "https://github.com/ouadie-pro/food-app/blob/main/world-recipes/models/User.js"
click node_legacy_app "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/App.jsx"
click node_legacy_home "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Pages/Home.jsx"
click node_legacy_add "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/AddRecipes.jsx"
click node_legacy_mine "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/MyRecipes.jsx"
click node_legacy_favs "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/MyFavRecipes.jsx"
click node_legacy_edit "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Pages/EditRecipe.jsx"
click node_legacy_nav "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/Navbar.jsx"
click node_legacy_list "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/AllRecipes.jsx"
click node_legacy_form "https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/InputFrom.jsx"

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_next_home,node_next_add_page,node_next_edit_page,node_next_favs_page,node_next_mine_page,node_next_contact,node_next_nav,node_next_all,node_next_login toneBlue
class node_api_recipe_list,node_api_recipe_one,node_api_recipe_add,node_api_recipe_edit,node_api_recipe_delete,node_api_register,node_api_signin,node_api_user_get,node_api_user_delete toneAmber
class node_connect_db,node_verify_token,node_recipe_model,node_user_model,node_mongo,node_cloudinary toneMint
class node_legacy_app,node_legacy_home,node_legacy_add,node_legacy_mine,node_legacy_favs,node_legacy_edit,node_legacy_nav,node_legacy_list,node_legacy_form toneRose
class node_visitor toneIndigo
```

## Components

### Next.js experience

- [Recipe home](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/page.js): `world-recipes/app/page.js`
- [Add recipe page](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/addRecipe/page.js): `world-recipes/app/addRecipe/page.js`
- [Edit recipe page](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/editRecipe/%5Bid%5D/page.js): `world-recipes/app/editRecipe/[id]/page.js`
- [Favorites page](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/myFavRecipes/page.js): `world-recipes/app/myFavRecipes/page.js`
- [My recipes page](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/myRecipes/page.js): `world-recipes/app/myRecipes/page.js`
- [Contact page](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/contact/page.js): `world-recipes/app/contact/page.js`
- [Navigation](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/components/Navbar.jsx): `world-recipes/components/Navbar.jsx`
- [Recipe listing](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/components/AllRecipes.jsx): `world-recipes/components/AllRecipes.jsx`
- [Login modal](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/components/LoginModal.jsx): `world-recipes/components/LoginModal.jsx`

### Next.js API

- [List recipes](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/route.js): `world-recipes/app/api/recipe/route.js`
- [Get recipe](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/%5Bid%5D/route.js): `world-recipes/app/api/recipe/[id]/route.js`
- [Create recipe](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/add/route.js): `world-recipes/app/api/recipe/add/route.js`
- [Edit recipe](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/%5Bid%5D/edit/route.js): `world-recipes/app/api/recipe/[id]/edit/route.js`
- [Delete recipe](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/recipe/%5Bid%5D/delete/route.js): `world-recipes/app/api/recipe/[id]/delete/route.js`
- [Register user](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/user/register/route.js): `world-recipes/app/api/user/register/route.js`
- [Sign in](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/user/signin/route.js): `world-recipes/app/api/user/signin/route.js`
- [Get user](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/user/%5Bid%5D/route.js): `world-recipes/app/api/user/[id]/route.js`
- [Delete user](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/app/api/user/%5Bid%5D/delete/route.js): `world-recipes/app/api/user/[id]/delete/route.js`

### Data and integrations

- [DB connection](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/lib/connectDb.js): `world-recipes/lib/connectDb.js`
- [Token verification](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/lib/verifyToken.js): `world-recipes/lib/verifyToken.js`
- [Recipe model](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/models/Recipe.js): `world-recipes/models/Recipe.js`
- [User model](https://github.com/ouadie-pro/food-app/blob/main/world-recipes/models/User.js): `world-recipes/models/User.js`
- **MongoDB**
- **Cloudinary**

### React experience

- [React router](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home view](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Pages/Home.jsx): `frontend/src/Pages/Home.jsx`
- [Add recipe view](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/AddRecipes.jsx): `frontend/src/Components/AddRecipes.jsx`
- [My recipes view](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/MyRecipes.jsx): `frontend/src/Components/MyRecipes.jsx`
- [Favorites view](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/MyFavRecipes.jsx): `frontend/src/Components/MyFavRecipes.jsx`
- [Edit recipe view](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Pages/EditRecipe.jsx): `frontend/src/Pages/EditRecipe.jsx`
- [Navigation](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/Navbar.jsx): `frontend/src/Components/Navbar.jsx`
- [Recipe listing](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/AllRecipes.jsx): `frontend/src/Components/AllRecipes.jsx`
- [Recipe form](https://github.com/ouadie-pro/food-app/blob/main/frontend/src/Components/InputFrom.jsx): `frontend/src/Components/InputFrom.jsx`

### Other components

- **Visitor**

## Connections

- Visitor → Recipe home: opens
- Visitor → Add recipe page: opens
- Visitor → Edit recipe page: opens
- Visitor → Favorites page: opens
- Visitor → My recipes page: opens
- Visitor → Contact page: opens
- List recipes → DB connection: connects
- List recipes → Recipe model: queries
- Get recipe → DB connection: connects
- Get recipe → MongoDB: reads
- Create recipe → DB connection: connects
- Create recipe → Token verification: verifies
- Create recipe → Cloudinary: uploads image
- Create recipe → Recipe model: creates
- Edit recipe → DB connection: connects
- Edit recipe → Token verification: verifies
- Edit recipe → MongoDB: updates
- Edit recipe → Cloudinary: uploads image
- Delete recipe → DB connection: connects
- Delete recipe → MongoDB: deletes
- Register user → DB connection: connects
- Register user → User model: creates user
- Sign in → DB connection: connects
- Sign in → User model: finds user
- Get user → DB connection: connects
- Get user → User model: reads
- Delete user → DB connection: connects
- Delete user → User model: deletes
- React router → Home view: routes
- React router → Add recipe view: routes
- React router → My recipes view: routes
- React router → Favorites view: routes
- React router → Edit recipe view: routes
