# monalisonalkar2006/surtwala-canteen-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/monalisonalkar2006/surtwala-canteen-frontend
- Repository: https://github.com/monalisonalkar2006/surtwala-canteen-frontend

## Overview

SurtwalaCanteen is an Angular canteen-ordering application with customer, admin, and staff areas. The visible customer journey runs from browsing food to managing a cart and checkout, with separate order, favorites, and review views. Authentication uses mock login and browser storage in the sampled service; the routes gate role-specific areas. Admin and staff capabilities are preserved as routed feature areas. Some feature-to-service links and backend behavior are not shown in the excerpts, so those relationships are omitted rather than inferred.

Main entry points: [`src/app/app.routes.ts`](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/app.routes.ts) (Role routes), [`src/app/core/services/cart.service.ts`](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/cart.service.ts) (Cart state), [`src/app/features/auth/login/login.component.ts`](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/auth/login/login.component.ts) (Login), [`src/app/features/auth/register/register.component.ts`](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/auth/register/register.component.ts) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application Entry"]
  node_app["App shell<br/>[app.ts]"]
  node_routing["Role routes<br/>[app.routes.ts]"]
end

subgraph group_identity["Identity &amp; Access"]
  node_login["Login<br/>[login.component.ts]"]
  node_register["Registration"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_guard["Auth guard<br/>[auth.guard.ts]"]
end

subgraph group_customer["Customer Ordering"]
  node_home["Home &amp; discovery<br/>[home.component.ts]"]
  node_menu["Food menu<br/>[menu.component.ts]"]
  node_cartview["Cart view<br/>[cart.component.ts]"]
  node_checkout["Checkout"]
  node_orders["Customer orders"]
  node_favorites["Favorites"]
  node_reviews["Customer reviews"]
end

subgraph group_operations["Canteen Operations"]
  node_admin["Admin features"]
  node_staff["Staff features"]
end

subgraph group_shared["Shared Services"]
  node_cartservice["Cart state<br/>[cart.service.ts]"]
  node_menuapi["Menu service<br/>[menu.service.ts]"]
  node_ordersapi["Order service<br/>[order.service.ts]"]
  node_reviewapi["Review service<br/>[review.service.ts]"]
  node_notifications["Notifications"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"hosts routes"| node_routing
node_routing -->|"routes to"| node_login
node_routing -->|"routes to"| node_register
node_login -->|"uses"| node_auth
node_register -->|"uses"| node_auth
node_routing -->|"guards access"| node_guard
node_guard -->|"checks identity"| node_auth
node_routing -->|"routes to"| node_home
node_routing -->|"routes to"| node_menu
node_routing -->|"routes to"| node_cartview
node_routing -->|"routes to"| node_checkout
node_routing -->|"routes to"| node_orders
node_routing -->|"routes to"| node_favorites
node_routing -->|"routes to"| node_reviews
node_routing -->|"routes to"| node_admin
node_routing -->|"routes to"| node_staff
node_home -->|"adds food"| node_cartservice
node_menu -->|"adds food"| node_cartservice
node_cartview -->|"manages cart"| node_cartservice
node_checkout -->|"reads cart"| node_cartservice
node_login -->|"notifies"| node_notifications
node_register -->|"notifies"| node_notifications
node_cartview -->|"notifies"| node_notifications

click node_app "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/app.ts"
click node_routing "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/app.routes.ts"
click node_login "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/auth/login/login.component.ts"
click node_register "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/auth/register/register.component.ts"
click node_auth "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/auth.service.ts"
click node_guard "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/guards/auth.guard.ts"
click node_home "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/home/home.component.ts"
click node_menu "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/menu/menu.component.ts"
click node_cartview "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/cart/cart.component.ts"
click node_checkout "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/checkout/checkout.component.ts"
click node_orders "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/orders/orders.component.ts"
click node_favorites "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/favorites/favorites.component.ts"
click node_reviews "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/reviews/reviews.component.ts"
click node_cartservice "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/cart.service.ts"
click node_menuapi "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/menu.service.ts"
click node_ordersapi "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/order.service.ts"
click node_reviewapi "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/review.service.ts"
click node_admin "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/tree/main/src/app/features/admin"
click node_staff "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/tree/main/src/app/features/staff"
click node_notifications "https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/notification.service.ts"

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_routing,node_user toneBlue
class node_login,node_register,node_auth,node_guard toneAmber
class node_home,node_menu,node_cartview,node_checkout,node_orders,node_favorites,node_reviews toneMint
class node_admin,node_staff toneRose
class node_cartservice,node_menuapi,node_ordersapi,node_reviewapi,node_notifications toneIndigo
```

## Components

### Application Entry

- [App shell](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/app.ts): `src/app/app.ts`
- [Role routes](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`

### Identity & Access

- [Login](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/auth/login/login.component.ts): `src/app/features/auth/login/login.component.ts`
- [Registration](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/auth/register/register.component.ts): `src/app/features/auth/register/register.component.ts`
- [Authentication](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/auth.service.ts): `src/app/core/services/auth.service.ts`
- [Auth guard](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/guards/auth.guard.ts): `src/app/core/guards/auth.guard.ts`

### Customer Ordering

- [Home & discovery](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/home/home.component.ts): `src/app/features/customer/home/home.component.ts`
- [Food menu](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/menu/menu.component.ts): `src/app/features/customer/menu/menu.component.ts`
- [Cart view](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/cart/cart.component.ts): `src/app/features/customer/cart/cart.component.ts`
- [Checkout](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/checkout/checkout.component.ts): `src/app/features/customer/checkout/checkout.component.ts`
- [Customer orders](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/orders/orders.component.ts): `src/app/features/customer/orders/orders.component.ts`
- [Favorites](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/favorites/favorites.component.ts): `src/app/features/customer/favorites/favorites.component.ts`
- [Customer reviews](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/features/customer/reviews/reviews.component.ts): `src/app/features/customer/reviews/reviews.component.ts`

### Canteen Operations

- [Admin features](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/tree/main/src/app/features/admin): `src/app/features/admin`
- [Staff features](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/tree/main/src/app/features/staff): `src/app/features/staff`

### Shared Services

- [Cart state](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/cart.service.ts): `src/app/core/services/cart.service.ts`
- [Menu service](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/menu.service.ts): `src/app/core/services/menu.service.ts`
- [Order service](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/order.service.ts): `src/app/core/services/order.service.ts`
- [Review service](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/review.service.ts): `src/app/core/services/review.service.ts`
- [Notifications](https://github.com/monalisonalkar2006/surtwala-canteen-frontend/blob/main/src/app/core/services/notification.service.ts): `src/app/core/services/notification.service.ts`

### Other components

- **User**

## Connections

- User → App shell: opens (evidence: `src/app/app.ts`)
- App shell → Role routes: hosts routes (evidence: `src/app/app.ts`)
- Role routes → Login: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Registration: routes to (evidence: `src/app/app.routes.ts`)
- Login → Authentication: uses (evidence: `src/app/features/auth/login/login.component.ts`)
- Registration → Authentication: uses (evidence: `src/app/features/auth/register/register.component.ts`)
- Role routes → Auth guard: guards access (evidence: `src/app/app.routes.ts`)
- Auth guard → Authentication: checks identity (evidence: `src/app/core/guards/auth.guard.ts`)
- Role routes → Home & discovery: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Food menu: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Cart view: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Checkout: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Customer orders: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Favorites: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Customer reviews: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Admin features: routes to (evidence: `src/app/app.routes.ts`)
- Role routes → Staff features: routes to (evidence: `src/app/app.routes.ts`)
- Home & discovery → Cart state: adds food (evidence: `src/app/features/customer/home/home.component.ts`)
- Food menu → Cart state: adds food (evidence: `src/app/features/customer/menu/menu.component.ts`)
- Cart view → Cart state: manages cart (evidence: `src/app/features/customer/cart/cart.component.ts`)
- Checkout → Cart state: reads cart (evidence: `src/app/features/customer/checkout/checkout.component.ts`)
- Login → Notifications: notifies (evidence: `src/app/features/auth/login/login.component.ts`)
- Registration → Notifications: notifies (evidence: `src/app/features/auth/register/register.component.ts`)
- Cart view → Notifications: notifies (evidence: `src/app/features/customer/cart/cart.component.ts`)
