# anhtuans-project/cotvian architecture

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

- Interactive diagram: https://gitdiagram.com/anhtuans-project/cotvian
- Repository: https://github.com/anhtuans-project/cotvian

## Overview

This is a React storefront and operations portal for regional fish-sauce products, with product discovery, customization, checkout, traceability, and separate administrative workflows. Browser navigation enters through the app shell; route components provide the user-facing stages. Operational pages share a batch model and detail view, while product pages use a local product catalog. The excerpts show authentication submitting to an API, but do not establish persistence or backend connections for the other workflows.

Main entry points: [`app/src/App.tsx`](https://github.com/anhtuans-project/cotvian/blob/main/app/src/App.tsx) (App router), [`app/src/data/products.ts`](https://github.com/anhtuans-project/cotvian/blob/main/app/src/data/products.ts) (Product catalog data), [`app/src/pages/DataEntryAdmin.tsx`](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/DataEntryAdmin.tsx) (Batch data entry), [`app/src/pages/ProductionManager.tsx`](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/ProductionManager.tsx) (Production review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["App router<br/>[App.tsx]"]
  node_navbar["Navigation and sign-in<br/>[Navbar.tsx]"]
  node_footer["Site footer<br/>[Footer.tsx]"]
end

subgraph group_storefront["Customer storefront"]
  node_home["Product discovery<br/>[Home.tsx]"]
  node_product["Product details<br/>[ProductDetail.tsx]"]
  node_compare["Product comparison<br/>[Compare.tsx]"]
  node_customize["Product customization<br/>[Customize.tsx]"]
  node_checkout["Checkout<br/>[Checkout.tsx]"]
  node_success["Order confirmation<br/>[OrderSuccess.tsx]"]
  node_profile["Customer profile<br/>[Profile.tsx]"]
  node_traceability["Product traceability<br/>[Traceability.tsx]"]
  node_distributors["Distributor directory<br/>[Distributors.tsx]"]
  node_blog["Articles<br/>[Blog.tsx]"]
  node_blogdetail["Article detail<br/>[BlogDetail.tsx]"]
end

subgraph group_operations["Operations portal"]
  node_admin["Store administration<br/>[Admin.tsx]"]
  node_dataentry["Batch data entry<br/>[DataEntryAdmin.tsx]"]
  node_production["Production review"]
  node_warehouse["Warehouse and orders<br/>[WarehouseAdmin.tsx]"]
end

subgraph group_shared["Shared domain components"]
  node_catalog["Product catalog data<br/>[products.ts]"]
  node_batchmodel["Batch record model<br/>[batch.ts]"]
  node_batchdetails["Batch detail view"]
  node_authmodal["Authentication form<br/>[AuthModal.tsx]"]
end

node_browser(("Web visitor"))
node_authapi{{"Authentication API"}}

node_browser -->|"opens"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_product
node_app -->|"routes to"| node_compare
node_app -->|"routes to"| node_customize
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_success
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_traceability
node_app -->|"routes to"| node_distributors
node_app -->|"routes to"| node_blog
node_app -->|"routes to"| node_blogdetail
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_dataentry
node_app -->|"routes to"| node_production
node_app -->|"routes to"| node_warehouse
node_navbar -->|"opens"| node_authmodal
node_authmodal -->|"posts credentials"| node_authapi
node_home -->|"reads"| node_catalog
node_product -->|"reads"| node_catalog
node_compare -->|"reads"| node_catalog
node_traceability -->|"reads"| node_catalog
node_distributors -->|"reads"| node_catalog
node_dataentry -->|"uses"| node_batchmodel
node_production -->|"uses"| node_batchmodel
node_warehouse -->|"uses"| node_batchmodel
node_dataentry -->|"renders"| node_batchdetails
node_production -->|"renders"| node_batchdetails
node_warehouse -->|"renders"| node_batchdetails

click node_app "https://github.com/anhtuans-project/cotvian/blob/main/app/src/App.tsx"
click node_navbar "https://github.com/anhtuans-project/cotvian/blob/main/app/src/components/Navbar.tsx"
click node_footer "https://github.com/anhtuans-project/cotvian/blob/main/app/src/components/Footer.tsx"
click node_home "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Home.tsx"
click node_product "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/ProductDetail.tsx"
click node_compare "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Compare.tsx"
click node_customize "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Customize.tsx"
click node_checkout "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Checkout.tsx"
click node_success "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/OrderSuccess.tsx"
click node_profile "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Profile.tsx"
click node_traceability "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Traceability.tsx"
click node_distributors "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Distributors.tsx"
click node_blog "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Blog.tsx"
click node_blogdetail "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/BlogDetail.tsx"
click node_admin "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Admin.tsx"
click node_dataentry "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/DataEntryAdmin.tsx"
click node_production "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/ProductionManager.tsx"
click node_warehouse "https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/WarehouseAdmin.tsx"
click node_catalog "https://github.com/anhtuans-project/cotvian/blob/main/app/src/data/products.ts"
click node_batchmodel "https://github.com/anhtuans-project/cotvian/blob/main/app/src/types/batch.ts"
click node_batchdetails "https://github.com/anhtuans-project/cotvian/blob/main/app/src/components/BatchDetailsModal.tsx"
click node_authmodal "https://github.com/anhtuans-project/cotvian/blob/main/app/src/components/AuthModal.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_navbar,node_footer toneBlue
class node_home,node_product,node_compare,node_customize,node_checkout,node_success,node_profile,node_traceability,node_distributors,node_blog,node_blogdetail toneAmber
class node_admin,node_dataentry,node_production,node_warehouse,node_authapi toneMint
class node_catalog,node_batchmodel,node_batchdetails,node_authmodal toneRose
class node_browser toneIndigo
```

## Components

### Application shell

- [App router](https://github.com/anhtuans-project/cotvian/blob/main/app/src/App.tsx): `app/src/App.tsx`
- [Navigation and sign-in](https://github.com/anhtuans-project/cotvian/blob/main/app/src/components/Navbar.tsx): `app/src/components/Navbar.tsx`
- [Site footer](https://github.com/anhtuans-project/cotvian/blob/main/app/src/components/Footer.tsx): `app/src/components/Footer.tsx`

### Customer storefront

- [Product discovery](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Home.tsx): `app/src/pages/Home.tsx`
- [Product details](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/ProductDetail.tsx): `app/src/pages/ProductDetail.tsx`
- [Product comparison](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Compare.tsx): `app/src/pages/Compare.tsx`
- [Product customization](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Customize.tsx): `app/src/pages/Customize.tsx`
- [Checkout](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Checkout.tsx): `app/src/pages/Checkout.tsx`
- [Order confirmation](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/OrderSuccess.tsx): `app/src/pages/OrderSuccess.tsx`
- [Customer profile](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Profile.tsx): `app/src/pages/Profile.tsx`
- [Product traceability](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Traceability.tsx): `app/src/pages/Traceability.tsx`
- [Distributor directory](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Distributors.tsx): `app/src/pages/Distributors.tsx`
- [Articles](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Blog.tsx): `app/src/pages/Blog.tsx`
- [Article detail](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/BlogDetail.tsx): `app/src/pages/BlogDetail.tsx`

### Operations portal

- [Store administration](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/Admin.tsx): `app/src/pages/Admin.tsx`
- [Batch data entry](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/DataEntryAdmin.tsx): `app/src/pages/DataEntryAdmin.tsx`
- [Production review](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/ProductionManager.tsx): `app/src/pages/ProductionManager.tsx`
- [Warehouse and orders](https://github.com/anhtuans-project/cotvian/blob/main/app/src/pages/WarehouseAdmin.tsx): `app/src/pages/WarehouseAdmin.tsx`

### Shared domain components

- [Product catalog data](https://github.com/anhtuans-project/cotvian/blob/main/app/src/data/products.ts): `app/src/data/products.ts`
- [Batch record model](https://github.com/anhtuans-project/cotvian/blob/main/app/src/types/batch.ts): `app/src/types/batch.ts`
- [Batch detail view](https://github.com/anhtuans-project/cotvian/blob/main/app/src/components/BatchDetailsModal.tsx): `app/src/components/BatchDetailsModal.tsx`
- [Authentication form](https://github.com/anhtuans-project/cotvian/blob/main/app/src/components/AuthModal.tsx): `app/src/components/AuthModal.tsx`

### Other components

- **Web visitor**
- **Authentication API**

## Connections

- Web visitor → App router: opens
- App router → Navigation and sign-in: renders (evidence: `app/src/App.tsx`)
- App router → Site footer: renders (evidence: `app/src/App.tsx`)
- App router → Product discovery: routes to (evidence: `app/src/App.tsx`)
- App router → Product details: routes to (evidence: `app/src/App.tsx`)
- App router → Product comparison: routes to (evidence: `app/src/App.tsx`)
- App router → Product customization: routes to (evidence: `app/src/App.tsx`)
- App router → Checkout: routes to (evidence: `app/src/App.tsx`)
- App router → Order confirmation: routes to (evidence: `app/src/App.tsx`)
- App router → Customer profile: routes to (evidence: `app/src/App.tsx`)
- App router → Product traceability: routes to (evidence: `app/src/App.tsx`)
- App router → Distributor directory: routes to (evidence: `app/src/App.tsx`)
- App router → Articles: routes to (evidence: `app/src/App.tsx`)
- App router → Article detail: routes to (evidence: `app/src/App.tsx`)
- App router → Store administration: routes to (evidence: `app/src/App.tsx`)
- App router → Batch data entry: routes to (evidence: `app/src/App.tsx`)
- App router → Production review: routes to (evidence: `app/src/App.tsx`)
- App router → Warehouse and orders: routes to (evidence: `app/src/App.tsx`)
- Navigation and sign-in → Authentication form: opens (evidence: `app/src/components/Navbar.tsx`)
- Authentication form → Authentication API: posts credentials (evidence: `app/src/components/AuthModal.tsx`)
- Product discovery → Product catalog data: reads (evidence: `app/src/pages/Home.tsx`)
- Product details → Product catalog data: reads (evidence: `app/src/pages/ProductDetail.tsx`)
- Product comparison → Product catalog data: reads (evidence: `app/src/pages/Compare.tsx`)
- Product traceability → Product catalog data: reads (evidence: `app/src/pages/Traceability.tsx`)
- Distributor directory → Product catalog data: reads (evidence: `app/src/pages/Distributors.tsx`)
- Batch data entry → Batch record model: uses (evidence: `app/src/pages/DataEntryAdmin.tsx`)
- Production review → Batch record model: uses (evidence: `app/src/pages/ProductionManager.tsx`)
- Warehouse and orders → Batch record model: uses (evidence: `app/src/pages/WarehouseAdmin.tsx`)
- Batch data entry → Batch detail view: renders (evidence: `app/src/pages/DataEntryAdmin.tsx`)
- Production review → Batch detail view: renders (evidence: `app/src/pages/ProductionManager.tsx`)
- Warehouse and orders → Batch detail view: renders (evidence: `app/src/pages/WarehouseAdmin.tsx`)
