# thanakorn-tata/finalnumprig architecture

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

- Interactive diagram: https://gitdiagram.com/thanakorn-tata/finalnumprig
- Repository: https://github.com/thanakorn-tata/finalnumprig

## Overview

Numprig is an Angular storefront with customer accounts, a shopping cart, checkout and order receipts, plus an admin area for products, users, reports and dashboard data. The customer workflow runs from browsing active products through adding items to the cart, authenticated checkout and slip upload, then viewing a receipt. The sampled sources show service calls and route wiring; several admin and result screens are represented from the route map and source index, so their internal behavior is not expanded.

Main entry points: [`src/app/app.routes.ts`](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/app.routes.ts) (Routes), [`src/app/auth/auth.service.ts`](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/auth.service.ts) (Authentication service), [`src/app/homepage/homepage.component.ts`](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/homepage/homepage.component.ts) (Product browsing), [`src/app/checkout/checkout.component.ts`](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/checkout/checkout.component.ts) (Checkout & payment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_homepage["Product browsing"]
end

subgraph group_commerce["Cart &amp; Checkout"]
  node_cart["Cart UI<br/>[cart.component.ts]"]
  node_cart_service["Cart service<br/>[cart.service.ts]"]
  node_cart_model["Cart model<br/>[cart.model.ts]"]
  node_checkout["Checkout &amp; payment"]
  node_receipt["Order receipt"]
end

subgraph group_identity["Identity"]
  node_auth_service["Authentication service<br/>[auth.service.ts]"]
  node_login["Login<br/>[login.component.ts]"]
  node_register["Registration"]
  node_auth_guard["Login guard<br/>[auth.guard.ts]"]
  node_admin_guard["Admin guard<br/>[admin.guard.ts]"]
  node_profile["User profile"]
end

subgraph group_administration["Administration"]
  node_admin_dashboard["Admin dashboard"]
  node_product_management["Product management"]
  node_excel_export["Product export"]
  node_admin_users["User administration"]
  node_admin_reports["Admin reports"]
end

subgraph group_shared["Shared Services"]
  node_routes["Routes<br/>[app.routes.ts]"]
  node_product_model["Product model<br/>[product.model.ts]"]
  node_product_service["Product API service<br/>[product.service.ts]"]
end

node_customer(("Customer"))
node_backend{{"Application API"}}

node_customer -->|"opens pages"| node_routes
node_routes -->|"routes to"| node_homepage
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_register
node_routes -->|"routes to"| node_profile
node_routes -->|"routes to"| node_checkout
node_routes -->|"routes to"| node_receipt
node_routes -->|"guards access"| node_auth_guard
node_routes -->|"guards access"| node_admin_guard
node_routes -->|"routes to"| node_admin_dashboard
node_routes -->|"routes to"| node_product_management
node_routes -->|"routes to"| node_admin_users
node_routes -->|"routes to"| node_admin_reports
node_homepage -->|"loads products"| node_product_service
node_homepage -->|"checks identity"| node_auth_service
node_homepage -->|"adds items"| node_cart_service
node_homepage -->|"uses product data"| node_product_model
node_product_service -->|"requests products"| node_backend
node_product_management -->|"manages products"| node_product_service
node_product_management -->|"exports products"| node_excel_export
node_excel_export -->|"formats products"| node_product_model
node_admin_dashboard -->|"loads product data"| node_product_service
node_cart -->|"uses cart"| node_cart_service
node_cart -->|"uses cart data"| node_cart_model
node_cart_service -->|"uses cart data"| node_cart_model
node_cart_service -->|"requests cart"| node_backend
node_checkout -->|"loads cart"| node_cart_service
node_checkout -->|"uses cart data"| node_cart_model
node_checkout -->|"submits order"| node_backend
node_checkout -->|"navigates to"| node_receipt
node_login -->|"authenticates"| node_auth_service
node_register -->|"registers account"| node_auth_service
node_auth_guard -->|"checks login"| node_auth_service
node_admin_guard -->|"checks role"| node_auth_service
node_auth_service -->|"auth requests"| node_backend
node_profile -->|"uses identity"| node_auth_service

click node_routes "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/app.routes.ts"
click node_homepage "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/homepage/homepage.component.ts"
click node_product_model "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/product/product.model.ts"
click node_product_service "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/product/product.service.ts"
click node_cart "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/cart/cart.component.ts"
click node_cart_service "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/cart/cart.service.ts"
click node_cart_model "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/cart/cart.model.ts"
click node_checkout "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/checkout/checkout.component.ts"
click node_receipt "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/receipt/receipt.component.ts"
click node_auth_service "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/auth.service.ts"
click node_login "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/login/login.component.ts"
click node_register "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/register/register.component.ts"
click node_auth_guard "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/auth.guard.ts"
click node_admin_guard "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/admin.guard.ts"
click node_profile "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/profile/profile.component.ts"
click node_admin_dashboard "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/admin/admin-dashboard/admin-dashboard.component.ts"
click node_product_management "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/product/product-management/product-management.component.ts"
click node_excel_export "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/product/export-excel.service.ts"
click node_admin_users "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/admin/admin-users/admin-users.component.ts"
click node_admin_reports "https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/admin/admin-reports/admin-reports.component.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_homepage toneBlue
class node_cart,node_cart_service,node_cart_model,node_checkout,node_receipt toneAmber
class node_auth_service,node_login,node_register,node_auth_guard,node_admin_guard,node_profile,node_backend toneMint
class node_admin_dashboard,node_product_management,node_excel_export,node_admin_users,node_admin_reports toneRose
class node_routes,node_product_model,node_product_service,node_customer toneIndigo
```

## Components

### Storefront

- [Product browsing](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/homepage/homepage.component.ts): `src/app/homepage/homepage.component.ts`

### Cart & Checkout

- [Cart UI](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/cart/cart.component.ts): `src/app/cart/cart.component.ts`
- [Cart service](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/cart/cart.service.ts): `src/app/cart/cart.service.ts`
- [Cart model](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/cart/cart.model.ts): `src/app/cart/cart.model.ts`
- [Checkout & payment](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/checkout/checkout.component.ts): `src/app/checkout/checkout.component.ts`
- [Order receipt](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/receipt/receipt.component.ts): `src/app/receipt/receipt.component.ts`

### Identity

- [Authentication service](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/auth.service.ts): `src/app/auth/auth.service.ts`
- [Login](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/login/login.component.ts): `src/app/auth/login/login.component.ts`
- [Registration](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/register/register.component.ts): `src/app/auth/register/register.component.ts`
- [Login guard](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/auth.guard.ts): `src/app/auth/auth.guard.ts`
- [Admin guard](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/auth/admin.guard.ts): `src/app/auth/admin.guard.ts`
- [User profile](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/profile/profile.component.ts): `src/app/profile/profile.component.ts`

### Administration

- [Admin dashboard](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/admin/admin-dashboard/admin-dashboard.component.ts): `src/app/admin/admin-dashboard/admin-dashboard.component.ts`
- [Product management](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/product/product-management/product-management.component.ts): `src/app/product/product-management/product-management.component.ts`
- [Product export](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/product/export-excel.service.ts): `src/app/product/export-excel.service.ts`
- [User administration](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/admin/admin-users/admin-users.component.ts): `src/app/admin/admin-users/admin-users.component.ts`
- [Admin reports](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/admin/admin-reports/admin-reports.component.ts): `src/app/admin/admin-reports/admin-reports.component.ts`

### Shared Services

- [Routes](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Product model](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/product/product.model.ts): `src/app/product/product.model.ts`
- [Product API service](https://github.com/thanakorn-tata/finalnumprig/blob/main/src/app/product/product.service.ts): `src/app/product/product.service.ts`

### Other components

- **Customer**
- **Application API**

## Connections

- Customer → Routes: opens pages (evidence: `src/app/app.routes.ts`)
- Routes → Product browsing: routes to (evidence: `src/app/app.routes.ts`)
- Routes → Login: routes to (evidence: `src/app/app.routes.ts`)
- Routes → Registration: routes to (evidence: `src/app/app.routes.ts`)
- Routes → User profile: routes to (evidence: `src/app/app.routes.ts`)
- Routes → Checkout & payment: routes to (evidence: `src/app/app.routes.ts`)
- Routes → Order receipt: routes to (evidence: `src/app/app.routes.ts`)
- Routes → Login guard: guards access (evidence: `src/app/app.routes.ts`)
- Routes → Admin guard: guards access (evidence: `src/app/app.routes.ts`)
- Routes → Admin dashboard: routes to (evidence: `src/app/app.routes.ts`)
- Routes → Product management: routes to (evidence: `src/app/app.routes.ts`)
- Routes → User administration: routes to (evidence: `src/app/app.routes.ts`)
- Routes → Admin reports: routes to (evidence: `src/app/app.routes.ts`)
- Product browsing → Product API service: loads products (evidence: `src/app/homepage/homepage.component.ts`)
- Product browsing → Authentication service: checks identity (evidence: `src/app/homepage/homepage.component.ts`)
- Product browsing → Cart service: adds items (evidence: `src/app/homepage/homepage.component.ts`)
- Product browsing → Product model: uses product data (evidence: `src/app/homepage/homepage.component.ts`)
- Product API service → Application API: requests products (evidence: `src/app/product/product.service.ts`)
- Product management → Product API service: manages products (evidence: `src/app/product/product-management/product-management.component.ts`)
- Product management → Product export: exports products (evidence: `src/app/product/product-management/product-management.component.ts`)
- Product export → Product model: formats products (evidence: `src/app/product/export-excel.service.ts`)
- Admin dashboard → Product API service: loads product data (evidence: `src/app/admin/admin-dashboard/admin-dashboard.component.ts`)
- Cart UI → Cart service: uses cart (evidence: `src/app/cart/cart.component.ts`)
- Cart UI → Cart model: uses cart data (evidence: `src/app/cart/cart.component.ts`)
- Cart service → Cart model: uses cart data (evidence: `src/app/cart/cart.service.ts`)
- Cart service → Application API: requests cart (evidence: `src/app/cart/cart.service.ts`)
- Checkout & payment → Cart service: loads cart (evidence: `src/app/checkout/checkout.component.ts`)
- Checkout & payment → Cart model: uses cart data (evidence: `src/app/checkout/checkout.component.ts`)
- Checkout & payment → Application API: submits order (evidence: `src/app/checkout/checkout.component.ts`)
- Checkout & payment → Order receipt: navigates to (evidence: `src/app/checkout/checkout.component.ts`)
- Login → Authentication service: authenticates (evidence: `src/app/auth/login/login.component.ts`)
- Registration → Authentication service: registers account (evidence: `src/app/auth/register/register.component.ts`)
- Login guard → Authentication service: checks login (evidence: `src/app/auth/auth.guard.ts`)
- Admin guard → Authentication service: checks role (evidence: `src/app/auth/admin.guard.ts`)
- Authentication service → Application API: auth requests (evidence: `src/app/auth/auth.service.ts`)
- User profile → Authentication service: uses identity (evidence: `src/app/profile/profile.component.ts`)
