# faraz-rahimi/restaurant architecture

> Architecture diagram of the GitHub repository faraz-rahimi/restaurant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/faraz-rahimi/restaurant
- Repository: https://github.com/faraz-rahimi/restaurant

## Overview

Foodino is a bilingual restaurant-ordering SPA. Visitors browse the landing page or menu, add food to a cloud-backed cart, then sign in or register to manage and submit orders; the cart page also displays order history. The diagram preserves the documented landing-page sections, responsive navigation, localization, and account flows. API request links follow the excerpts and README; unsampled implementation details are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/faraz-rahimi/restaurant/blob/main/src/App.tsx) (SPA routes), [`src/Components/Header.tsx`](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Header.tsx) (Navigation), [`src/API/users.ts`](https://github.com/faraz-rahimi/restaurant/blob/main/src/API/users.ts) (Users client), [`src/Pages/Home.tsx`](https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Home.tsx) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Visitor experience"]
  node_app["SPA routes<br/>[App.tsx]"]
  node_layout["Site layout<br/>[Layout.tsx]"]
  node_header["Navigation<br/>[Header.tsx]"]
  node_home["Landing page<br/>[Home.tsx]"]
  node_hero["Hero section<br/>[Hero.tsx]"]
  node_about["About section<br/>[About.tsx]"]
  node_contact["Contact section<br/>[Contact.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_notfound["Not found page<br/>[PageNotFound.tsx]"]
end

subgraph group_ordering["Ordering"]
  node_menu["Menu page<br/>[Menu.tsx]"]
  node_foodcard["Food cards<br/>[FoodCard.tsx]"]
  node_cart["Cart and orders<br/>[Cart.tsx]"]
  node_productsapi["Products client<br/>[products.ts]"]
  node_ordersapi["Orders client<br/>[orders.ts]"]
  node_productservice["Products API"]
  node_orderservice["Orders API"]
end

subgraph group_identity["Accounts"]
  node_login["Sign in<br/>[Login.tsx]"]
  node_signup["Registration<br/>[SignUp.tsx]"]
  node_usersapi["Users client<br/>[users.ts]"]
  node_userservice["Users API"]
end

subgraph group_shared["Shared services"]
  node_i18n["Localization setup<br/>[I18n.ts]"]
  node_translations["Translation files"]
  node_storagehook["Local storage hook<br/>[useLocalStorage.ts]"]
  node_mobilehook["Mobile breakpoint hook<br/>[useIsMobile.ts]"]
  node_loginicon["Login icon<br/>[LoginIcon.tsx]"]
  node_logo["Brand logo<br/>[Logo.tsx]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_menu
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"routes fallback"| node_notfound
node_layout -->|"renders"| node_header
node_layout -->|"renders"| node_footer
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_about
node_home -->|"renders"| node_foodcard
node_home -->|"renders"| node_contact
node_menu -->|"renders"| node_foodcard
node_foodcard -->|"fetches catalog"| node_productsapi
node_productsapi -->|"requests products"| node_productservice
node_foodcard -->|"reads and updates cart"| node_usersapi
node_cart -->|"reads and clears cart"| node_usersapi
node_cart -->|"submits and fetches"| node_ordersapi
node_ordersapi -->|"requests orders"| node_orderservice
node_usersapi -->|"requests users"| node_userservice
node_login -->|"checks credentials"| node_usersapi
node_signup -->|"checks and registers"| node_usersapi
node_header -->|"loads user"| node_usersapi
node_header -->|"persists language"| node_storagehook
node_header -->|"checks viewport"| node_mobilehook
node_header -->|"renders"| node_logo
node_header -->|"renders"| node_loginicon
node_app -->|"loads localization"| node_i18n
node_i18n -->|"loads dictionaries"| node_translations

click node_app "https://github.com/faraz-rahimi/restaurant/blob/main/src/App.tsx"
click node_layout "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Layout.tsx"
click node_header "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Header.tsx"
click node_home "https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Home.tsx"
click node_hero "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Hero.tsx"
click node_about "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/About.tsx"
click node_contact "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Contact.tsx"
click node_footer "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Footer.tsx"
click node_notfound "https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/PageNotFound.tsx"
click node_menu "https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Menu.tsx"
click node_foodcard "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/FoodCard.tsx"
click node_cart "https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Cart.tsx"
click node_productsapi "https://github.com/faraz-rahimi/restaurant/blob/main/src/API/products.ts"
click node_ordersapi "https://github.com/faraz-rahimi/restaurant/blob/main/src/API/orders.ts"
click node_login "https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Profile/Login.tsx"
click node_signup "https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Profile/SignUp.tsx"
click node_usersapi "https://github.com/faraz-rahimi/restaurant/blob/main/src/API/users.ts"
click node_i18n "https://github.com/faraz-rahimi/restaurant/blob/main/src/I18n/I18n.ts"
click node_translations "https://github.com/faraz-rahimi/restaurant/tree/main/src/I18n/Locales"
click node_storagehook "https://github.com/faraz-rahimi/restaurant/blob/main/src/Hooks/useLocalStorage.ts"
click node_mobilehook "https://github.com/faraz-rahimi/restaurant/blob/main/src/Hooks/useIsMobile.ts"
click node_loginicon "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/LoginIcon.tsx"
click node_logo "https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Logo.tsx"

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_layout,node_header,node_home,node_hero,node_about,node_contact,node_footer,node_notfound toneBlue
class node_menu,node_foodcard,node_cart,node_productsapi,node_ordersapi,node_productservice,node_orderservice toneAmber
class node_login,node_signup,node_usersapi,node_userservice toneMint
class node_i18n,node_translations,node_storagehook,node_mobilehook,node_loginicon,node_logo toneRose
class node_visitor toneIndigo
```

## Components

### Visitor experience

- [SPA routes](https://github.com/faraz-rahimi/restaurant/blob/main/src/App.tsx): `src/App.tsx`
- [Site layout](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Layout.tsx): `src/Components/Layout.tsx`
- [Navigation](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Header.tsx): `src/Components/Header.tsx`
- [Landing page](https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Home.tsx): `src/Pages/Home.tsx`
- [Hero section](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Hero.tsx): `src/Components/Hero.tsx`
- [About section](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/About.tsx): `src/Components/About.tsx`
- [Contact section](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Contact.tsx): `src/Components/Contact.tsx`
- [Footer](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Footer.tsx): `src/Components/Footer.tsx`
- [Not found page](https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/PageNotFound.tsx): `src/Pages/PageNotFound.tsx`

### Ordering

- [Menu page](https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Menu.tsx): `src/Pages/Menu.tsx`
- [Food cards](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/FoodCard.tsx): `src/Components/FoodCard.tsx`
- [Cart and orders](https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Cart.tsx): `src/Pages/Cart.tsx`
- [Products client](https://github.com/faraz-rahimi/restaurant/blob/main/src/API/products.ts): `src/API/products.ts`
- [Orders client](https://github.com/faraz-rahimi/restaurant/blob/main/src/API/orders.ts): `src/API/orders.ts`
- **Products API**
- **Orders API**

### Accounts

- [Sign in](https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Profile/Login.tsx): `src/Pages/Profile/Login.tsx`
- [Registration](https://github.com/faraz-rahimi/restaurant/blob/main/src/Pages/Profile/SignUp.tsx): `src/Pages/Profile/SignUp.tsx`
- [Users client](https://github.com/faraz-rahimi/restaurant/blob/main/src/API/users.ts): `src/API/users.ts`
- **Users API**

### Shared services

- [Localization setup](https://github.com/faraz-rahimi/restaurant/blob/main/src/I18n/I18n.ts): `src/I18n/I18n.ts`
- [Translation files](https://github.com/faraz-rahimi/restaurant/tree/main/src/I18n/Locales): `src/I18n/Locales`
- [Local storage hook](https://github.com/faraz-rahimi/restaurant/blob/main/src/Hooks/useLocalStorage.ts): `src/Hooks/useLocalStorage.ts`
- [Mobile breakpoint hook](https://github.com/faraz-rahimi/restaurant/blob/main/src/Hooks/useIsMobile.ts): `src/Hooks/useIsMobile.ts`
- [Login icon](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/LoginIcon.tsx): `src/Components/LoginIcon.tsx`
- [Brand logo](https://github.com/faraz-rahimi/restaurant/blob/main/src/Components/Logo.tsx): `src/Components/Logo.tsx`

### Other components

- **Visitor**

## Connections

- Visitor → SPA routes: opens
- SPA routes → Site layout: routes through (evidence: `src/App.tsx`)
- SPA routes → Landing page: routes to (evidence: `src/App.tsx`)
- SPA routes → Menu page: routes to (evidence: `src/App.tsx`)
- SPA routes → Cart and orders: routes to (evidence: `src/App.tsx`)
- SPA routes → Sign in: routes to (evidence: `src/App.tsx`)
- SPA routes → Registration: routes to (evidence: `src/App.tsx`)
- SPA routes → Not found page: routes fallback (evidence: `src/App.tsx`)
- Site layout → Navigation: renders (evidence: `src/Components/Layout.tsx`)
- Site layout → Footer: renders (evidence: `src/Components/Layout.tsx`)
- Landing page → Hero section: renders (evidence: `src/Pages/Home.tsx`)
- Landing page → About section: renders (evidence: `src/Pages/Home.tsx`)
- Landing page → Food cards: renders (evidence: `src/Pages/Home.tsx`)
- Landing page → Contact section: renders (evidence: `src/Pages/Home.tsx`)
- Menu page → Food cards: renders (evidence: `src/Pages/Menu.tsx`)
- Food cards → Products client: fetches catalog (evidence: `src/Components/FoodCard.tsx`)
- Products client → Products API: requests products (evidence: `README.md`)
- Food cards → Users client: reads and updates cart (evidence: `src/Components/FoodCard.tsx`)
- Cart and orders → Users client: reads and clears cart (evidence: `src/Pages/Cart.tsx`)
- Cart and orders → Orders client: submits and fetches (evidence: `src/Pages/Cart.tsx`)
- Orders client → Orders API: requests orders (evidence: `README.md`)
- Users client → Users API: requests users (evidence: `src/API/users.ts`)
- Sign in → Users client: checks credentials (evidence: `src/Pages/Profile/Login.tsx`)
- Registration → Users client: checks and registers (evidence: `src/Pages/Profile/SignUp.tsx`)
- Navigation → Users client: loads user (evidence: `src/Components/Header.tsx`)
- Navigation → Local storage hook: persists language (evidence: `src/Components/Header.tsx`)
- Navigation → Mobile breakpoint hook: checks viewport (evidence: `src/Components/Header.tsx`)
- Navigation → Brand logo: renders (evidence: `src/Components/Header.tsx`)
- Navigation → Login icon: renders (evidence: `src/Components/Header.tsx`)
- SPA routes → Localization setup: loads localization (evidence: `src/main.tsx`)
- Localization setup → Translation files: loads dictionaries (evidence: `src/I18n/I18n.ts`)
