# hybeekraft/creditlog architecture

> Architecture diagram of the GitHub repository hybeekraft/creditlog, 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/hybeekraft/creditlog
- Repository: https://github.com/hybeekraft/creditlog

## Overview

CreditLog is a digital-subscription storefront with an inventory CMS. The customer journey is product discovery, checkout, stock reservation, order creation, payment verification, and credential delivery; administrators manage products and stock. The server excerpt supports the reservation, order, verification, and delivery stages, while the tree identifies the storefront, admin pages, and JSON data files. The README is only a project title, and most page and storage wiring was not sampled, so those connections are omitted rather than inferred.

Main entry points: [`server/index.js`](https://github.com/hybeekraft/creditlog/blob/main/server/index.js) (HTTP API and routing), [`api/index.js`](https://github.com/hybeekraft/creditlog/blob/main/api/index.js) (Serverless adapter), [`index.html`](https://github.com/hybeekraft/creditlog/blob/main/index.html) (Store home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Store home<br/>[index.html]"]
  node_shop["Shop<br/>[shop.html]"]
  node_product["Product detail<br/>[product.html]"]
  node_checkout["Checkout<br/>[checkout.html]"]
  node_success["Order result<br/>[success.html]"]
  node_shared["Shared client logic<br/>[shared.js]"]
end

subgraph group_operations["Operations CMS"]
  node_admin["Admin console<br/>[admin.html]"]
  node_inventory["Inventory manager<br/>[inventory.html]"]
  node_activity["Activity log<br/>[activity-logs.html]"]
end

subgraph group_backend["Commerce backend"]
  node_api["Serverless adapter<br/>[index.js]"]
  node_server["HTTP API and routing<br/>[index.js]"]
  node_stock["Stock reservation<br/>[index.js]"]
  node_orders["Order creation<br/>[index.js]"]
  node_payment["Payment verification<br/>[index.js]"]
  node_delivery["Credential delivery<br/>[index.js]"]
end

subgraph group_persistence["Local data"]
  node_productdata[("Product data<br/>[products.json]")]
  node_orderdata[("Order data<br/>[orders.json]")]
  node_reservationdata[("Reservation data<br/>[reservations.json]")]
  node_logdata[("Log data<br/>[logs.json]")]
end

node_customer(("Customer"))

node_api -->|"dispatches request"| node_server
node_server -->|"routes inventory APIs"| node_stock
node_server -->|"routes order creation"| node_orders
node_server -->|"routes verification"| node_payment
node_payment -->|"generates credentials"| node_delivery
node_customer -->|"browses"| node_home

click node_home "https://github.com/hybeekraft/creditlog/blob/main/index.html"
click node_shop "https://github.com/hybeekraft/creditlog/blob/main/shop.html"
click node_product "https://github.com/hybeekraft/creditlog/blob/main/product.html"
click node_checkout "https://github.com/hybeekraft/creditlog/blob/main/checkout.html"
click node_success "https://github.com/hybeekraft/creditlog/blob/main/success.html"
click node_shared "https://github.com/hybeekraft/creditlog/blob/main/shared.js"
click node_admin "https://github.com/hybeekraft/creditlog/blob/main/admin.html"
click node_inventory "https://github.com/hybeekraft/creditlog/blob/main/inventory.html"
click node_activity "https://github.com/hybeekraft/creditlog/blob/main/activity-logs.html"
click node_api "https://github.com/hybeekraft/creditlog/blob/main/api/index.js"
click node_server "https://github.com/hybeekraft/creditlog/blob/main/server/index.js"
click node_stock "https://github.com/hybeekraft/creditlog/blob/main/server/index.js"
click node_orders "https://github.com/hybeekraft/creditlog/blob/main/server/index.js"
click node_payment "https://github.com/hybeekraft/creditlog/blob/main/server/index.js"
click node_delivery "https://github.com/hybeekraft/creditlog/blob/main/server/index.js"
click node_productdata "https://github.com/hybeekraft/creditlog/blob/main/data/products.json"
click node_orderdata "https://github.com/hybeekraft/creditlog/blob/main/data/orders.json"
click node_reservationdata "https://github.com/hybeekraft/creditlog/blob/main/data/reservations.json"
click node_logdata "https://github.com/hybeekraft/creditlog/blob/main/data/logs.json"

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_shop,node_product,node_checkout,node_success,node_shared toneBlue
class node_admin,node_inventory,node_activity toneAmber
class node_api,node_server,node_stock,node_orders,node_payment,node_delivery toneMint
class node_productdata,node_orderdata,node_reservationdata,node_logdata toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [Store home](https://github.com/hybeekraft/creditlog/blob/main/index.html): `index.html`
- [Shop](https://github.com/hybeekraft/creditlog/blob/main/shop.html): `shop.html`
- [Product detail](https://github.com/hybeekraft/creditlog/blob/main/product.html): `product.html`
- [Checkout](https://github.com/hybeekraft/creditlog/blob/main/checkout.html): `checkout.html`
- [Order result](https://github.com/hybeekraft/creditlog/blob/main/success.html): `success.html`
- [Shared client logic](https://github.com/hybeekraft/creditlog/blob/main/shared.js): `shared.js`

### Operations CMS

- [Admin console](https://github.com/hybeekraft/creditlog/blob/main/admin.html): `admin.html`
- [Inventory manager](https://github.com/hybeekraft/creditlog/blob/main/inventory.html): `inventory.html`
- [Activity log](https://github.com/hybeekraft/creditlog/blob/main/activity-logs.html): `activity-logs.html`

### Commerce backend

- [Serverless adapter](https://github.com/hybeekraft/creditlog/blob/main/api/index.js): `api/index.js`
- [HTTP API and routing](https://github.com/hybeekraft/creditlog/blob/main/server/index.js): `server/index.js`
- [Stock reservation](https://github.com/hybeekraft/creditlog/blob/main/server/index.js): `server/index.js`
- [Order creation](https://github.com/hybeekraft/creditlog/blob/main/server/index.js): `server/index.js`
- [Payment verification](https://github.com/hybeekraft/creditlog/blob/main/server/index.js): `server/index.js`
- [Credential delivery](https://github.com/hybeekraft/creditlog/blob/main/server/index.js): `server/index.js`

### Local data

- [Product data](https://github.com/hybeekraft/creditlog/blob/main/data/products.json): `data/products.json`
- [Order data](https://github.com/hybeekraft/creditlog/blob/main/data/orders.json): `data/orders.json`
- [Reservation data](https://github.com/hybeekraft/creditlog/blob/main/data/reservations.json): `data/reservations.json`
- [Log data](https://github.com/hybeekraft/creditlog/blob/main/data/logs.json): `data/logs.json`

### Other components

- **Customer**

## Connections

- Serverless adapter → HTTP API and routing: dispatches request (evidence: `api/index.js`)
- HTTP API and routing → Stock reservation: routes inventory APIs (evidence: `server/index.js`)
- HTTP API and routing → Order creation: routes order creation (evidence: `server/index.js`)
- HTTP API and routing → Payment verification: routes verification (evidence: `server/index.js`)
- Payment verification → Credential delivery: generates credentials (evidence: `server/index.js`)
- Customer → Store home: browses
