# xtrpate/spiralwood architecture

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

- Interactive diagram: https://gitdiagram.com/xtrpate/spiralwood
- Repository: https://github.com/xtrpate/spiralwood

## Overview

WISDOM is a furniture-commerce and operations system: customers browse and order standard or custom furniture, while staff and administrators manage production, inventory, fulfillment, and business operations. The tree shows customer, POS, admin, blueprint-design, and reporting capabilities; sampled source confirms the server’s route mounting, task API dispatch, and selected database and service interactions. Most other subsystem connections are inferred only at the product-capability level, so their internal wiring is not expanded.

Main entry points: [`admin/frontend/src/App.jsx`](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/App.jsx) (Web application), [`admin/backend/controllers/admin/orderController.js`](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/admin/orderController.js) (Order management), [`admin/backend/routes/pos.tasks.js`](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/pos.tasks.js) (Task API routes), [`admin/backend/config/db.js`](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/config/db.js) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer commerce"]
  node_catalog["Product catalog<br/>[productcatalog.jsx]"]
  node_cart_checkout["Cart and checkout<br/>[checkoutpage.jsx]"]
  node_customer_orders["Customer orders<br/>[orderspage.jsx]"]
  node_customer_ar["Furniture AR<br/>[ARViewPage.jsx]"]
end

subgraph group_design["Blueprint design"]
  node_blueprint_editor["Blueprint editor"]
  node_blueprint_estimation["Estimation and contracts<br/>[EstimationPage.jsx]"]
  node_blueprint_export["Blueprint exports"]
end

subgraph group_operations["Staff operations"]
  node_production_tasks["Production tasks<br/>[TasksPage.jsx]"]
  node_staff_tasks["Staff task view<br/>[MyTasks.jsx]"]
  node_pos_fulfillment["POS fulfillment"]
  node_inventory_ui["Inventory management"]
end

