# mayorit/kreezbysystem_testing architecture

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

- Interactive diagram: https://gitdiagram.com/mayorit/kreezbysystem_testing
- Repository: https://github.com/mayorit/kreezbysystem_testing

## Overview

Kreezby Bakeshop is a multi-portal bakery sales and operations application: customers can shop and check out, while staff and administrators manage orders, purchasing, receiving, sales, stock, and related records. The sampled code shows browser-side portal features alongside an Express server with MongoDB-backed state and payment/management endpoints. Major modules are included, but the README is empty and most browser-to-server wiring was not shown; accordingly, uncertain connections are omitted or marked unverified.

Main entry points: [`server.js`](https://github.com/mayorit/kreezbysystem_testing/blob/main/server.js) (Express API), [`Kreezby-Bakeshop-main/js/checkout-customer.js`](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/checkout-customer.js) (Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Shop"]
  node_checkout["Checkout"]
  node_orders["Customer Orders<br/>[customer-orders.js]"]
  node_tracking["Order Tracking<br/>[order-tracking.js]"]
  node_helpchat["Customer Help Chat"]
  node_phone_shop["Phone Shop"]
end

subgraph group_operations["Bakery Operations"]
  node_po["Purchase Orders<br/>[po-admin.js]"]
  node_receiving["Receiving<br/>[receive-admin.js]"]
  node_bo["Back Orders<br/>[bo-admin.js]"]
  node_returns["Returns<br/>[return-admin.js]"]
  node_staff_permissions["Staff Permissions"]
end

subgraph group_insights["Sales And Insights"]
  node_sales_renderer["Sales Views"]
  node_sales_data["Sales Data"]
  node_stock_dashboard["Stock Dashboard"]
  node_dictionary["Product Data Dictionary"]
  node_insight_service["Management Insight API<br/>[server.js]"]
end

subgraph group_platform["Application Platform"]
  node_runtime["App Runtime<br/>[app-runtime.js]"]
  node_portal_templates["Wholesaler Portal Templates"]
  node_portal_seed["Portal Seed Data"]
  node_api_server["Express API<br/>[server.js]"]
  node_mongo[("MongoDB")]
end

node_customer(("Customer"))
node_paymongo["PayMongo"]
node_openai["OpenAI API"]

node_api_server -.->|"reads and writes"| node_mongo
node_api_server -->|"requests insight"| node_openai
node_api_server -.->|"creates wallet payment"| node_paymongo
node_checkout -.->|"requests payment"| node_api_server

click node_checkout "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/checkout-customer.js"
click node_orders "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/customer-orders.js"
click node_tracking "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/order-tracking.js"
click node_helpchat "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/customer-help-chat.js"
click node_phone_shop "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/customer-phone-shop.js"
click node_po "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/po-admin.js"
click node_receiving "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/receive-admin.js"
click node_bo "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/bo-admin.js"
click node_returns "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/return-admin.js"
click node_staff_permissions "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/staff-permissions.js"
click node_sales_renderer "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/sales-list-renderer.js"
click node_sales_data "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/kreezby-sales-data.js"
click node_stock_dashboard "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/stocklevel-dashboard.js"
click node_dictionary "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/kreezby-data-dictionary.js"
click node_insight_service "https://github.com/mayorit/kreezbysystem_testing/blob/main/server.js"
click node_runtime "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/app-runtime.js"
click node_portal_templates "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/wholesaler-portal-templates.js"
click node_portal_seed "https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/kreezby-seed-portal-data.js"
click node_api_server "https://github.com/mayorit/kreezbysystem_testing/blob/main/server.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_checkout,node_orders,node_tracking,node_helpchat,node_phone_shop toneBlue
class node_po,node_receiving,node_bo,node_returns,node_staff_permissions toneAmber
class node_sales_renderer,node_sales_data,node_stock_dashboard,node_dictionary,node_insight_service,node_openai toneMint
class node_runtime,node_portal_templates,node_portal_seed,node_api_server,node_mongo toneRose
class node_customer,node_paymongo toneIndigo
```

## Components

### Customer Shop

- [Checkout](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/checkout-customer.js): `Kreezby-Bakeshop-main/js/checkout-customer.js`
- [Customer Orders](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/customer-orders.js): `Kreezby-Bakeshop-main/js/customer-orders.js`
- [Order Tracking](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/order-tracking.js): `Kreezby-Bakeshop-main/js/order-tracking.js`
- [Customer Help Chat](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/customer-help-chat.js): `Kreezby-Bakeshop-main/js/customer-help-chat.js`
- [Phone Shop](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/customer-phone-shop.js): `Kreezby-Bakeshop-main/js/customer-phone-shop.js`

### Bakery Operations

- [Purchase Orders](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/po-admin.js): `Kreezby-Bakeshop-main/js/po-admin.js`
- [Receiving](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/receive-admin.js): `Kreezby-Bakeshop-main/js/receive-admin.js`
- [Back Orders](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/bo-admin.js): `Kreezby-Bakeshop-main/js/bo-admin.js`
- [Returns](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/return-admin.js): `Kreezby-Bakeshop-main/js/return-admin.js`
- [Staff Permissions](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/staff-permissions.js): `Kreezby-Bakeshop-main/js/staff-permissions.js`

### Sales And Insights

- [Sales Views](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/sales-list-renderer.js): `Kreezby-Bakeshop-main/js/sales-list-renderer.js`
- [Sales Data](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/kreezby-sales-data.js): `Kreezby-Bakeshop-main/js/kreezby-sales-data.js`
- [Stock Dashboard](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/stocklevel-dashboard.js): `Kreezby-Bakeshop-main/js/stocklevel-dashboard.js`
- [Product Data Dictionary](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/kreezby-data-dictionary.js): `Kreezby-Bakeshop-main/js/kreezby-data-dictionary.js`
- [Management Insight API](https://github.com/mayorit/kreezbysystem_testing/blob/main/server.js): `server.js`

### Application Platform

- [App Runtime](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/app-runtime.js): `Kreezby-Bakeshop-main/js/app-runtime.js`
- [Wholesaler Portal Templates](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/wholesaler-portal-templates.js): `Kreezby-Bakeshop-main/js/wholesaler-portal-templates.js`
- [Portal Seed Data](https://github.com/mayorit/kreezbysystem_testing/blob/main/Kreezby-Bakeshop-main/js/kreezby-seed-portal-data.js): `Kreezby-Bakeshop-main/js/kreezby-seed-portal-data.js`
- [Express API](https://github.com/mayorit/kreezbysystem_testing/blob/main/server.js): `server.js`
- **MongoDB**

### Other components

- **Customer**
- **PayMongo**
- **OpenAI API**

## Connections

- Express API → MongoDB: reads and writes
- Express API → OpenAI API: requests insight (evidence: `server.js`)
- Express API → PayMongo: creates wallet payment
- Checkout → Express API: requests payment
