# reztdev/risena-website-store architecture

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

- Interactive diagram: https://gitdiagram.com/reztdev/risena-website-store
- Repository: https://github.com/reztdev/risena-website-store

## Overview

Risena is a batik storefront with two deployment modes: a static browser-only shop and an optional Flask backend with admin, order recording, and stock management. The buyer workflow is browse products, build a cart, submit checkout, then complete the purchase through WhatsApp; in backend mode, Flask validates and records the order before the buyer continues. The map also includes administration, image processing, and SEO. Some frontend and admin implementation details were not sampled, so uncertain connections are omitted.

Main entry points: [`backend/app.py`](https://github.com/reztdev/risena-website-store/blob/main/backend/app.py) (Flask Routes & API), [`index.html`](https://github.com/reztdev/risena-website-store/blob/main/index.html) (Shop Interface), [`backend/store.py`](https://github.com/reztdev/risena-website-store/blob/main/backend/store.py) (Catalog & Orders), [`assets/js/app.js`](https://github.com/reztdev/risena-website-store/blob/main/assets/js/app.js) (Cart & Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Storefront"]
  node_storefront["Shop Interface<br/>[index.html]"]
  node_shop_logic["Cart &amp; Checkout<br/>[app.js]"]
  node_theme["Theme Handling<br/>[theme.js]"]
  node_catalog["Product Catalog<br/>[products.js]"]
  node_photos["Product Photos"]
end

subgraph group_backend["Flask Backend"]
  node_flask["Flask Routes &amp; API<br/>[app.py]"]
  node_config["Runtime Configuration<br/>[config.py]"]
  node_admin_views["Admin Pages"]
  node_admin_ui["Admin Interface<br/>[admin.js]"]
end

subgraph group_operations["Store Operations"]
  node_image_processing["Image Processing<br/>[imaging.py]"]
  node_catalog_admin["Catalog &amp; Orders<br/>[store.py]"]
  node_scheduler["Scheduled Jobs<br/>[store.py]"]
  node_database[("SQLite Database<br/>[pesanan.db]")]
end

subgraph group_discovery["SEO"]
  node_seo["SEO Pages &amp; Metadata<br/>[seo.py]"]
end

node_buyer(("Buyer Browser"))
node_whatsapp["WhatsApp"]
node_admin_user(("Admin Browser"))
node_ntfy["ntfy Notifications"]

node_buyer -->|"opens shop"| node_storefront
node_storefront -->|"reads catalog"| node_catalog
node_shop_logic -->|"updates views"| node_storefront
node_storefront -.->|"shows photos"| node_photos
node_buyer -->|"uses shop API"| node_flask
node_flask -->|"places order"| node_catalog_admin
node_catalog_admin -->|"stores orders and stock"| node_database
node_catalog_admin -->|"reads and updates"| node_catalog
node_shop_logic -->|"opens checkout"| node_whatsapp
node_admin_user -->|"uses admin routes"| node_flask
node_flask -->|"renders pages"| node_admin_views
node_admin_views -.->|"loads scripts"| node_admin_ui
node_flask -->|"uses settings"| node_config
node_flask -->|"uses uploads"| node_image_processing
node_image_processing -->|"writes images"| node_photos
node_flask -->|"serves SEO routes"| node_seo
node_scheduler -->|"updates order state"| node_database
node_flask -->|"starts jobs"| node_scheduler
node_flask -.->|"sends alerts"| node_ntfy

click node_storefront "https://github.com/reztdev/risena-website-store/blob/main/index.html"
click node_shop_logic "https://github.com/reztdev/risena-website-store/blob/main/assets/js/app.js"
click node_theme "https://github.com/reztdev/risena-website-store/blob/main/assets/js/theme.js"
click node_catalog "https://github.com/reztdev/risena-website-store/blob/main/data/products.js"
click node_photos "https://github.com/reztdev/risena-website-store/tree/main/foto"
click node_flask "https://github.com/reztdev/risena-website-store/blob/main/backend/app.py"
click node_config "https://github.com/reztdev/risena-website-store/blob/main/backend/config.py"
click node_admin_views "https://github.com/reztdev/risena-website-store/tree/main/backend/templates"
click node_admin_ui "https://github.com/reztdev/risena-website-store/blob/main/backend/static/admin.js"
click node_image_processing "https://github.com/reztdev/risena-website-store/blob/main/backend/imaging.py"
click node_catalog_admin "https://github.com/reztdev/risena-website-store/blob/main/backend/store.py"
click node_scheduler "https://github.com/reztdev/risena-website-store/blob/main/backend/store.py"
click node_database "https://github.com/reztdev/risena-website-store/blob/main/backend/pesanan.db"
click node_seo "https://github.com/reztdev/risena-website-store/blob/main/backend/seo.py"

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_storefront,node_shop_logic,node_theme,node_catalog,node_photos,node_buyer,node_admin_user toneBlue
class node_flask,node_config,node_admin_views,node_admin_ui toneAmber
class node_image_processing,node_catalog_admin,node_scheduler,node_database toneMint
class node_seo toneRose
class node_whatsapp,node_ntfy toneIndigo
```

## Components

### Storefront

- [Shop Interface](https://github.com/reztdev/risena-website-store/blob/main/index.html): `index.html`
- [Cart & Checkout](https://github.com/reztdev/risena-website-store/blob/main/assets/js/app.js): `assets/js/app.js`
- [Theme Handling](https://github.com/reztdev/risena-website-store/blob/main/assets/js/theme.js): `assets/js/theme.js`
- [Product Catalog](https://github.com/reztdev/risena-website-store/blob/main/data/products.js): `data/products.js`
- [Product Photos](https://github.com/reztdev/risena-website-store/tree/main/foto): `foto`

### Flask Backend

- [Flask Routes & API](https://github.com/reztdev/risena-website-store/blob/main/backend/app.py): `backend/app.py`
- [Runtime Configuration](https://github.com/reztdev/risena-website-store/blob/main/backend/config.py): `backend/config.py`
- [Admin Pages](https://github.com/reztdev/risena-website-store/tree/main/backend/templates): `backend/templates`
- [Admin Interface](https://github.com/reztdev/risena-website-store/blob/main/backend/static/admin.js): `backend/static/admin.js`

### Store Operations

- [Image Processing](https://github.com/reztdev/risena-website-store/blob/main/backend/imaging.py): `backend/imaging.py`
- [Catalog & Orders](https://github.com/reztdev/risena-website-store/blob/main/backend/store.py): `backend/store.py`
- [Scheduled Jobs](https://github.com/reztdev/risena-website-store/blob/main/backend/store.py): `backend/store.py`
- [SQLite Database](https://github.com/reztdev/risena-website-store/blob/main/backend/pesanan.db): `backend/pesanan.db`

### SEO

- [SEO Pages & Metadata](https://github.com/reztdev/risena-website-store/blob/main/backend/seo.py): `backend/seo.py`

### Other components

- **Buyer Browser**
- **WhatsApp**
- **Admin Browser**
- **ntfy Notifications**

## Connections

- Buyer Browser → Shop Interface: opens shop (evidence: `README.md`)
- Shop Interface → Product Catalog: reads catalog (evidence: `README.md`)
- Cart & Checkout → Shop Interface: updates views
- Shop Interface → Product Photos: shows photos
- Buyer Browser → Flask Routes & API: uses shop API (evidence: `README.md`)
- Flask Routes & API → Catalog & Orders: places order (evidence: `backend/app.py`)
- Catalog & Orders → SQLite Database: stores orders and stock (evidence: `README.md`)
- Catalog & Orders → Product Catalog: reads and updates (evidence: `README.md`)
- Cart & Checkout → WhatsApp: opens checkout (evidence: `README.md`)
- Admin Browser → Flask Routes & API: uses admin routes (evidence: `README.md`)
- Flask Routes & API → Admin Pages: renders pages (evidence: `README.md`)
- Admin Pages → Admin Interface: loads scripts
- Flask Routes & API → Runtime Configuration: uses settings (evidence: `backend/app.py`)
- Flask Routes & API → Image Processing: uses uploads (evidence: `backend/app.py`)
- Image Processing → Product Photos: writes images (evidence: `README.md`)
- Flask Routes & API → SEO Pages & Metadata: serves SEO routes (evidence: `backend/app.py`)
- Scheduled Jobs → SQLite Database: updates order state (evidence: `README.md`)
- Flask Routes & API → Scheduled Jobs: starts jobs (evidence: `backend/app.py`)
- Flask Routes & API → ntfy Notifications: sends alerts (evidence: `README.md`)
