# pringoottt/mikmik-store architecture

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

- Interactive diagram: https://gitdiagram.com/pringoottt/mikmik-store
- Repository: https://github.com/pringoottt/mikmik-store

## Overview

This is a browser-based shop-management and point-of-sale app. Its main workflow scans or searches products, builds a checkout cart, and records a sale; separate workflows manage inventory, customer credit and payments, and monthly revenue. The sampled JavaScript also shows camera/file/manual scanning, Supabase operations, and UI rendering. All sampled runtime behavior lives in index.js, so nodes share that path. The README is empty, and unsampled code limits evidence for some links, especially reporting and initial data loading.

Main entry points: [`index.js`](https://github.com/pringoottt/mikmik-store/blob/main/index.js) (Product management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sales["Sales and checkout"]
  node_scanner["Code scanning<br/>[index.js]"]
  node_cart["Checkout cart<br/>[index.js]"]
  node_sale_entry["Sale entry<br/>[index.js]"]
end

subgraph group_inventory["Inventory"]
  node_product_admin["Product management<br/>[index.js]"]
  node_inventory_view["Inventory view<br/>[index.js]"]
end

subgraph group_credit["Credit accounts"]
  node_credit_view["Credit accounts<br/>[index.js]"]
  node_payments["Credit payments<br/>[index.js]"]
  node_revenue["Monthly revenue<br/>[index.js]"]
end

subgraph group_platform["App and data"]
  node_app_state["App data state<br/>[index.js]"]
  node_supabase[("Supabase")]
end

node_operator(("Shop operator"))
node_camera["Device camera"]
node_html5qrcode["Html5Qrcode library"]

node_scanner -->|"starts scanner"| node_html5qrcode
node_camera -->|"provides video"| node_html5qrcode
node_html5qrcode -->|"decodes for cart"| node_cart
node_product_admin -->|"inserts products"| node_supabase
node_product_admin -->|"calls add_stock"| node_supabase
node_product_admin -->|"deletes products"| node_supabase
node_sale_entry -->|"records sale"| node_supabase
node_payments -->|"inserts payment"| node_supabase
node_operator -.-> node_scanner
node_operator -.-> node_product_admin
node_operator -.-> node_sale_entry
node_operator -.-> node_payments

click node_scanner "https://github.com/pringoottt/mikmik-store/blob/main/index.js"
click node_cart "https://github.com/pringoottt/mikmik-store/blob/main/index.js"
click node_sale_entry "https://github.com/pringoottt/mikmik-store/blob/main/index.js"
click node_product_admin "https://github.com/pringoottt/mikmik-store/blob/main/index.js"
click node_inventory_view "https://github.com/pringoottt/mikmik-store/blob/main/index.js"
click node_credit_view "https://github.com/pringoottt/mikmik-store/blob/main/index.js"
click node_payments "https://github.com/pringoottt/mikmik-store/blob/main/index.js"
click node_revenue "https://github.com/pringoottt/mikmik-store/blob/main/index.js"
click node_app_state "https://github.com/pringoottt/mikmik-store/blob/main/index.js"

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_scanner,node_cart,node_sale_entry toneBlue
class node_product_admin,node_inventory_view toneAmber
class node_credit_view,node_payments,node_revenue toneMint
class node_app_state,node_supabase toneRose
class node_operator,node_camera,node_html5qrcode toneIndigo
```

## Components

### Sales and checkout

- [Code scanning](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`
- [Checkout cart](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`
- [Sale entry](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`

### Inventory

- [Product management](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`
- [Inventory view](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`

### Credit accounts

- [Credit accounts](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`
- [Credit payments](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`
- [Monthly revenue](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`

### App and data

- [App data state](https://github.com/pringoottt/mikmik-store/blob/main/index.js): `index.js`
- **Supabase**

### Other components

- **Shop operator**
- **Device camera**
- **Html5Qrcode library**

## Connections

- Code scanning → Html5Qrcode library: starts scanner (evidence: `index.js`)
- Device camera → Html5Qrcode library: provides video
- Html5Qrcode library → Checkout cart: decodes for cart (evidence: `index.js`)
- Product management → Supabase: inserts products (evidence: `index.js`)
- Product management → Supabase: calls add_stock (evidence: `index.js`)
- Product management → Supabase: deletes products (evidence: `index.js`)
- Sale entry → Supabase: records sale (evidence: `index.js`)
- Credit payments → Supabase: inserts payment (evidence: `index.js`)
- Shop operator → Code scanning
- Shop operator → Product management
- Shop operator → Sale entry
- Shop operator → Credit payments
