# m-wajith/shirt-visualizer architecture

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

- Interactive diagram: https://gitdiagram.com/m-wajith/shirt-visualizer
- Repository: https://github.com/m-wajith/shirt-visualizer

## Overview

Shirt-Fy combines a public shirt-customization experience with a backend fabric catalog and admin-user endpoint. Visitors browse fabrics, choose fit, sleeve, and collar options, and the customization component passes selections and a fabric image to the 3D view. The backend exposes fabric reads and uploads plus admin creation, backed by MongoDB models. The sampled sources show the fabric-image fetch and backend route wiring; they do not establish how the app page mounts its sections or how the 3D view loads model assets.

Main entry points: [`frontend/components/Hero.tsx`](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Hero.tsx) (Landing sections), [`backend/server.js`](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/server.js) (Express API server), [`frontend/components/Cutomization.tsx`](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Cutomization.tsx) (Customization studio), [`frontend/components/Navbar.tsx`](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Navbar.tsx) (Section navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_site["Next app shell<br/>[layout.tsx]"]
  node_landing["Landing sections<br/>[Hero.tsx]"]
  node_navigation["Section navigation<br/>[Navbar.tsx]"]
  node_sign_in["Sign-in modal<br/>[Signin.tsx]"]
  node_introduction["Introduction<br/>[Intro.tsx]"]
  node_about["About section<br/>[About.tsx]"]
  node_contact["Contact section<br/>[Contact.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_customization["Customization studio<br/>[Cutomization.tsx]"]
  node_three_d["3D shirt view<br/>[Threed.tsx]"]
  node_model_assets["3D model assets"]
end

subgraph group_catalog["Fabric catalog API"]
  node_backend["Express API server<br/>[server.js]"]
  node_fabric_routes["Fabric routes<br/>[fabricRoutes.js]"]
  node_fabric_controller["Fabric operations"]
end

subgraph group_accounts["Admin accounts"]
  node_admin_routes["Admin routes<br/>[userRoutes.js]"]
  node_admin_controller["Admin creation<br/>[userController.js]"]
end

subgraph group_persistence["Persistence"]
  node_fabric_model["Fabric schema<br/>[fabricModel.js]"]
  node_user_model["User schema<br/>[user.js]"]
  node_db_connection["DB connection<br/>[db.js]"]
end

node_visitor(("Visitor"))
node_mongo[("MongoDB")]

node_landing -->|"renders"| node_navigation
node_landing -->|"renders"| node_introduction
node_landing -->|"renders"| node_customization
node_landing -->|"renders"| node_about
node_landing -->|"renders"| node_contact
node_landing -->|"renders"| node_footer
node_navigation -->|"opens"| node_sign_in
node_customization -->|"renders with choices"| node_three_d
node_customization -->|"fetches fabric images"| node_backend
node_backend -->|"connects through"| node_db_connection
node_backend -->|"mounts routes"| node_fabric_routes
node_backend -->|"mounts routes"| node_admin_routes
node_fabric_routes -->|"dispatches"| node_fabric_controller
node_fabric_controller -->|"queries and saves"| node_fabric_model
node_admin_routes -->|"dispatches"| node_admin_controller
node_admin_controller -->|"creates and saves"| node_user_model
node_fabric_model -.->|"persists via Mongoose"| node_mongo
node_user_model -.->|"persists via Mongoose"| node_mongo
node_db_connection -->|"connects"| node_mongo

click node_site "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/app/layout.tsx"
click node_landing "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Hero.tsx"
click node_navigation "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Navbar.tsx"
click node_sign_in "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Signin.tsx"
click node_introduction "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Intro.tsx"
click node_about "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/About.tsx"
click node_contact "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Contact.tsx"
click node_footer "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Footer.tsx"
click node_customization "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Cutomization.tsx"
click node_three_d "https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Threed.tsx"
click node_model_assets "https://github.com/m-wajith/shirt-visualizer/tree/main/frontend/public/models"
click node_backend "https://github.com/m-wajith/shirt-visualizer/blob/main/backend/server.js"
click node_fabric_routes "https://github.com/m-wajith/shirt-visualizer/blob/main/backend/routes/fabricRoutes.js"
click node_fabric_controller "https://github.com/m-wajith/shirt-visualizer/blob/main/backend/controllers/fabricController.js"
click node_fabric_model "https://github.com/m-wajith/shirt-visualizer/blob/main/backend/models/fabricModel.js"
click node_admin_routes "https://github.com/m-wajith/shirt-visualizer/blob/main/backend/routes/userRoutes.js"
click node_admin_controller "https://github.com/m-wajith/shirt-visualizer/blob/main/backend/controllers/userController.js"
click node_user_model "https://github.com/m-wajith/shirt-visualizer/blob/main/backend/models/user.js"
click node_db_connection "https://github.com/m-wajith/shirt-visualizer/blob/main/backend/config/db.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_site,node_landing,node_navigation,node_sign_in,node_introduction,node_about,node_contact,node_footer,node_customization,node_three_d,node_model_assets toneBlue
class node_backend,node_fabric_routes,node_fabric_controller,node_mongo toneAmber
class node_admin_routes,node_admin_controller toneMint
class node_fabric_model,node_user_model,node_db_connection toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Next app shell](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/app/layout.tsx): `frontend/app/layout.tsx`
- [Landing sections](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Hero.tsx): `frontend/components/Hero.tsx`
- [Section navigation](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Navbar.tsx): `frontend/components/Navbar.tsx`
- [Sign-in modal](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Signin.tsx): `frontend/components/Signin.tsx`
- [Introduction](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Intro.tsx): `frontend/components/Intro.tsx`
- [About section](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/About.tsx): `frontend/components/About.tsx`
- [Contact section](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Contact.tsx): `frontend/components/Contact.tsx`
- [Footer](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Footer.tsx): `frontend/components/Footer.tsx`
- [Customization studio](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Cutomization.tsx): `frontend/components/Cutomization.tsx`
- [3D shirt view](https://github.com/m-wajith/shirt-visualizer/blob/main/frontend/components/Threed.tsx): `frontend/components/Threed.tsx`
- [3D model assets](https://github.com/m-wajith/shirt-visualizer/tree/main/frontend/public/models): `frontend/public/models`

### Fabric catalog API

- [Express API server](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/server.js): `backend/server.js`
- [Fabric routes](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/routes/fabricRoutes.js): `backend/routes/fabricRoutes.js`
- [Fabric operations](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/controllers/fabricController.js): `backend/controllers/fabricController.js`

### Admin accounts

- [Admin routes](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/routes/userRoutes.js): `backend/routes/userRoutes.js`
- [Admin creation](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`

### Persistence

- [Fabric schema](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/models/fabricModel.js): `backend/models/fabricModel.js`
- [User schema](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/models/user.js): `backend/models/user.js`
- [DB connection](https://github.com/m-wajith/shirt-visualizer/blob/main/backend/config/db.js): `backend/config/db.js`

### Other components

- **Visitor**
- **MongoDB**

## Connections

- Landing sections → Section navigation: renders (evidence: `frontend/components/Hero.tsx`)
- Landing sections → Introduction: renders (evidence: `frontend/components/Hero.tsx`)
- Landing sections → Customization studio: renders (evidence: `frontend/components/Hero.tsx`)
- Landing sections → About section: renders (evidence: `frontend/components/Hero.tsx`)
- Landing sections → Contact section: renders (evidence: `frontend/components/Hero.tsx`)
- Landing sections → Footer: renders (evidence: `frontend/components/Hero.tsx`)
- Section navigation → Sign-in modal: opens (evidence: `frontend/components/Navbar.tsx`)
- Customization studio → 3D shirt view: renders with choices (evidence: `frontend/components/Cutomization.tsx`)
- Customization studio → Express API server: fetches fabric images (evidence: `frontend/components/Cutomization.tsx`)
- Express API server → DB connection: connects through (evidence: `backend/server.js`)
- Express API server → Fabric routes: mounts routes (evidence: `backend/server.js`)
- Express API server → Admin routes: mounts routes (evidence: `backend/server.js`)
- Fabric routes → Fabric operations: dispatches (evidence: `backend/routes/fabricRoutes.js`)
- Fabric operations → Fabric schema: queries and saves (evidence: `backend/controllers/fabricController.js`)
- Admin routes → Admin creation: dispatches (evidence: `backend/routes/userRoutes.js`)
- Admin creation → User schema: creates and saves (evidence: `backend/controllers/userController.js`)
- Fabric schema → MongoDB: persists via Mongoose
- User schema → MongoDB: persists via Mongoose
- DB connection → MongoDB: connects (evidence: `backend/config/db.js`)