subgraph group_platform["Backend platform"]
  node_server["HTTP and socket server<br/>[server.js]"]
  node_customer_routes["Customer API routes<br/>[customer.orders.js]"]
  node_pos_task_routes["Task API routes<br/>[pos.tasks.js]"]
  node_order_controller["Order management<br/>[orderController.js]"]
  node_task_controller["Task management<br/>[pos.tasks.js]"]
  node_inventory_controller["Inventory operations"]
  node_management_controller["Management operations"]
  node_blueprint_lifecycle["Blueprint lifecycle"]
  node_payments["Payment integration<br/>[paymongoService.js]"]
  node_database[("Application database<br/>[db.js]")]
  node_socket["Live updates<br/>[socket.js]"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin workspaces"]
  node_admin_routes["Admin API routes<br/>[admin.js]"]
  node_reports["Reports<br/>[admin.reports.js]"]
  node_backup["Database backup"]
  node_r2_storage[("Cloud backup storage")]
end

node_customer_actor(("Customer"))
node_staff_actor(("Staff"))
node_admin_actor(("Administrator"))
node_app["Web application<br/>[App.jsx]"]
node_payment_provider["PayMongo"]

node_customer_actor -->|"uses"| node_app
node_staff_actor -->|"uses"| node_app
node_admin_actor -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_cart_checkout
node_app -->|"routes to"| node_customer_orders
node_app -->|"routes to"| node_customer_ar
node_app -->|"routes to"| node_blueprint_editor
node_app -->|"routes to"| node_blueprint_estimation
node_app -->|"routes to"| node_production_tasks
node_app -->|"routes to"| node_staff_tasks
node_app -->|"routes to"| node_pos_fulfillment
node_app -->|"routes to"| node_inventory_ui
node_app -->|"routes to"| node_admin_ui
node_server -->|"mounts routes"| node_customer_routes
node_server -->|"mounts routes"| node_pos_task_routes
node_customer_routes -->|"dispatches"| node_order_controller
node_pos_task_routes -->|"dispatches"| node_task_controller
node_production_tasks -->|"requests tasks"| node_pos_task_routes
node_staff_tasks -->|"updates tasks"| node_pos_task_routes
node_order_controller -->|"queries"| node_database
node_task_controller -->|"queries"| node_database
node_inventory_controller -->|"queries"| node_database
node_management_controller -->|"queries"| node_database
node_management_controller -->|"resolves lifecycle"| node_blueprint_lifecycle
node_order_controller -->|"emits status"| node_socket
node_task_controller -->|"emits task updates"| node_socket
node_cart_checkout -.->|"pays via"| node_payment_provider
node_backup -.->|"stores backups"| node_r2_storage
node_admin_routes -->|"dispatches"| node_management_controller
node_admin_routes -->|"dispatches"| node_order_controller
node_reports -->|"dispatches"| node_inventory_controller
node_blueprint_editor -->|"exports designs"| node_blueprint_export

click node_app "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/App.jsx"
click node_catalog "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/customer/productcatalog.jsx"
click node_cart_checkout "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/customer/checkoutpage.jsx"
click node_customer_orders "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/customer/orderspage.jsx"
click node_customer_ar "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/customer/ar/ARViewPage.jsx"
click node_blueprint_editor "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/blueprints/BlueprintDesign.jsx"
click node_blueprint_estimation "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/blueprints/EstimationPage.jsx"
click node_blueprint_export "https://github.com/xtrpate/spiralwood/tree/main/admin/frontend/src/pages/blueprints/export"
click node_production_tasks "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/tasks/TasksPage.jsx"
click node_staff_tasks "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/staff/MyTasks.jsx"
click node_pos_fulfillment "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/staff/DeliveryManagement.jsx"
click node_inventory_ui "https://github.com/xtrpate/spiralwood/tree/main/admin/frontend/src/pages/inventory"
click node_server "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/server.js"
click node_customer_routes "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/customer.orders.js"
click node_pos_task_routes "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/pos.tasks.js"
click node_order_controller "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/admin/orderController.js"
click node_task_controller "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/staff/pos.tasks.js"
click node_inventory_controller "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/admin/inventoryController.js"
click node_management_controller "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/admin/managementController.js"
click node_blueprint_lifecycle "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/services/blueprintLifecycleService.js"
click node_payments "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/services/paymongoService.js"
click node_database "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/config/db.js"
click node_socket "https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/services/socket.js"
click node_admin_ui "https://github.com/xtrpate/spiralwood/tree/main/admin/frontend/src/pages"
click node_admin_routes "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/admin.js"
click node_reports "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/admin.reports.js"
click node_backup "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/services/databaseBackupService.js"
click node_r2_storage "https://github.com/xtrpate/spiralwood/blob/main/admin/backend/services/r2BackupStorageService.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_catalog,node_cart_checkout,node_customer_orders,node_customer_ar toneBlue
class node_blueprint_editor,node_blueprint_estimation,node_blueprint_export toneAmber
class node_production_tasks,node_staff_tasks,node_pos_fulfillment,node_inventory_ui toneMint
class node_server,node_customer_routes,node_pos_task_routes,node_order_controller,node_task_controller,node_inventory_controller,node_management_controller,node_blueprint_lifecycle,node_payments,node_database,node_socket toneRose
class node_admin_ui,node_admin_routes,node_reports,node_backup,node_r2_storage,node_customer_actor,node_staff_actor,node_admin_actor,node_payment_provider toneIndigo
class node_app toneTeal
```

## Components

### Customer commerce

- [Product catalog](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/customer/productcatalog.jsx): `admin/frontend/src/pages/customer/productcatalog.jsx`
- [Cart and checkout](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/customer/checkoutpage.jsx): `admin/frontend/src/pages/customer/checkoutpage.jsx`
- [Customer orders](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/customer/orderspage.jsx): `admin/frontend/src/pages/customer/orderspage.jsx`
- [Furniture AR](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/customer/ar/ARViewPage.jsx): `admin/frontend/src/pages/customer/ar/ARViewPage.jsx`

### Blueprint design

- [Blueprint editor](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/blueprints/BlueprintDesign.jsx): `admin/frontend/src/pages/blueprints/BlueprintDesign.jsx`
- [Estimation and contracts](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/blueprints/EstimationPage.jsx): `admin/frontend/src/pages/blueprints/EstimationPage.jsx`
- [Blueprint exports](https://github.com/xtrpate/spiralwood/tree/main/admin/frontend/src/pages/blueprints/export): `admin/frontend/src/pages/blueprints/export`

### Staff operations

- [Production tasks](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/tasks/TasksPage.jsx): `admin/frontend/src/pages/tasks/TasksPage.jsx`
- [Staff task view](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/staff/MyTasks.jsx): `admin/frontend/src/pages/staff/MyTasks.jsx`
- [POS fulfillment](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/pages/staff/DeliveryManagement.jsx): `admin/frontend/src/pages/staff/DeliveryManagement.jsx`
- [Inventory management](https://github.com/xtrpate/spiralwood/tree/main/admin/frontend/src/pages/inventory): `admin/frontend/src/pages/inventory`

### Backend platform

- [HTTP and socket server](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/server.js): `admin/backend/server.js`
- [Customer API routes](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/customer.orders.js): `admin/backend/routes/customer.orders.js`
- [Task API routes](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/pos.tasks.js): `admin/backend/routes/pos.tasks.js`
- [Order management](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/admin/orderController.js): `admin/backend/controllers/admin/orderController.js`
- [Task management](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/staff/pos.tasks.js): `admin/backend/controllers/staff/pos.tasks.js`
- [Inventory operations](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/admin/inventoryController.js): `admin/backend/controllers/admin/inventoryController.js`
- [Management operations](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/controllers/admin/managementController.js): `admin/backend/controllers/admin/managementController.js`
- [Blueprint lifecycle](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/services/blueprintLifecycleService.js): `admin/backend/services/blueprintLifecycleService.js`
- [Payment integration](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/services/paymongoService.js): `admin/backend/services/paymongoService.js`
- [Application database](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/config/db.js): `admin/backend/config/db.js`
- [Live updates](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/services/socket.js): `admin/frontend/src/services/socket.js`

### Administration

- [Admin workspaces](https://github.com/xtrpate/spiralwood/tree/main/admin/frontend/src/pages): `admin/frontend/src/pages`
- [Admin API routes](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/admin.js): `admin/backend/routes/admin.js`
- [Reports](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/routes/admin.reports.js): `admin/backend/routes/admin.reports.js`
- [Database backup](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/services/databaseBackupService.js): `admin/backend/services/databaseBackupService.js`
- [Cloud backup storage](https://github.com/xtrpate/spiralwood/blob/main/admin/backend/services/r2BackupStorageService.js): `admin/backend/services/r2BackupStorageService.js`

### Other components

- **Customer**
- **Staff**
- **Administrator**
- [Web application](https://github.com/xtrpate/spiralwood/blob/main/admin/frontend/src/App.jsx): `admin/frontend/src/App.jsx`
- **PayMongo**

## Connections

- Customer → Web application: uses
- Staff → Web application: uses
- Administrator → Web application: uses
- Web application → Product catalog: routes to
- Web application → Cart and checkout: routes to
- Web application → Customer orders: routes to
- Web application → Furniture AR: routes to
- Web application → Blueprint editor: routes to
- Web application → Estimation and contracts: routes to
- Web application → Production tasks: routes to
- Web application → Staff task view: routes to
- Web application → POS fulfillment: routes to
- Web application → Inventory management: routes to
- Web application → Admin workspaces: routes to
- HTTP and socket server → Customer API routes: mounts routes
- HTTP and socket server → Task API routes: mounts routes
- Customer API routes → Order management: dispatches
- Task API routes → Task management: dispatches
- Production tasks → Task API routes: requests tasks
- Staff task view → Task API routes: updates tasks
- Order management → Application database: queries
- Task management → Application database: queries
- Inventory operations → Application database: queries
- Management operations → Application database: queries
- Management operations → Blueprint lifecycle: resolves lifecycle
- Order management → Live updates: emits status
- Task management → Live updates: emits task updates
- Cart and checkout → PayMongo: pays via
- Database backup → Cloud backup storage: stores backups
- Admin API routes → Management operations: dispatches
- Admin API routes → Order management: dispatches
- Reports → Inventory operations: dispatches
- Blueprint editor → Blueprint exports: exports designs
