# riko-fernanda-s/bdl architecture

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

- Interactive diagram: https://gitdiagram.com/riko-fernanda-s/bdl
- Repository: https://github.com/riko-fernanda-s/bdl

## Overview

Closerz is a photocard storefront with a React shopping experience and a separate PHP/MySQL backend. The main user flow is browsing the catalog, adding cards to a cart, reviewing it, and confirming an order; login and signup support access, while an admin page manages catalog inventory. The sampled frontend state uses browser storage, and the backend exposes separate PHP data endpoints. The excerpts do not establish that the storefront calls those endpoints, so no frontend-to-backend connection is shown.

Main entry points: [`fe/src/App.jsx`](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/App.jsx) (App Router), [`fe/src/context/AppContext.jsx`](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/context/AppContext.jsx) (App State), [`fe/src/components/FigmaKeranjang.jsx`](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaKeranjang.jsx) (Shopping Cart), [`fe/src/components/FigmaCheckout.jsx`](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaCheckout.jsx) (Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App Router<br/>[App.jsx]"]
  node_landing["Storefront Landing"]
  node_cardfan["Card Fan<br/>[FigmaCardFan.jsx]"]
  node_catalog["Catalog Data<br/>[figmaCatalog.js]"]
  node_cart["Shopping Cart<br/>[FigmaKeranjang.jsx]"]
  node_checkout["Checkout<br/>[FigmaCheckout.jsx]"]
end

subgraph group_identity["Account Access"]
  node_login["Login<br/>[FigmaLogin.jsx]"]
  node_signup["Signup<br/>[FigmaSignUp.jsx]"]
end

subgraph group_management["Catalog Management"]
  node_admin["Admin Catalog<br/>[FigmaAdmin.jsx]"]
  node_state["App State<br/>[AppContext.jsx]"]
end

subgraph group_backend["PHP Backend"]
  node_orders_api["Order Endpoints<br/>[orders.php]"]
  node_payment_api["Payment Endpoint<br/>[pay_order.php]"]
  node_product_api["Product Endpoint<br/>[produk.php]"]
  node_batch_api["Batch Updates<br/>[update_batch.php]"]
  node_db_connection["DB Connection<br/>[db.php]"]
  node_database[("MySQL Database<br/>[database.sql]")]
end

node_shopper(("Shopper"))
node_line(("LINE Admin"))

node_shopper -->|"opens"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_admin
node_landing -->|"renders"| node_cardfan
node_landing -->|"uses"| node_state
node_cart -->|"renders"| node_cardfan
node_cart -->|"uses"| node_state
node_cart -->|"reads"| node_catalog
node_checkout -->|"uses"| node_state
node_checkout -->|"reads"| node_catalog
node_checkout -.->|"confirms via"| node_line
node_login -->|"uses"| node_state
node_signup -->|"uses"| node_state
node_admin -->|"uses"| node_state
node_state -->|"initializes from"| node_catalog
node_orders_api -->|"uses"| node_db_connection
node_payment_api -->|"uses"| node_db_connection
node_product_api -->|"uses"| node_db_connection
node_batch_api -->|"uses"| node_db_connection

click node_app "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/App.jsx"
click node_landing "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaLandingPage.jsx"
click node_cardfan "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaCardFan.jsx"
click node_catalog "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/data/figmaCatalog.js"
click node_cart "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaKeranjang.jsx"
click node_checkout "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaCheckout.jsx"
click node_login "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaLogin.jsx"
click node_signup "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaSignUp.jsx"
click node_admin "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaAdmin.jsx"
click node_state "https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/context/AppContext.jsx"
click node_orders_api "https://github.com/riko-fernanda-s/bdl/blob/master/be/orders.php"
click node_payment_api "https://github.com/riko-fernanda-s/bdl/blob/master/be/pay_order.php"
click node_product_api "https://github.com/riko-fernanda-s/bdl/blob/master/be/produk.php"
click node_batch_api "https://github.com/riko-fernanda-s/bdl/blob/master/be/update_batch.php"
click node_db_connection "https://github.com/riko-fernanda-s/bdl/blob/master/be/db.php"
click node_database "https://github.com/riko-fernanda-s/bdl/blob/master/be/database.sql"

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_landing,node_cardfan,node_catalog,node_cart,node_checkout toneBlue
class node_login,node_signup toneAmber
class node_admin,node_state toneMint
class node_orders_api,node_payment_api,node_product_api,node_batch_api,node_db_connection,node_database toneRose
class node_shopper,node_line toneIndigo
```

## Components

### Storefront

- [App Router](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/App.jsx): `fe/src/App.jsx`
- [Storefront Landing](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaLandingPage.jsx): `fe/src/components/FigmaLandingPage.jsx`
- [Card Fan](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaCardFan.jsx): `fe/src/components/FigmaCardFan.jsx`
- [Catalog Data](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/data/figmaCatalog.js): `fe/src/data/figmaCatalog.js`
- [Shopping Cart](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaKeranjang.jsx): `fe/src/components/FigmaKeranjang.jsx`
- [Checkout](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaCheckout.jsx): `fe/src/components/FigmaCheckout.jsx`

### Account Access

- [Login](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaLogin.jsx): `fe/src/components/FigmaLogin.jsx`
- [Signup](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaSignUp.jsx): `fe/src/components/FigmaSignUp.jsx`

### Catalog Management

- [Admin Catalog](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/components/FigmaAdmin.jsx): `fe/src/components/FigmaAdmin.jsx`
- [App State](https://github.com/riko-fernanda-s/bdl/blob/master/fe/src/context/AppContext.jsx): `fe/src/context/AppContext.jsx`

### PHP Backend

- [Order Endpoints](https://github.com/riko-fernanda-s/bdl/blob/master/be/orders.php): `be/orders.php`
- [Payment Endpoint](https://github.com/riko-fernanda-s/bdl/blob/master/be/pay_order.php): `be/pay_order.php`
- [Product Endpoint](https://github.com/riko-fernanda-s/bdl/blob/master/be/produk.php): `be/produk.php`
- [Batch Updates](https://github.com/riko-fernanda-s/bdl/blob/master/be/update_batch.php): `be/update_batch.php`
- [DB Connection](https://github.com/riko-fernanda-s/bdl/blob/master/be/db.php): `be/db.php`
- [MySQL Database](https://github.com/riko-fernanda-s/bdl/blob/master/be/database.sql): `be/database.sql`

### Other components

- **Shopper**
- **LINE Admin**

## Connections

- Shopper → App Router: opens
- App Router → Storefront Landing: routes to (evidence: `fe/src/App.jsx`)
- App Router → Login: routes to (evidence: `fe/src/App.jsx`)
- App Router → Signup: routes to (evidence: `fe/src/App.jsx`)
- App Router → Shopping Cart: routes to (evidence: `fe/src/App.jsx`)
- App Router → Checkout: routes to (evidence: `fe/src/App.jsx`)
- App Router → Admin Catalog: routes to (evidence: `fe/src/App.jsx`)
- Storefront Landing → Card Fan: renders (evidence: `fe/src/components/FigmaLandingPage.jsx`)
- Storefront Landing → App State: uses (evidence: `fe/src/components/FigmaLandingPage.jsx`)
- Shopping Cart → Card Fan: renders (evidence: `fe/src/components/FigmaKeranjang.jsx`)
- Shopping Cart → App State: uses (evidence: `fe/src/components/FigmaKeranjang.jsx`)
- Shopping Cart → Catalog Data: reads (evidence: `fe/src/components/FigmaKeranjang.jsx`)
- Checkout → App State: uses (evidence: `fe/src/components/FigmaCheckout.jsx`)
- Checkout → Catalog Data: reads (evidence: `fe/src/components/FigmaCheckout.jsx`)
- Checkout → LINE Admin: confirms via (evidence: `fe/src/components/FigmaCheckout.jsx`)
- Login → App State: uses (evidence: `fe/src/components/FigmaLogin.jsx`)
- Signup → App State: uses (evidence: `fe/src/components/FigmaSignUp.jsx`)
- Admin Catalog → App State: uses (evidence: `fe/src/components/FigmaAdmin.jsx`)
- App State → Catalog Data: initializes from (evidence: `fe/src/context/AppContext.jsx`)
- Order Endpoints → DB Connection: uses (evidence: `be/orders.php`)
- Payment Endpoint → DB Connection: uses (evidence: `be/pay_order.php`)
- Product Endpoint → DB Connection: uses (evidence: `be/produk.php`)
- Batch Updates → DB Connection: uses (evidence: `be/update_batch.php`)
