# harshaprasadreddy13/restaurant-full-stack architecture

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

- Interactive diagram: https://gitdiagram.com/harshaprasadreddy13/restaurant-full-stack
- Repository: https://github.com/harshaprasadreddy13/restaurant-full-stack

## Overview

This repository implements a restaurant ordering application: customers browse food, manage a cart, place and review orders, while admins manage food and orders; account registration, login, and password recovery support those flows. The frontend route table and authentication implementation are excerpted, but most controllers, domain services, and customer/admin screens are not. Accordingly, unverified frontend-to-API and backend service links are dashed; solid edges are limited to relationships visible in excerpts or the SOURCE INDEX.

Main entry points: [`restaurant-frontend-fixed/restaurant-frontend/src/api/api.js`](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/api/api.js) (HTTP client), [`restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx`](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx) (Web routes), [`restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AuthServiceImpl.java`](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AuthServiceImpl.java) (Account and recovery), [`restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/repository/FoodRepository.java`](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/repository/FoodRepository.java) (Food and order stores)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Customer and admin web app"]
  node_routes["Web routes<br/>[AppRoutes.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_authui["Login and signup<br/>[Login.jsx]"]
  node_browseui["Food browsing<br/>[Home.jsx]"]
  node_cartui["Cart and checkout<br/>[Cart.jsx]"]
  node_ordersui["Order history<br/>[OrderHistory.jsx]"]
  node_adminui["Admin console<br/>[Admin.jsx]"]
  node_authcontext["Session state<br/>[AuthContext.jsx]"]
  node_apiclient["HTTP client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_authapi["Authentication API"]
  node_foodapi["Food API"]
  node_cartapi["Cart API"]
  node_orderapi["Order API"]
  node_adminapi["Admin API"]
end

subgraph group_identity["Identity and access"]
  node_authservice["Account and recovery"]
  node_jwt["JWT service<br/>[JwtService.java]"]
  node_userdetails["User identity lookup"]
end

subgraph group_commerce["Food and ordering"]
  node_foodservice["Food catalog"]
  node_cartservice["Cart management"]
  node_orderservice["Order processing"]
  node_adminservice["Admin operations"]
end

subgraph group_data["Persistence and integrations"]
  node_users["User records<br/>[User.java]"]
  node_userrepo[("User repository")]
  node_fooddata[("Food and order stores")]
  node_mail["Email delivery<br/>[MailService.java]"]
  node_storage["Image storage"]
end

node_visitor(("Customer or admin"))

node_visitor -.->|"uses"| node_routes
node_routes -->|"renders"| node_navbar
node_routes -->|"routes to"| node_authui
node_routes -->|"routes to"| node_browseui
node_routes -->|"routes to"| node_cartui
node_routes -->|"routes to"| node_ordersui
node_routes -->|"routes to"| node_adminui
node_authui -.->|"updates session"| node_authcontext
node_authui -.->|"submits credentials"| node_apiclient
node_browseui -.->|"requests food"| node_apiclient
node_cartui -.->|"manages cart"| node_apiclient
node_ordersui -.->|"requests orders"| node_apiclient
node_adminui -.->|"manages catalog"| node_apiclient
node_apiclient -.->|"HTTP requests"| node_authapi
node_apiclient -.->|"HTTP requests"| node_foodapi
node_apiclient -.->|"HTTP requests"| node_cartapi
node_apiclient -.->|"HTTP requests"| node_orderapi
node_apiclient -.->|"HTTP requests"| node_adminapi
node_authapi -.->|"delegates"| node_authservice
node_foodapi -.->|"delegates"| node_foodservice
node_cartapi -.->|"delegates"| node_cartservice
node_orderapi -.->|"delegates"| node_orderservice
node_adminapi -.->|"delegates"| node_adminservice
node_authservice -->|"reads and writes"| node_userrepo
node_authservice -->|"creates token"| node_jwt
node_authservice -->|"sends reset OTP"| node_mail
node_userdetails -->|"looks up user"| node_userrepo
node_userrepo -->|"loads records"| node_users
node_foodservice -.->|"uses catalog"| node_fooddata
node_cartservice -.->|"uses order stores"| node_fooddata
node_orderservice -.->|"uses order stores"| node_fooddata
node_adminservice -.->|"uses catalog"| node_fooddata
node_foodservice -.->|"stores images"| node_storage

click node_routes "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx"
click node_navbar "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/components/Navbar.jsx"
click node_authui "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/auth/Login.jsx"
click node_browseui "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/Home.jsx"
click node_cartui "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/Cart.jsx"
click node_ordersui "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/OrderHistory.jsx"
click node_adminui "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/admin/Admin.jsx"
click node_authcontext "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/context/AuthContext.jsx"
click node_apiclient "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/api/api.js"
click node_authapi "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/AuthController.java"
click node_foodapi "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/FoodController.java"
click node_cartapi "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/CartController.java"
click node_orderapi "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/OrderController.java"
click node_adminapi "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/AdminController.java"
click node_authservice "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AuthServiceImpl.java"
click node_jwt "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/security/jwt/JwtService.java"
click node_userdetails "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/security/userDetails/CustomUserDetailsService.java"
click node_foodservice "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/FoodServiceImpl.java"
click node_cartservice "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/CartServiceImpl.java"
click node_orderservice "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/OrderServiceImpl.java"
click node_adminservice "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AdminServiceImpl.java"
click node_users "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/enitity/User.java"
click node_userrepo "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/repository/UserRepository.java"
click node_fooddata "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/repository/FoodRepository.java"
click node_mail "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/email/MailService.java"
click node_storage "https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/FileStorageServiceImpl.java"

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_routes,node_navbar,node_authui,node_browseui,node_cartui,node_ordersui,node_adminui,node_authcontext,node_apiclient toneBlue
class node_authapi,node_foodapi,node_cartapi,node_orderapi,node_adminapi toneAmber
class node_authservice,node_jwt,node_userdetails toneMint
class node_foodservice,node_cartservice,node_orderservice,node_adminservice toneRose
class node_users,node_userrepo,node_fooddata,node_mail,node_storage,node_visitor toneIndigo
```

## Components

### Customer and admin web app

- [Web routes](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx): `restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx`
- [Navigation](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/components/Navbar.jsx): `restaurant-frontend-fixed/restaurant-frontend/src/components/Navbar.jsx`
- [Login and signup](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/auth/Login.jsx): `restaurant-frontend-fixed/restaurant-frontend/src/pages/auth/Login.jsx`
- [Food browsing](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/Home.jsx): `restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/Home.jsx`
- [Cart and checkout](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/Cart.jsx): `restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/Cart.jsx`
- [Order history](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/OrderHistory.jsx): `restaurant-frontend-fixed/restaurant-frontend/src/pages/customer/OrderHistory.jsx`
- [Admin console](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/pages/admin/Admin.jsx): `restaurant-frontend-fixed/restaurant-frontend/src/pages/admin/Admin.jsx`
- [Session state](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/context/AuthContext.jsx): `restaurant-frontend-fixed/restaurant-frontend/src/context/AuthContext.jsx`
- [HTTP client](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-frontend-fixed/restaurant-frontend/src/api/api.js): `restaurant-frontend-fixed/restaurant-frontend/src/api/api.js`

### Backend API

- [Authentication API](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/AuthController.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/AuthController.java`
- [Food API](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/FoodController.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/FoodController.java`
- [Cart API](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/CartController.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/CartController.java`
- [Order API](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/OrderController.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/OrderController.java`
- [Admin API](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/AdminController.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/controller/AdminController.java`

### Identity and access

- [Account and recovery](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AuthServiceImpl.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AuthServiceImpl.java`
- [JWT service](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/security/jwt/JwtService.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/security/jwt/JwtService.java`
- [User identity lookup](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/security/userDetails/CustomUserDetailsService.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/security/userDetails/CustomUserDetailsService.java`

### Food and ordering

- [Food catalog](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/FoodServiceImpl.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/FoodServiceImpl.java`
- [Cart management](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/CartServiceImpl.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/CartServiceImpl.java`
- [Order processing](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/OrderServiceImpl.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/OrderServiceImpl.java`
- [Admin operations](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AdminServiceImpl.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AdminServiceImpl.java`

### Persistence and integrations

- [User records](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/enitity/User.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/enitity/User.java`
- [User repository](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/repository/UserRepository.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/repository/UserRepository.java`
- [Food and order stores](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/repository/FoodRepository.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/repository/FoodRepository.java`
- [Email delivery](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/email/MailService.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/email/MailService.java`
- [Image storage](https://github.com/harshaprasadreddy13/restaurant-full-stack/blob/main/restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/FileStorageServiceImpl.java): `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/FileStorageServiceImpl.java`

### Other components

- **Customer or admin**

## Connections

- Customer or admin → Web routes: uses
- Web routes → Navigation: renders (evidence: `restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx`)
- Web routes → Login and signup: routes to (evidence: `restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx`)
- Web routes → Food browsing: routes to (evidence: `restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx`)
- Web routes → Cart and checkout: routes to (evidence: `restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx`)
- Web routes → Order history: routes to (evidence: `restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx`)
- Web routes → Admin console: routes to (evidence: `restaurant-frontend-fixed/restaurant-frontend/src/routes/AppRoutes.jsx`)
- Login and signup → Session state: updates session
- Login and signup → HTTP client: submits credentials
- Food browsing → HTTP client: requests food
- Cart and checkout → HTTP client: manages cart
- Order history → HTTP client: requests orders
- Admin console → HTTP client: manages catalog
- HTTP client → Authentication API: HTTP requests
- HTTP client → Food API: HTTP requests
- HTTP client → Cart API: HTTP requests
- HTTP client → Order API: HTTP requests
- HTTP client → Admin API: HTTP requests
- Authentication API → Account and recovery: delegates
- Food API → Food catalog: delegates
- Cart API → Cart management: delegates
- Order API → Order processing: delegates
- Admin API → Admin operations: delegates
- Account and recovery → User repository: reads and writes (evidence: `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AuthServiceImpl.java`)
- Account and recovery → JWT service: creates token (evidence: `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AuthServiceImpl.java`)
- Account and recovery → Email delivery: sends reset OTP (evidence: `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/service/impl/AuthServiceImpl.java`)
- User identity lookup → User repository: looks up user (evidence: `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/security/userDetails/CustomUserDetailsService.java`)
- User repository → User records: loads records (evidence: `restaurant-backend-fixed/restaurant/src/main/java/com/hotel/restaurant/security/userDetails/CustomUserDetailsService.java`)
- Food catalog → Food and order stores: uses catalog
- Cart management → Food and order stores: uses order stores
- Order processing → Food and order stores: uses order stores
- Admin operations → Food and order stores: uses catalog
- Food catalog → Image storage: stores images
