# donyamousa/frameit-ar-eyeweartryon architecture

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

- Interactive diagram: https://gitdiagram.com/donyamousa/frameit-ar-eyeweartryon
- Repository: https://github.com/donyamousa/frameit-ar-eyeweartryon

## Overview

FrameIt is an eyewear commerce platform with an AR try-on experience. The customer journey spans catalog browsing, product selection, virtual try-on, cart, checkout, and order history; the admin journey manages products, 3D assets, images, and orders. The graph also shows the API routing and persistence layer. The repository contains both `backend` and legacy `backEnd` servers; sampled evidence supports their separate route surfaces, but does not establish that they are one runtime. AR helper wiring and several page-to-API calls were not sampled, so those links are marked unverified or omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/App.jsx) (Route application), [`backend/src/routes/adminRoutes.js`](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/routes/adminRoutes.js) (Admin routes), [`backend/src/server.js`](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/server.js) (FrameIt API), [`client/src/pages/TryOn.jsx`](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/TryOn.jsx) (AR try-on)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer experience"]
  node_app["Route application<br/>[App.jsx]"]
  node_catalog["Browse catalog<br/>[Shop.jsx]"]
  node_product["Product details<br/>[ProductDetail.jsx]"]
  node_cart["Cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_orders["Order history<br/>[Orders.jsx]"]
  node_authui["Account access<br/>[SignIn.jsx]"]
end

subgraph group_ar["Virtual try-on"]
  node_tryon["AR try-on<br/>[TryOn.jsx]"]
  node_facehelpers["Face and render helpers"]
  node_three["Three.js runtime<br/>[three.js]"]
  node_gltf["GLTF loader<br/>[GLTFLoader.js]"]
end

subgraph group_commerce["Commerce API"]
  node_api["FrameIt API<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_authcontroller["Authentication<br/>[authController.js]"]
  node_orderroutes["Order routes<br/>[orderRoutes.js]"]
  node_ordercontroller["Order handling<br/>[orderController.js]"]
  node_legacyapi["Legacy catalog and user API<br/>[server.js]"]
  node_legacyproducts["Legacy product handlers"]
  node_legacyusers["Legacy user handlers<br/>[userController.js]"]
end

subgraph group_admin["Admin operations"]
  node_adminui["Admin workspace<br/>[AdminDashboard.jsx]"]
  node_addglasses["Add eyewear<br/>[AddGlasses.jsx]"]
  node_imageupdate["Product images"]
  node_adminroutes["Admin routes<br/>[adminRoutes.js]"]
  node_admincontroller["Product management<br/>[adminController.js]"]
  node_upload["Upload handling<br/>[upload.js]"]
  node_modelprocess["GLTF processing"]
end

subgraph group_data["Persistence and assets"]
  node_geometry["Blender geometry export<br/>[geometry.py]"]
  node_products[("Product records<br/>[Product.js]")]
  node_glassesmodels[("3D model records<br/>[GlassesModel.js]")]
  node_users[("User records<br/>[User.js]")]
  node_admins[("Admin records<br/>[Admin.js]")]
  node_orderstore[("Order records<br/>[Order.js]")]
  node_legacyproductstore[("Legacy products<br/>[Product.js]")]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_product
node_app -->|"routes to"| node_tryon
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_authui
node_tryon -.->|"uses"| node_facehelpers
node_tryon -.->|"renders with"| node_three
node_tryon -.->|"loads models"| node_gltf
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_orderroutes
node_api -->|"mounts"| node_adminroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"reads and writes"| node_users
node_authcontroller -->|"reads and writes"| node_admins
node_orderroutes -->|"dispatches"| node_ordercontroller
node_ordercontroller -->|"reads and writes"| node_orderstore
node_ordercontroller -->|"reads"| node_products
node_api -->|"serves catalog"| node_products
node_api -->|"serves models"| node_glassesmodels
node_adminui -.->|"manages via API"| node_adminroutes
node_addglasses -.->|"uploads via API"| node_adminroutes
node_imageupdate -.->|"updates via API"| node_adminroutes
node_adminroutes -->|"dispatches"| node_admincontroller
node_adminroutes -->|"configures"| node_upload
node_admincontroller -->|"processes GLTF"| node_modelprocess
node_admincontroller -->|"reads and writes"| node_products
node_admincontroller -->|"writes"| node_glassesmodels
node_legacyapi -->|"routes catalog"| node_legacyproducts
node_legacyapi -->|"routes accounts"| node_legacyusers
node_legacyproducts -->|"reads and writes"| node_legacyproductstore

click node_app "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/App.jsx"
click node_catalog "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/Shop.jsx"
click node_product "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/ProductDetail.jsx"
click node_cart "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/Cart.jsx"
click node_checkout "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/Checkout.jsx"
click node_orders "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/Orders.jsx"
click node_authui "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/SignIn.jsx"
click node_tryon "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/TryOn.jsx"
click node_facehelpers "https://github.com/donyamousa/frameit-ar-eyeweartryon/tree/main/backend/src/public/helpers"
click node_three "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/public/libs/three/v112/three.js"
click node_gltf "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/public/libs/three/v112/GLTFLoader.js"
click node_api "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/server.js"
click node_authroutes "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/routes/authRoutes.js"
click node_authcontroller "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/controllers/authController.js"
click node_orderroutes "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/routes/orderRoutes.js"
click node_ordercontroller "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/controllers/orderController.js"
click node_adminui "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/AdminDashboard.jsx"
click node_addglasses "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/AddGlasses.jsx"
click node_imageupdate "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/UpdateProductImages.jsx"
click node_adminroutes "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/routes/adminRoutes.js"
click node_admincontroller "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/controllers/adminController.js"
click node_upload "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/middleware/upload.js"
click node_modelprocess "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/utils/processGLTFModel.js"
click node_geometry "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/libs/three/blenderExporter/io_three/exporter/geometry.py"
click node_products "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/Product.js"
click node_glassesmodels "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/GlassesModel.js"
click node_users "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/User.js"
click node_admins "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/Admin.js"
click node_orderstore "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/Order.js"
click node_legacyapi "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backEnd/server.js"
click node_legacyproducts "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backEnd/controllers/productController.js"
click node_legacyusers "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backEnd/controllers/userController.js"
click node_legacyproductstore "https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backEnd/models/Product.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_app,node_catalog,node_product,node_cart,node_checkout,node_orders,node_authui toneBlue
class node_tryon,node_facehelpers,node_three,node_gltf toneAmber
class node_api,node_authroutes,node_authcontroller,node_orderroutes,node_ordercontroller,node_legacyapi,node_legacyproducts,node_legacyusers toneMint
class node_adminui,node_addglasses,node_imageupdate,node_adminroutes,node_admincontroller,node_upload,node_modelprocess toneRose
class node_geometry,node_products,node_glassesmodels,node_users,node_admins,node_orderstore,node_legacyproductstore,node_shopper toneIndigo
```

## Components

### Customer experience

- [Route application](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Browse catalog](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/Shop.jsx): `client/src/pages/Shop.jsx`
- [Product details](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/ProductDetail.jsx): `client/src/pages/ProductDetail.jsx`
- [Cart](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/Cart.jsx): `client/src/pages/Cart.jsx`
- [Checkout](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/Checkout.jsx): `client/src/pages/Checkout.jsx`
- [Order history](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/Orders.jsx): `client/src/pages/Orders.jsx`
- [Account access](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/SignIn.jsx): `client/src/pages/SignIn.jsx`

### Virtual try-on

- [AR try-on](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/TryOn.jsx): `client/src/pages/TryOn.jsx`
- [Face and render helpers](https://github.com/donyamousa/frameit-ar-eyeweartryon/tree/main/backend/src/public/helpers): `backend/src/public/helpers`
- [Three.js runtime](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/public/libs/three/v112/three.js): `backend/src/public/libs/three/v112/three.js`
- [GLTF loader](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/public/libs/three/v112/GLTFLoader.js): `backend/src/public/libs/three/v112/GLTFLoader.js`

### Commerce API

- [FrameIt API](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/server.js): `backend/src/server.js`
- [Authentication routes](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/routes/authRoutes.js): `backend/src/routes/authRoutes.js`
- [Authentication](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Order routes](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/routes/orderRoutes.js): `backend/src/routes/orderRoutes.js`
- [Order handling](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/controllers/orderController.js): `backend/src/controllers/orderController.js`
- [Legacy catalog and user API](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backEnd/server.js): `backEnd/server.js`
- [Legacy product handlers](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backEnd/controllers/productController.js): `backEnd/controllers/productController.js`
- [Legacy user handlers](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backEnd/controllers/userController.js): `backEnd/controllers/userController.js`

### Admin operations

- [Admin workspace](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/AdminDashboard.jsx): `client/src/pages/AdminDashboard.jsx`
- [Add eyewear](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/AddGlasses.jsx): `client/src/pages/AddGlasses.jsx`
- [Product images](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/client/src/pages/UpdateProductImages.jsx): `client/src/pages/UpdateProductImages.jsx`
- [Admin routes](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/routes/adminRoutes.js): `backend/src/routes/adminRoutes.js`
- [Product management](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/controllers/adminController.js): `backend/src/controllers/adminController.js`
- [Upload handling](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/middleware/upload.js): `backend/src/middleware/upload.js`
- [GLTF processing](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/utils/processGLTFModel.js): `backend/src/utils/processGLTFModel.js`

### Persistence and assets

- [Blender geometry export](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/libs/three/blenderExporter/io_three/exporter/geometry.py): `backend/libs/three/blenderExporter/io_three/exporter/geometry.py`
- [Product records](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/Product.js): `backend/src/models/Product.js`
- [3D model records](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/GlassesModel.js): `backend/src/models/GlassesModel.js`
- [User records](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Admin records](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/Admin.js): `backend/src/models/Admin.js`
- [Order records](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backend/src/models/Order.js): `backend/src/models/Order.js`
- [Legacy products](https://github.com/donyamousa/frameit-ar-eyeweartryon/blob/main/backEnd/models/Product.js): `backEnd/models/Product.js`

### Other components

- **Shopper**

## Connections

- Shopper → Route application: uses
- Route application → Browse catalog: routes to (evidence: `client/src/App.jsx`)
- Route application → Product details: routes to (evidence: `client/src/App.jsx`)
- Route application → AR try-on: routes to (evidence: `client/src/App.jsx`)
- Route application → Cart: routes to (evidence: `client/src/App.jsx`)
- Route application → Checkout: routes to (evidence: `client/src/App.jsx`)
- Route application → Order history: routes to (evidence: `client/src/App.jsx`)
- Route application → Account access: routes to (evidence: `client/src/App.jsx`)
- AR try-on → Face and render helpers: uses
- AR try-on → Three.js runtime: renders with
- AR try-on → GLTF loader: loads models
- FrameIt API → Authentication routes: mounts (evidence: `backend/src/server.js`)
- FrameIt API → Order routes: mounts (evidence: `backend/src/server.js`)
- FrameIt API → Admin routes: mounts (evidence: `backend/src/server.js`)
- Authentication routes → Authentication: dispatches (evidence: `backend/src/routes/authRoutes.js`)
- Authentication → User records: reads and writes (evidence: `backend/src/controllers/authController.js`)
- Authentication → Admin records: reads and writes (evidence: `backend/src/controllers/authController.js`)
- Order routes → Order handling: dispatches (evidence: `backend/src/routes/orderRoutes.js`)
- Order handling → Order records: reads and writes (evidence: `backend/src/controllers/orderController.js`)
- Order handling → Product records: reads (evidence: `backend/src/controllers/orderController.js`)
- FrameIt API → Product records: serves catalog (evidence: `backend/src/server.js`)
- FrameIt API → 3D model records: serves models (evidence: `backend/src/server.js`)
- Admin workspace → Admin routes: manages via API
- Add eyewear → Admin routes: uploads via API
- Product images → Admin routes: updates via API
- Admin routes → Product management: dispatches (evidence: `backend/src/routes/adminRoutes.js`)
- Admin routes → Upload handling: configures (evidence: `backend/src/routes/adminRoutes.js`)
- Product management → GLTF processing: processes GLTF (evidence: `backend/src/controllers/adminController.js`)
- Product management → Product records: reads and writes (evidence: `backend/src/controllers/adminController.js`)
- Product management → 3D model records: writes (evidence: `backend/src/controllers/adminController.js`)
- Legacy catalog and user API → Legacy product handlers: routes catalog (evidence: `backEnd/server.js`)
- Legacy catalog and user API → Legacy user handlers: routes accounts (evidence: `backEnd/server.js`)
- Legacy product handlers → Legacy products: reads and writes (evidence: `backEnd/controllers/productController.js`)
