# computer-com/forkifyy architecture

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

- Interactive diagram: https://gitdiagram.com/computer-com/forkifyy
- Repository: https://github.com/computer-com/forkifyy

## Overview

ForkiFy is a role-based restaurant platform: customers discover restaurants and make reservations, managers administer restaurant operations, and owners manage restaurants and review reports. The React app routes users into those experiences; the Express server mounts API routes, which access MongoDB models. The README also describes menu ordering with a cart and checkout, but the supplied tree has no dedicated order or checkout backend, so that capability is represented only at the customer-facing restaurant page. Several frontend-to-API connections are not evidenced by sampled source and are omitted.

Main entry points: [`server/server.js`](https://github.com/computer-com/forkifyy/blob/main/server/server.js) (Express API), [`client/src/App.jsx`](https://github.com/computer-com/forkifyy/blob/main/client/src/App.jsx) (App routing), [`server/routes/reservationRoutes.js`](https://github.com/computer-com/forkifyy/blob/main/server/routes/reservationRoutes.js) (Reservation API), [`server/models/User.js`](https://github.com/computer-com/forkifyy/blob/main/server/models/User.js) (User records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_customer_ui["Customer discovery<br/>[UserHome.jsx]"]
  node_restaurant_page["Restaurant page"]
  node_manager_login["Manager sign-in<br/>[ManagerSignIn.jsx]"]
  node_admin_ui["Manager console<br/>[AdminHome.jsx]"]
  node_inventory_ui["Inventory management"]
  node_reservation_ui["Reservation management"]
  node_owner_ui["Owner dashboard<br/>[OwnerHome.jsx]"]
  node_owner_add["Add restaurant<br/>[AddRestaurant.jsx]"]
  node_owner_reports["Owner reports<br/>[OwnerReports.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Authentication API<br/>[authRoutes.js]"]
  node_auth_middleware["JWT authorization<br/>[auth.js]"]
  node_user_model[("User records<br/>[User.js]")]
end

subgraph group_customer["Customer services"]
  node_restaurant_routes["Restaurant API"]
  node_reservation_routes["Reservation API"]
  node_menu_routes["Menu API<br/>[menuRoutes.js]"]
  node_restaurant_model[("Restaurant records<br/>[Restaurant.js]")]
  node_reservation_model[("Reservation records<br/>[Reservation.js]")]
  node_menu_model[("Menu records<br/>[MenuItem.js]")]
end

subgraph group_operations["Restaurant operations"]
  node_server["Express API<br/>[server.js]"]
  node_staff_routes["Staff API<br/>[staffRoutes.js]"]
  node_inventory_routes["Inventory API<br/>[inventoryRoutes.js]"]
  node_stats_routes["Statistics API"]
  node_sales_routes["Sales API<br/>[salesRoutes.js]"]
  node_ledger_routes["Ledger API<br/>[ledgerRoutes.js]"]
  node_settings_routes["Settings API<br/>[settingsRoutes.js]"]
  node_inventory_model[("Inventory records<br/>[Inventory.js]")]
end

node_visitor(("Customer"))
node_operator(("Manager / admin"))
node_proprietor(("Restaurant owner"))
node_mongo[("MongoDB")]
node_email["Email service"]

node_visitor -->|"opens"| node_app
node_operator -->|"opens"| node_app
node_proprietor -->|"opens"| node_app
node_app -->|"routes to"| node_customer_ui
node_app -->|"routes to"| node_manager_login
node_app -->|"routes to"| node_admin_ui
node_app -->|"routes to"| node_owner_ui
node_app -->|"routes to"| node_owner_add
node_app -->|"routes to"| node_owner_reports
node_customer_ui -->|"opens"| node_restaurant_page
node_manager_login -->|"posts credentials"| node_auth_routes
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_restaurant_routes
node_server -->|"mounts"| node_reservation_routes
node_server -->|"mounts"| node_staff_routes
node_server -->|"mounts"| node_inventory_routes
node_server -->|"mounts"| node_stats_routes
node_server -->|"mounts"| node_sales_routes
node_server -->|"mounts"| node_ledger_routes
node_server -->|"mounts"| node_menu_routes
node_server -->|"mounts"| node_settings_routes
node_auth_routes -->|"reads / writes"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model
node_restaurant_routes -->|"reads / writes"| node_restaurant_model
node_restaurant_routes -->|"reads / writes"| node_user_model
node_reservation_routes -->|"reads"| node_restaurant_model
node_reservation_routes -->|"reads / writes"| node_reservation_model
node_reservation_routes -->|"sends confirmation"| node_email
node_menu_routes -->|"reads / writes"| node_menu_model
node_inventory_routes -->|"reads / writes"| node_inventory_model
node_settings_routes -->|"reads / writes"| node_user_model
node_server -->|"connects"| node_mongo

click node_app "https://github.com/computer-com/forkifyy/blob/main/client/src/App.jsx"
click node_customer_ui "https://github.com/computer-com/forkifyy/blob/main/client/src/components/User/UserHome.jsx"
click node_restaurant_page "https://github.com/computer-com/forkifyy/blob/main/client/src/components/User/Restaurant/RestaurantHomePage.jsx"
click node_manager_login "https://github.com/computer-com/forkifyy/blob/main/client/src/components/Authentication/ManagerSignIn.jsx"
click node_admin_ui "https://github.com/computer-com/forkifyy/blob/main/client/src/components/Admin/AdminHome.jsx"
click node_inventory_ui "https://github.com/computer-com/forkifyy/blob/main/client/src/components/Admin/InventoryManagement.jsx"
click node_reservation_ui "https://github.com/computer-com/forkifyy/blob/main/client/src/components/Admin/ReservationAdmin.jsx"
click node_owner_ui "https://github.com/computer-com/forkifyy/blob/main/client/src/components/Owner/OwnerHome.jsx"
click node_owner_add "https://github.com/computer-com/forkifyy/blob/main/client/src/components/Owner/AddRestaurant.jsx"
click node_owner_reports "https://github.com/computer-com/forkifyy/blob/main/client/src/components/Owner/OwnerReports.jsx"
click node_server "https://github.com/computer-com/forkifyy/blob/main/server/server.js"
click node_auth_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/authRoutes.js"
click node_auth_middleware "https://github.com/computer-com/forkifyy/blob/main/server/middleware/auth.js"
click node_restaurant_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/restaurantRoutes.js"
click node_reservation_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/reservationRoutes.js"
click node_menu_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/menuRoutes.js"
click node_staff_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/staffRoutes.js"
click node_inventory_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/inventoryRoutes.js"
click node_stats_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/statisticsRoutes.js"
click node_sales_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/salesRoutes.js"
click node_ledger_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/ledgerRoutes.js"
click node_settings_routes "https://github.com/computer-com/forkifyy/blob/main/server/routes/settingsRoutes.js"
click node_restaurant_model "https://github.com/computer-com/forkifyy/blob/main/server/models/Restaurant.js"
click node_reservation_model "https://github.com/computer-com/forkifyy/blob/main/server/models/Reservation.js"
click node_menu_model "https://github.com/computer-com/forkifyy/blob/main/server/models/MenuItem.js"
click node_user_model "https://github.com/computer-com/forkifyy/blob/main/server/models/User.js"
click node_inventory_model "https://github.com/computer-com/forkifyy/blob/main/server/models/Inventory.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_customer_ui,node_restaurant_page,node_manager_login,node_admin_ui,node_inventory_ui,node_reservation_ui,node_owner_ui,node_owner_add,node_owner_reports toneBlue
class node_auth_routes,node_auth_middleware,node_user_model,node_mongo toneAmber
class node_restaurant_routes,node_reservation_routes,node_menu_routes,node_restaurant_model,node_reservation_model,node_menu_model toneMint
class node_server,node_staff_routes,node_inventory_routes,node_stats_routes,node_sales_routes,node_ledger_routes,node_settings_routes,node_inventory_model toneRose
class node_visitor,node_operator,node_proprietor,node_email toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/computer-com/forkifyy/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Customer discovery](https://github.com/computer-com/forkifyy/blob/main/client/src/components/User/UserHome.jsx): `client/src/components/User/UserHome.jsx`
- [Restaurant page](https://github.com/computer-com/forkifyy/blob/main/client/src/components/User/Restaurant/RestaurantHomePage.jsx): `client/src/components/User/Restaurant/RestaurantHomePage.jsx`
- [Manager sign-in](https://github.com/computer-com/forkifyy/blob/main/client/src/components/Authentication/ManagerSignIn.jsx): `client/src/components/Authentication/ManagerSignIn.jsx`
- [Manager console](https://github.com/computer-com/forkifyy/blob/main/client/src/components/Admin/AdminHome.jsx): `client/src/components/Admin/AdminHome.jsx`
- [Inventory management](https://github.com/computer-com/forkifyy/blob/main/client/src/components/Admin/InventoryManagement.jsx): `client/src/components/Admin/InventoryManagement.jsx`
- [Reservation management](https://github.com/computer-com/forkifyy/blob/main/client/src/components/Admin/ReservationAdmin.jsx): `client/src/components/Admin/ReservationAdmin.jsx`
- [Owner dashboard](https://github.com/computer-com/forkifyy/blob/main/client/src/components/Owner/OwnerHome.jsx): `client/src/components/Owner/OwnerHome.jsx`
- [Add restaurant](https://github.com/computer-com/forkifyy/blob/main/client/src/components/Owner/AddRestaurant.jsx): `client/src/components/Owner/AddRestaurant.jsx`
- [Owner reports](https://github.com/computer-com/forkifyy/blob/main/client/src/components/Owner/OwnerReports.jsx): `client/src/components/Owner/OwnerReports.jsx`

### Identity and access

- [Authentication API](https://github.com/computer-com/forkifyy/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [JWT authorization](https://github.com/computer-com/forkifyy/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [User records](https://github.com/computer-com/forkifyy/blob/main/server/models/User.js): `server/models/User.js`

### Customer services

- [Restaurant API](https://github.com/computer-com/forkifyy/blob/main/server/routes/restaurantRoutes.js): `server/routes/restaurantRoutes.js`
- [Reservation API](https://github.com/computer-com/forkifyy/blob/main/server/routes/reservationRoutes.js): `server/routes/reservationRoutes.js`
- [Menu API](https://github.com/computer-com/forkifyy/blob/main/server/routes/menuRoutes.js): `server/routes/menuRoutes.js`
- [Restaurant records](https://github.com/computer-com/forkifyy/blob/main/server/models/Restaurant.js): `server/models/Restaurant.js`
- [Reservation records](https://github.com/computer-com/forkifyy/blob/main/server/models/Reservation.js): `server/models/Reservation.js`
- [Menu records](https://github.com/computer-com/forkifyy/blob/main/server/models/MenuItem.js): `server/models/MenuItem.js`

### Restaurant operations

- [Express API](https://github.com/computer-com/forkifyy/blob/main/server/server.js): `server/server.js`
- [Staff API](https://github.com/computer-com/forkifyy/blob/main/server/routes/staffRoutes.js): `server/routes/staffRoutes.js`
- [Inventory API](https://github.com/computer-com/forkifyy/blob/main/server/routes/inventoryRoutes.js): `server/routes/inventoryRoutes.js`
- [Statistics API](https://github.com/computer-com/forkifyy/blob/main/server/routes/statisticsRoutes.js): `server/routes/statisticsRoutes.js`
- [Sales API](https://github.com/computer-com/forkifyy/blob/main/server/routes/salesRoutes.js): `server/routes/salesRoutes.js`
- [Ledger API](https://github.com/computer-com/forkifyy/blob/main/server/routes/ledgerRoutes.js): `server/routes/ledgerRoutes.js`
- [Settings API](https://github.com/computer-com/forkifyy/blob/main/server/routes/settingsRoutes.js): `server/routes/settingsRoutes.js`
- [Inventory records](https://github.com/computer-com/forkifyy/blob/main/server/models/Inventory.js): `server/models/Inventory.js`

### Other components

- **Customer**
- **Manager / admin**
- **Restaurant owner**
- **MongoDB**
- **Email service**

## Connections

- Customer → App routing: opens
- Manager / admin → App routing: opens
- Restaurant owner → App routing: opens
- App routing → Customer discovery: routes to
- App routing → Manager sign-in: routes to
- App routing → Manager console: routes to
- App routing → Owner dashboard: routes to
- App routing → Add restaurant: routes to
- App routing → Owner reports: routes to
- Customer discovery → Restaurant page: opens
- Manager sign-in → Authentication API: posts credentials
- Express API → Authentication API: mounts
- Express API → Restaurant API: mounts
- Express API → Reservation API: mounts
- Express API → Staff API: mounts
- Express API → Inventory API: mounts
- Express API → Statistics API: mounts
- Express API → Sales API: mounts
- Express API → Ledger API: mounts
- Express API → Menu API: mounts
- Express API → Settings API: mounts
- Authentication API → User records: reads / writes
- JWT authorization → User records: loads user
- Restaurant API → Restaurant records: reads / writes
- Restaurant API → User records: reads / writes
- Reservation API → Restaurant records: reads
- Reservation API → Reservation records: reads / writes
- Reservation API → Email service: sends confirmation
- Menu API → Menu records: reads / writes
- Inventory API → Inventory records: reads / writes
- Settings API → User records: reads / writes
- Express API → MongoDB: connects
