# kny6712/five-orites-scoop-v1 architecture

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

- Interactive diagram: https://gitdiagram.com/kny6712/five-orites-scoop-v1
- Repository: https://github.com/kny6712/five-orites-scoop-v1

## Overview

Five-orites Scoop is an Ionic/Angular storefront and admin console for selling ice cream with live inventory and order tracking. Customers authenticate, browse and select products, build a cart, provide delivery details and an optional voucher, then place an order whose status they can track. Admins manage inventory, fulfill orders and review sales analytics. The README documents client-side stock adjustment and rollback, capped analytics queries and in-app-only notifications; sampled excerpts confirm key service responsibilities, while some feature-page internals were not inspected.

Main entry points: [`src/app/app.routes.ts`](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/app.routes.ts) (Route access), [`src/app/core/services/order.service.ts`](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/order.service.ts) (Order service), [`src/app/core/services/inventory.service.ts`](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/inventory.service.ts) (Inventory service), [`src/app/features/products/product-detail/product-detail.page.ts`](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/products/product-detail/product-detail.page.ts) (Product details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_routes["Route access<br/>[app.routes.ts]"]
  node_authui["Sign-in UI<br/>[auth.page.ts]"]
  node_catalog["Product catalog<br/>[products.page.ts]"]
  node_detail["Product details"]
  node_cartpage["Cart checkout<br/>[cart.page.ts]"]
  node_ordersui["Order history<br/>[orders.page.ts]"]
  node_tracker["Order tracker"]
  node_dashboard["Customer dashboard<br/>[dashboard.page.ts]"]
end

subgraph group_operations["Store operations"]
  node_inventoryui["Inventory manager<br/>[inventory.page.ts]"]
  node_adminorders["Order fulfillment"]
  node_analytics["Sales analytics<br/>[analytics.page.ts]"]
end

subgraph group_domain["Domain services"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_cart["Cart state<br/>[cart.service.ts]"]
  node_inventory["Inventory service"]
  node_order["Order service<br/>[order.service.ts]"]
  node_voucher["Voucher service<br/>[voucher.service.ts]"]
  node_address["Address book<br/>[address.service.ts]"]
  node_wishlist["Wishlist"]
  node_reviews["Product reviews<br/>[review.service.ts]"]
  node_notifications["Notifications"]
  node_pricing["Pricing matrix<br/>[pricing.config.ts]"]
  node_models["Order and product models<br/>[order.model.ts]"]
end

subgraph group_firebase["Firebase data"]
  node_firebaseauth(("Firebase Auth"))
  node_firestore[("Cloud Firestore")]
end

node_customer(("Customer"))
node_admin(("Admin"))

node_customer -->|"opens app"| node_routes
node_admin -->|"opens app"| node_routes
node_routes -->|"routes to"| node_authui
node_routes -->|"routes to"| node_catalog
node_routes -->|"routes to"| node_detail
node_routes -->|"routes to"| node_cartpage
node_routes -->|"routes to"| node_ordersui
node_routes -->|"routes to"| node_tracker
node_routes -->|"routes to"| node_dashboard
node_routes -->|"admin route"| node_inventoryui
node_routes -->|"admin route"| node_adminorders
node_routes -->|"admin route"| node_analytics
node_authui -->|"uses"| node_auth
node_catalog -->|"loads products"| node_inventory
node_catalog -->|"uses"| node_wishlist
node_detail -->|"loads product"| node_inventory
node_detail -->|"adds item"| node_cart
node_detail -->|"uses"| node_reviews
node_detail -->|"uses"| node_wishlist
node_cartpage -->|"edits cart"| node_cart
node_cartpage -->|"places order"| node_order
node_cartpage -->|"uses"| node_address
node_cartpage -->|"checks voucher"| node_voucher
node_ordersui -->|"loads orders"| node_order
node_tracker -.->|"tracks order"| node_order
node_adminorders -->|"updates orders"| node_order
node_adminorders -->|"invokes"| node_notifications
node_inventoryui -.->|"manages stock"| node_inventory
node_analytics -.->|"reads order totals"| node_order
node_dashboard -->|"reads user"| node_auth
node_dashboard -->|"loads stock"| node_inventory
node_dashboard -->|"loads totals"| node_order
node_order -->|"clears after order"| node_cart
node_order -.->|"adjusts stock"| node_inventory
node_order -.->|"resolves code"| node_voucher
node_order -->|"gets prices"| node_pricing
node_order -->|"creates orders"| node_models
node_auth -->|"authenticates"| node_firebaseauth
node_auth -->|"reads user profile"| node_firestore
node_inventory -->|"reads and writes"| node_firestore
node_order -->|"reads and writes"| node_firestore
node_reviews -->|"reads and writes"| node_firestore
node_voucher -.->|"resolves voucher"| node_firestore
node_notifications -.->|"shows in-app notice"| node_customer

click node_routes "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/app.routes.ts"
click node_authui "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/auth/auth.page.ts"
click node_catalog "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/products/products.page.ts"
click node_detail "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/products/product-detail/product-detail.page.ts"
click node_cartpage "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/cart/cart.page.ts"
click node_ordersui "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/orders/orders.page.ts"
click node_tracker "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/orders/order-tracker/order-tracker.page.ts"
click node_dashboard "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/dashboard/dashboard.page.ts"
click node_inventoryui "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/admin/inventory/inventory.page.ts"
click node_adminorders "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/admin/orders/admin-orders.page.ts"
click node_analytics "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/admin/analytics/analytics.page.ts"
click node_auth "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/auth.service.ts"
click node_cart "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/cart.service.ts"
click node_inventory "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/inventory.service.ts"
click node_order "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/order.service.ts"
click node_voucher "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/voucher.service.ts"
click node_address "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/address.service.ts"
click node_wishlist "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/wishlist.service.ts"
click node_reviews "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/review.service.ts"
click node_notifications "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/notification.service.ts"
click node_pricing "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/config/pricing.config.ts"
click node_models "https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/models/order.model.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_routes,node_authui,node_catalog,node_detail,node_cartpage,node_ordersui,node_tracker,node_dashboard toneBlue
class node_inventoryui,node_adminorders,node_analytics toneAmber
class node_auth,node_cart,node_inventory,node_order,node_voucher,node_address,node_wishlist,node_reviews,node_notifications,node_pricing,node_models toneMint
class node_firebaseauth,node_firestore toneRose
class node_customer,node_admin toneIndigo
```

## Components

### Customer storefront

- [Route access](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Sign-in UI](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/auth/auth.page.ts): `src/app/features/auth/auth.page.ts`
- [Product catalog](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/products/products.page.ts): `src/app/features/products/products.page.ts`
- [Product details](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/products/product-detail/product-detail.page.ts): `src/app/features/products/product-detail/product-detail.page.ts`
- [Cart checkout](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/cart/cart.page.ts): `src/app/features/cart/cart.page.ts`
- [Order history](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/orders/orders.page.ts): `src/app/features/orders/orders.page.ts`
- [Order tracker](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/orders/order-tracker/order-tracker.page.ts): `src/app/features/orders/order-tracker/order-tracker.page.ts`
- [Customer dashboard](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/features/dashboard/dashboard.page.ts): `src/app/features/dashboard/dashboard.page.ts`

### Store operations

- [Inventory manager](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/admin/inventory/inventory.page.ts): `src/app/admin/inventory/inventory.page.ts`
- [Order fulfillment](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/admin/orders/admin-orders.page.ts): `src/app/admin/orders/admin-orders.page.ts`
- [Sales analytics](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/admin/analytics/analytics.page.ts): `src/app/admin/analytics/analytics.page.ts`

### Domain services

- [Authentication](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/auth.service.ts): `src/app/core/services/auth.service.ts`
- [Cart state](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/cart.service.ts): `src/app/core/services/cart.service.ts`
- [Inventory service](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/inventory.service.ts): `src/app/core/services/inventory.service.ts`
- [Order service](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/order.service.ts): `src/app/core/services/order.service.ts`
- [Voucher service](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/voucher.service.ts): `src/app/core/services/voucher.service.ts`
- [Address book](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/address.service.ts): `src/app/core/services/address.service.ts`
- [Wishlist](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/wishlist.service.ts): `src/app/core/services/wishlist.service.ts`
- [Product reviews](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/review.service.ts): `src/app/core/services/review.service.ts`
- [Notifications](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/services/notification.service.ts): `src/app/core/services/notification.service.ts`
- [Pricing matrix](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/config/pricing.config.ts): `src/app/core/config/pricing.config.ts`
- [Order and product models](https://github.com/kny6712/five-orites-scoop-v1/blob/main/src/app/core/models/order.model.ts): `src/app/core/models/order.model.ts`

### Firebase data

- **Firebase Auth**
- **Cloud Firestore**

### Other components

- **Customer**
- **Admin**

## Connections

- Customer → Route access: opens app
- Admin → Route access: opens app
- Route access → Sign-in UI: routes to (evidence: `src/app/app.routes.ts`)
- Route access → Product catalog: routes to (evidence: `src/app/app.routes.ts`)
- Route access → Product details: routes to (evidence: `src/app/app.routes.ts`)
- Route access → Cart checkout: routes to (evidence: `src/app/app.routes.ts`)
- Route access → Order history: routes to (evidence: `src/app/app.routes.ts`)
- Route access → Order tracker: routes to (evidence: `src/app/app.routes.ts`)
- Route access → Customer dashboard: routes to (evidence: `src/app/app.routes.ts`)
- Route access → Inventory manager: admin route (evidence: `src/app/app.routes.ts`)
- Route access → Order fulfillment: admin route (evidence: `src/app/app.routes.ts`)
- Route access → Sales analytics: admin route (evidence: `src/app/app.routes.ts`)
- Sign-in UI → Authentication: uses (evidence: `src/app/features/auth/auth.page.ts`)
- Product catalog → Inventory service: loads products (evidence: `src/app/features/products/products.page.ts`)
- Product catalog → Wishlist: uses (evidence: `src/app/features/products/products.page.ts`)
- Product details → Inventory service: loads product (evidence: `src/app/features/products/product-detail/product-detail.page.ts`)
- Product details → Cart state: adds item (evidence: `src/app/features/products/product-detail/product-detail.page.ts`)
- Product details → Product reviews: uses (evidence: `src/app/features/products/product-detail/product-detail.page.ts`)
- Product details → Wishlist: uses (evidence: `src/app/features/products/product-detail/product-detail.page.ts`)
- Cart checkout → Cart state: edits cart (evidence: `src/app/features/cart/cart.page.ts`)
- Cart checkout → Order service: places order (evidence: `src/app/features/cart/cart.page.ts`)
- Cart checkout → Address book: uses (evidence: `src/app/features/cart/cart.page.ts`)
- Cart checkout → Voucher service: checks voucher (evidence: `src/app/features/cart/cart.page.ts`)
- Order history → Order service: loads orders (evidence: `src/app/features/orders/orders.page.ts`)
- Order tracker → Order service: tracks order
- Order fulfillment → Order service: updates orders (evidence: `src/app/admin/orders/admin-orders.page.ts`)
- Order fulfillment → Notifications: invokes (evidence: `src/app/admin/orders/admin-orders.page.ts`)
- Inventory manager → Inventory service: manages stock
- Sales analytics → Order service: reads order totals
- Customer dashboard → Authentication: reads user (evidence: `src/app/features/dashboard/dashboard.page.ts`)
- Customer dashboard → Inventory service: loads stock (evidence: `src/app/features/dashboard/dashboard.page.ts`)
- Customer dashboard → Order service: loads totals (evidence: `src/app/features/dashboard/dashboard.page.ts`)
- Order service → Cart state: clears after order (evidence: `src/app/core/services/order.service.ts`)
- Order service → Inventory service: adjusts stock (evidence: `src/app/core/services/order.service.ts`)
- Order service → Voucher service: resolves code (evidence: `src/app/core/services/order.service.ts`)
- Order service → Pricing matrix: gets prices (evidence: `src/app/core/services/order.service.ts`)
- Order service → Order and product models: creates orders (evidence: `src/app/core/services/order.service.ts`)
- Authentication → Firebase Auth: authenticates (evidence: `src/app/core/services/auth.service.ts`)
- Authentication → Cloud Firestore: reads user profile (evidence: `src/app/core/services/auth.service.ts`)
- Inventory service → Cloud Firestore: reads and writes (evidence: `src/app/core/services/inventory.service.ts`)
- Order service → Cloud Firestore: reads and writes (evidence: `src/app/core/services/order.service.ts`)
- Product reviews → Cloud Firestore: reads and writes (evidence: `src/app/core/services/review.service.ts`)
- Voucher service → Cloud Firestore: resolves voucher
- Notifications → Customer: shows in-app notice
