# torresjade100-ping/capstone-jem architecture

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

- Interactive diagram: https://gitdiagram.com/torresjade100-ping/capstone-jem
- Repository: https://github.com/torresjade100-ping/capstone-jem

## Overview

JEM is a retail operations and commerce system spanning customer ordering, staff/admin workflows, inventory and purchasing, and POS transactions. The customer path runs from mobile sign-in and catalog/cart interactions through order submission; staff-facing operations cover order fulfillment, stock replenishment, reporting, and transaction management. Source excerpts confirm selected controller/service calls and model relationships, while the README is empty and many frontend, mobile, and backend modules were not sampled; edges are limited to visible references and calls.

Main entry points: [`backend/routes/api.php`](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/routes/api.php) (API Routes), [`backend/app/Services/BackorderService.php`](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Services/BackorderService.php) (Backorder Service), [`backend/app/Models/Order.php`](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/Order.php) (Orders and Items), [`backend/app/Http/Controllers/Api/OrderController.php`](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/OrderController.php) (Customer Order API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Customer and Staff Apps"]
  node_webapp["Web Operations App<br/>[App.jsx]"]
  node_webpages["Operations Pages"]
  node_mobileapp["Customer Mobile App<br/>[App.js]"]
  node_mobileapi["Mobile API Client<br/>[mobileApi.js]"]
end

subgraph group_api["API Entry Points"]
  node_routes["API Routes<br/>[api.php]"]
  node_auth["Authentication API<br/>[AuthController.php]"]
end

subgraph group_commerce["Commerce Operations"]
  node_customerorders["Customer Order API"]
  node_orderops["Order Operations API"]
  node_transactions["POS and Transaction APIs"]
  node_paymentmanager["Payment Manager<br/>[PaymentManager.php]"]
end

subgraph group_operations["Inventory and Admin"]
  node_backorderapi["Backorder API"]
  node_backordersvc["Backorder Service"]
  node_productapi["Product Management API"]
  node_inventoryapi["Inventory and Purchasing APIs"]
  node_audit["Audit Service<br/>[AuditService.php]"]
end

subgraph group_data["Domain Data"]
  node_productdata[("Product Catalog Data<br/>[Product.php]")]
  node_variantdata[("Product Variant Data<br/>[ProductVariant.php]")]
  node_orderdata[("Orders and Items<br/>[Order.php]")]
  node_backorderdata[("Backorder Data<br/>[Backorder.php]")]
  node_userdata[("User and Customer Data<br/>[User.php]")]
end

node_customer(("Customer"))
node_staff(("Staff / Admin"))

node_customer -->|"uses"| node_mobileapp
node_staff -->|"uses"| node_webapp
node_webapp -->|"routes by role"| node_webpages
node_mobileapp -->|"calls"| node_mobileapi
node_routes -->|"routes to"| node_auth
node_routes -->|"routes to"| node_productapi
node_routes -->|"routes to"| node_customerorders
node_routes -->|"routes to"| node_inventoryapi
node_routes -->|"routes to"| node_backorderapi
node_routes -->|"routes to"| node_transactions
node_customerorders -->|"delegates to"| node_backordersvc
node_backorderapi -->|"delegates to"| node_backordersvc
node_backordersvc -->|"reads and updates"| node_backorderdata
node_backordersvc -->|"updates"| node_orderdata
node_backordersvc -->|"checks stock"| node_productdata
node_backordersvc -->|"checks stock"| node_variantdata
node_customerorders -->|"creates orders"| node_orderdata
node_productapi -->|"manages"| node_productdata
node_transactions -->|"records audit"| node_audit
node_productdata -->|"has variants"| node_variantdata
node_orderdata -->|"has backorders"| node_backorderdata
node_orderdata -->|"belongs to customer"| node_userdata

click node_webapp "https://github.com/torresjade100-ping/capstone-jem/blob/main/frontend/src/App.jsx"
click node_webpages "https://github.com/torresjade100-ping/capstone-jem/tree/main/frontend/src/pages"
click node_mobileapp "https://github.com/torresjade100-ping/capstone-jem/blob/main/mobile/App.js"
click node_mobileapi "https://github.com/torresjade100-ping/capstone-jem/blob/main/mobile/src/api/mobileApi.js"
click node_routes "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/routes/api.php"
click node_auth "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/AuthController.php"
click node_customerorders "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/OrderController.php"
click node_orderops "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/Admin/OrderController.php"
click node_backorderapi "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/Admin/BackorderController.php"
click node_backordersvc "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Services/BackorderService.php"
click node_productapi "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/Admin/ProductController.php"
click node_inventoryapi "https://github.com/torresjade100-ping/capstone-jem/tree/main/backend/app/Http/Controllers/Api/Admin"
click node_transactions "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/TransactionController.php"
click node_paymentmanager "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Services/Payments/PaymentManager.php"
click node_audit "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Services/AuditService.php"
click node_productdata "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/Product.php"
click node_variantdata "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/ProductVariant.php"
click node_orderdata "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/Order.php"
click node_backorderdata "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/Backorder.php"
click node_userdata "https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/User.php"

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_webapp,node_webpages,node_mobileapp,node_mobileapi toneBlue
class node_routes,node_auth toneAmber
class node_customerorders,node_orderops,node_transactions,node_paymentmanager toneMint
class node_backorderapi,node_backordersvc,node_productapi,node_inventoryapi,node_audit toneRose
class node_productdata,node_variantdata,node_orderdata,node_backorderdata,node_userdata,node_customer,node_staff toneIndigo
```

## Components

### Customer and Staff Apps

- [Web Operations App](https://github.com/torresjade100-ping/capstone-jem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Operations Pages](https://github.com/torresjade100-ping/capstone-jem/tree/main/frontend/src/pages): `frontend/src/pages`
- [Customer Mobile App](https://github.com/torresjade100-ping/capstone-jem/blob/main/mobile/App.js): `mobile/App.js`
- [Mobile API Client](https://github.com/torresjade100-ping/capstone-jem/blob/main/mobile/src/api/mobileApi.js): `mobile/src/api/mobileApi.js`

### API Entry Points

- [API Routes](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Authentication API](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/AuthController.php): `backend/app/Http/Controllers/Api/AuthController.php`

### Commerce Operations

- [Customer Order API](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/OrderController.php): `backend/app/Http/Controllers/Api/OrderController.php`
- [Order Operations API](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/Admin/OrderController.php): `backend/app/Http/Controllers/Api/Admin/OrderController.php`
- [POS and Transaction APIs](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/TransactionController.php): `backend/app/Http/Controllers/Api/TransactionController.php`
- [Payment Manager](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Services/Payments/PaymentManager.php): `backend/app/Services/Payments/PaymentManager.php`

### Inventory and Admin

- [Backorder API](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/Admin/BackorderController.php): `backend/app/Http/Controllers/Api/Admin/BackorderController.php`
- [Backorder Service](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Services/BackorderService.php): `backend/app/Services/BackorderService.php`
- [Product Management API](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Http/Controllers/Api/Admin/ProductController.php): `backend/app/Http/Controllers/Api/Admin/ProductController.php`
- [Inventory and Purchasing APIs](https://github.com/torresjade100-ping/capstone-jem/tree/main/backend/app/Http/Controllers/Api/Admin): `backend/app/Http/Controllers/Api/Admin`
- [Audit Service](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Services/AuditService.php): `backend/app/Services/AuditService.php`

### Domain Data

- [Product Catalog Data](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/Product.php): `backend/app/Models/Product.php`
- [Product Variant Data](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/ProductVariant.php): `backend/app/Models/ProductVariant.php`
- [Orders and Items](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/Order.php): `backend/app/Models/Order.php`
- [Backorder Data](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/Backorder.php): `backend/app/Models/Backorder.php`
- [User and Customer Data](https://github.com/torresjade100-ping/capstone-jem/blob/main/backend/app/Models/User.php): `backend/app/Models/User.php`

### Other components

- **Customer**
- **Staff / Admin**

## Connections

- Customer → Customer Mobile App: uses
- Staff / Admin → Web Operations App: uses
- Web Operations App → Operations Pages: routes by role (evidence: `frontend/src/App.jsx`)
- Customer Mobile App → Mobile API Client: calls (evidence: `mobile/App.js`)
- API Routes → Authentication API: routes to (evidence: `backend/routes/api.php`)
- API Routes → Product Management API: routes to (evidence: `backend/routes/api.php`)
- API Routes → Customer Order API: routes to (evidence: `backend/routes/api.php`)
- API Routes → Inventory and Purchasing APIs: routes to (evidence: `backend/routes/api.php`)
- API Routes → Backorder API: routes to (evidence: `backend/routes/api.php`)
- API Routes → POS and Transaction APIs: routes to (evidence: `backend/routes/api.php`)
- Customer Order API → Backorder Service: delegates to (evidence: `backend/app/Http/Controllers/Api/OrderController.php`)
- Backorder API → Backorder Service: delegates to (evidence: `backend/app/Http/Controllers/Api/Admin/BackorderController.php`)
- Backorder Service → Backorder Data: reads and updates (evidence: `backend/app/Services/BackorderService.php`)
- Backorder Service → Orders and Items: updates (evidence: `backend/app/Services/BackorderService.php`)
- Backorder Service → Product Catalog Data: checks stock (evidence: `backend/app/Services/BackorderService.php`)
- Backorder Service → Product Variant Data: checks stock (evidence: `backend/app/Services/BackorderService.php`)
- Customer Order API → Orders and Items: creates orders (evidence: `backend/app/Http/Controllers/Api/OrderController.php`)
- Product Management API → Product Catalog Data: manages (evidence: `backend/app/Http/Controllers/Api/Admin/ProductController.php`)
- POS and Transaction APIs → Audit Service: records audit (evidence: `backend/app/Http/Controllers/Api/TransactionController.php`)
- Product Catalog Data → Product Variant Data: has variants (evidence: `backend/app/Models/Product.php`)
- Orders and Items → Backorder Data: has backorders (evidence: `backend/app/Models/Order.php`)
- Orders and Items → User and Customer Data: belongs to customer (evidence: `backend/app/Models/Order.php`)
