# vinandius/frontend_kel10_uas architecture

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

- Interactive diagram: https://gitdiagram.com/vinandius/frontend_kel10_uas
- Repository: https://github.com/vinandius/frontend_kel10_uas

## Overview

Rendang combines a database-driven cultural information site with an online shop and admin console. Visitors browse the home-page sections and informational pages; shoppers use the store’s product, cart, and order flows, while administrators manage products, content, purchases, and sales summaries. The graph preserves these distinct branches and shared data/auth layers. Some route and UI implementations were not sampled, so their connections are included only where the README or source index documents them; unsampled links are otherwise omitted.

Main entry points: [`lib/prisma.ts`](https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/prisma.ts) (Prisma Database), [`lib/session.ts`](https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/session.ts) (Session Service), [`app/store/admin/page.tsx`](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/store/admin/page.tsx) (Admin Console), [`lib/content.ts`](https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/content.ts) (Site Content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_culture["Rendang Information"]
  node_home["Home Page<br/>[page.tsx]"]
  node_culture_sections["Culture Sections"]
  node_info_pages["Info Pages"]
end

subgraph group_shop["Storefront"]
  node_store_page["Store Page<br/>[page.tsx]"]
  node_storefront["Product Browsing<br/>[StoreFront.tsx]"]
  node_cart_page["Cart View<br/>[CartView.tsx]"]
  node_auth_ui["Store Authentication<br/>[AuthProvider.tsx]"]
end

subgraph group_commerce["Commerce APIs"]
  node_product_api["Product API<br/>[route.ts]"]
  node_cart_api["Cart API<br/>[route.ts]"]
  node_orders_api["Order API<br/>[route.ts]"]
  node_auth_api["Authentication APIs<br/>[route.ts]"]
end

subgraph group_admin["Administration"]
  node_admin_page["Admin Console<br/>[page.tsx]"]
  node_content_manager["Content Manager<br/>[ContentManager.tsx]"]
  node_content_api["Admin Content API<br/>[route.ts]"]
  node_purchase_reports["Purchase Reports<br/>[route.ts]"]
  node_sales_summary["Sales Summary<br/>[route.ts]"]
end

subgraph group_shared["Shared Services"]
  node_site_content["Site Content<br/>[content.ts]"]
  node_auth_library["Auth Client<br/>[auth.ts]"]
  node_session["Session Service<br/>[session.ts]"]
  node_database[("Prisma Database<br/>[prisma.ts]")]
end

node_visitor(("Visitor"))
node_shopper(("Shopper"))
node_administrator(("Administrator"))

node_visitor -->|"opens"| node_home
node_home -->|"loads sections"| node_site_content
node_home -->|"renders sections"| node_culture_sections
node_visitor -->|"opens"| node_info_pages
node_info_pages -->|"renders content"| node_culture_sections
node_culture_sections -->|"loads content"| node_site_content
node_site_content -->|"queries"| node_database
node_shopper -->|"opens"| node_store_page
node_store_page -->|"renders"| node_storefront
node_store_page -->|"loads content"| node_site_content
node_shopper -.->|"uses"| node_cart_page
node_shopper -.->|"authenticates"| node_auth_ui
node_storefront -.->|"requests products"| node_product_api
node_cart_page -.->|"updates cart"| node_cart_api
node_cart_api -->|"checks session"| node_session
node_cart_api -->|"reads and writes"| node_database
node_product_api -->|"checks session"| node_session
node_product_api -->|"reads and writes"| node_database
node_product_api -->|"loads settings"| node_site_content
node_orders_api -->|"checks session"| node_session
node_orders_api -->|"reads and writes"| node_database
node_auth_ui -.->|"uses auth calls"| node_auth_library
node_auth_library -->|"posts credentials"| node_auth_api
node_auth_api -->|"sets session"| node_session
node_auth_api -->|"accesses users"| node_database
node_administrator -->|"manages store"| node_admin_page
node_admin_page -->|"renders manager"| node_content_manager
node_content_manager -->|"requests content"| node_content_api
node_admin_page -->|"deletes product"| node_product_api
node_admin_page -.->|"loads purchases"| node_purchase_reports
node_admin_page -.->|"loads summary"| node_sales_summary
node_content_api -->|"checks admin"| node_session
node_content_api -->|"reads and writes"| node_database
node_content_api -->|"revalidates pages"| node_admin_page
node_purchase_reports -->|"checks session"| node_session
node_purchase_reports -->|"queries purchases"| node_database
node_sales_summary -->|"checks session"| node_session
node_sales_summary -->|"queries sales"| node_database
node_content_manager -.->|"edits site data"| node_site_content

click node_home "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/page.tsx"
click node_culture_sections "https://github.com/vinandius/frontend_kel10_uas/tree/main/components/main"
click node_info_pages "https://github.com/vinandius/frontend_kel10_uas/tree/main/app/home"
click node_site_content "https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/content.ts"
click node_store_page "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/store/page.tsx"
click node_storefront "https://github.com/vinandius/frontend_kel10_uas/blob/main/components/store/StoreFront.tsx"
click node_cart_page "https://github.com/vinandius/frontend_kel10_uas/blob/main/components/store/CartView.tsx"
click node_auth_ui "https://github.com/vinandius/frontend_kel10_uas/blob/main/components/store/AuthProvider.tsx"
click node_product_api "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/products/route.ts"
click node_cart_api "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/cart/route.ts"
click node_orders_api "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/orders/route.ts"
click node_auth_api "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/auth/login/route.ts"
click node_admin_page "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/store/admin/page.tsx"
click node_content_manager "https://github.com/vinandius/frontend_kel10_uas/blob/main/components/store/ContentManager.tsx"
click node_content_api "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/admin/content/%5Bmodel%5D/route.ts"
click node_purchase_reports "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/admin/purchases/route.ts"
click node_sales_summary "https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/admin/sales-summary/route.ts"
click node_auth_library "https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/auth.ts"
click node_session "https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/session.ts"
click node_database "https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/prisma.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_home,node_culture_sections,node_info_pages toneBlue
class node_store_page,node_storefront,node_cart_page,node_auth_ui toneAmber
class node_product_api,node_cart_api,node_orders_api,node_auth_api toneMint
class node_admin_page,node_content_manager,node_content_api,node_purchase_reports,node_sales_summary toneRose
class node_site_content,node_auth_library,node_session,node_database,node_visitor,node_shopper,node_administrator toneIndigo
```

## Components

### Rendang Information

- [Home Page](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/page.tsx): `app/page.tsx`
- [Culture Sections](https://github.com/vinandius/frontend_kel10_uas/tree/main/components/main): `components/main`
- [Info Pages](https://github.com/vinandius/frontend_kel10_uas/tree/main/app/home): `app/home`

### Storefront

- [Store Page](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/store/page.tsx): `app/store/page.tsx`
- [Product Browsing](https://github.com/vinandius/frontend_kel10_uas/blob/main/components/store/StoreFront.tsx): `components/store/StoreFront.tsx`
- [Cart View](https://github.com/vinandius/frontend_kel10_uas/blob/main/components/store/CartView.tsx): `components/store/CartView.tsx`
- [Store Authentication](https://github.com/vinandius/frontend_kel10_uas/blob/main/components/store/AuthProvider.tsx): `components/store/AuthProvider.tsx`

### Commerce APIs

- [Product API](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/products/route.ts): `app/api/products/route.ts`
- [Cart API](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/cart/route.ts): `app/api/cart/route.ts`
- [Order API](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/orders/route.ts): `app/api/orders/route.ts`
- [Authentication APIs](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`

### Administration

- [Admin Console](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/store/admin/page.tsx): `app/store/admin/page.tsx`
- [Content Manager](https://github.com/vinandius/frontend_kel10_uas/blob/main/components/store/ContentManager.tsx): `components/store/ContentManager.tsx`
- [Admin Content API](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/admin/content/%5Bmodel%5D/route.ts): `app/api/admin/content/[model]/route.ts`
- [Purchase Reports](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/admin/purchases/route.ts): `app/api/admin/purchases/route.ts`
- [Sales Summary](https://github.com/vinandius/frontend_kel10_uas/blob/main/app/api/admin/sales-summary/route.ts): `app/api/admin/sales-summary/route.ts`

### Shared Services

- [Site Content](https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/content.ts): `lib/content.ts`
- [Auth Client](https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/auth.ts): `lib/auth.ts`
- [Session Service](https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/session.ts): `lib/session.ts`
- [Prisma Database](https://github.com/vinandius/frontend_kel10_uas/blob/main/lib/prisma.ts): `lib/prisma.ts`

### Other components

- **Visitor**
- **Shopper**
- **Administrator**

## Connections

- Visitor → Home Page: opens (evidence: `app/page.tsx`)
- Home Page → Site Content: loads sections (evidence: `app/page.tsx`)
- Home Page → Culture Sections: renders sections (evidence: `app/page.tsx`)
- Visitor → Info Pages: opens (evidence: `app/home/jenis-rendang/page.tsx`)
- Info Pages → Culture Sections: renders content (evidence: `app/home/jenis-rendang/page.tsx`)
- Culture Sections → Site Content: loads content (evidence: `components/main/jenis.tsx`)
- Site Content → Prisma Database: queries (evidence: `lib/content.ts`)
- Shopper → Store Page: opens (evidence: `app/store/page.tsx`)
- Store Page → Product Browsing: renders (evidence: `app/store/page.tsx`)
- Store Page → Site Content: loads content (evidence: `app/store/page.tsx`)
- Shopper → Cart View: uses
- Shopper → Store Authentication: authenticates
- Product Browsing → Product API: requests products
- Cart View → Cart API: updates cart
- Cart API → Session Service: checks session (evidence: `app/api/cart/route.ts`)
- Cart API → Prisma Database: reads and writes (evidence: `app/api/cart/route.ts`)
- Product API → Session Service: checks session (evidence: `app/api/products/route.ts`)
- Product API → Prisma Database: reads and writes (evidence: `app/api/products/route.ts`)
- Product API → Site Content: loads settings (evidence: `app/api/products/route.ts`)
- Order API → Session Service: checks session (evidence: `app/api/orders/route.ts`)
- Order API → Prisma Database: reads and writes (evidence: `app/api/orders/route.ts`)
- Store Authentication → Auth Client: uses auth calls
- Auth Client → Authentication APIs: posts credentials (evidence: `lib/auth.ts`)
- Authentication APIs → Session Service: sets session (evidence: `app/api/auth/login/route.ts`)
- Authentication APIs → Prisma Database: accesses users (evidence: `app/api/auth/login/route.ts`)
- Administrator → Admin Console: manages store (evidence: `app/store/admin/page.tsx`)
- Admin Console → Content Manager: renders manager (evidence: `app/store/admin/page.tsx`)
- Content Manager → Admin Content API: requests content (evidence: `components/store/ContentManager.tsx`)
- Admin Console → Product API: deletes product (evidence: `app/store/admin/page.tsx`)
- Admin Console → Purchase Reports: loads purchases
- Admin Console → Sales Summary: loads summary
- Admin Content API → Session Service: checks admin (evidence: `app/api/admin/content/[model]/route.ts`)
- Admin Content API → Prisma Database: reads and writes (evidence: `app/api/admin/content/[model]/route.ts`)
- Admin Content API → Admin Console: revalidates pages (evidence: `app/api/admin/content/[model]/route.ts`)
- Purchase Reports → Session Service: checks session (evidence: `app/api/admin/purchases/route.ts`)
- Purchase Reports → Prisma Database: queries purchases (evidence: `app/api/admin/purchases/route.ts`)
- Sales Summary → Session Service: checks session (evidence: `app/api/admin/sales-summary/route.ts`)
- Sales Summary → Prisma Database: queries sales (evidence: `app/api/admin/sales-summary/route.ts`)
- Content Manager → Site Content: edits site data
