# anmolmehra435/looma architecture

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

- Interactive diagram: https://gitdiagram.com/anmolmehra435/looma
- Repository: https://github.com/anmolmehra435/looma

## Overview

1. **Overall shape**
   - This is a **client-side React single-page application** built with **Vite, TypeScript, Tailwind CSS, and shadcn/ui**.
   - The repository tree shows **no dedicated backend service, API layer, or database code**, so the architecture is primarily **UI composition + local interaction state**.

2. **Application shell and bootstrap**
   - `index.html`, `src/main.tsx`, and `src/App.tsx` form the entry path of the app.
   - Global styling is split between `src/index.css` and `src/App.css`, with Tailwind configured through `tailwind.config.ts` and PostCSS via `postcss.config.js`.
   - `vite.config.ts` is the build/dev server boundary for local development and bundling.

3. **Route-level structure**
   - The app is organized into page modules under `src/pages/`:
     - `Index.tsx`
     - `Studio.tsx`
     - `Explore.tsx`
     - `Delivery.tsx`
     - `TrackOrders.tsx`
     - `NotFound.tsx`
   - These pages likely represent the main user journey: landing, browsing, designing, fulfillment/delivery, and order tracking.

4. **Marketing and navigation layer**
   - `Navbar.tsx`, `HeroSection.tsx`, and `ContactSection.tsx` compose the public-facing shell around the app.
   - This layer appears to handle navigation and conversion-oriented content, separate from the design workspace.

5. **Core studio/workbench subsystem**
   - The design experience is centered in `Studio.tsx` and the related feature components:
     - `DesignCanvas.tsx`
     - `DesignCategories.tsx`
     - `TemplatesTool.tsx`
     - `LogosTool.tsx`
     - `ImagesTool.tsx`
     - `IllustrationsTool.tsx`
   - These components indicate a **tool-based editor** where users choose asset categories and place them into a canvas/design surface.

6. **3D preview subsystem**
   - `ModelViewer.tsx` plus the asset `public/Animated Walking Tshirt.glb` indicate a **3D garment preview** capability.
   - This is likely the visual output layer for the studio, where the user’s design choices are reflected on a 3D shirt model.

7. **Data flow inside the studio**
   - The most likely flow is:
     - user selects a category/template/asset in a tool component,
     - the selection updates the design canvas state,
     - the canvas and/or model viewer renders the current design preview.
   - This creates a clear boundary between **tool selection**, **design state**, and **rendered preview**.

8. **Shared UI component library**
   - `src/components/ui/` contains a large set of reusable primitives: buttons, dialogs, sheets, tabs, sliders, tables, tooltips, toasts, and more.
   - These are standard shadcn-style building blocks used across pages and tools to keep the feature components thin and consistent.

9. **Cross-cutting interaction utilities**
   - `src/hooks/use-toast.ts` and `src/components/ui/toaster.tsx` provide a global notification path for user feedback.
   - `src/hooks/use-mobile.tsx` suggests responsive behavior is handled in-app rather than by separate server-side rendering concerns.
   - `src/lib/utils.ts` is the shared utility boundary for component composition/helpers.

10. **Error and resilience boundaries**
   - `src/components/ErrorBoundary.tsx` indicates explicit containment for render-time failures.
   - This is important in a UI-heavy app with 3D rendering and many composable tools, where one subsystem should fail without collapsing the entire experience.

11. **Static content and assets**
   - `public/` holds runtime assets served directly by the client bundle, including the `.glb` model and `robots.txt`.
   - `src/assets/` likely contains imported images or icons used by the UI, while `src/types/three.d.ts` suggests custom typing support for Three.js-style assets or modules.

12. **Technology and tooling boundaries**
   - The project is TypeScript-first and React-based, with Tailwind for styling and shadcn/ui for component primitives.
   - Presence of both `bun.lockb` and `package-lock.json` suggests the repo has been used with multiple package managers, but the architecture itself is frontend-only and build-tool driven.

13. **What to show in an architecture diagram**
   - Draw one top-level box for the **React SPA**.
   - Inside it, separate:
     - **Page routing layer** (`Index`, `Studio`, `Explore`, `Delivery`, `TrackOrders`)
     - **Studio/editor layer** (`DesignCanvas`, asset tools, `ModelViewer`)
     - **Shared UI layer** (`ui/*`, hooks, utilities)
     - **Static asset layer** (`public/*.glb`, other public files)
   - Emphasize the **Studio → preview/rendering** path as the main product workflow, with navigation and marketing pages as surrounding entry points.

Main entry points: [`src/App.tsx`](https://github.com/anmolmehra435/looma/blob/main/src/App.tsx) (App.tsx), [`src/components/DesignCanvas.tsx`](https://github.com/anmolmehra435/looma/blob/main/src/components/DesignCanvas.tsx) (Design Canvas), [`src/components/DesignCategories.tsx`](https://github.com/anmolmehra435/looma/blob/main/src/components/DesignCategories.tsx) (Categories), [`src/pages/Studio.tsx`](https://github.com/anmolmehra435/looma/blob/main/src/pages/Studio.tsx) (Studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["SPA shell"]
  node_index_html["index.html<br/>entry document<br/>[index.html]"]
  node_main_tsx["main.tsx<br/>bootstrap<br/>[main.tsx]"]
  node_app_tsx["App.tsx<br/>app shell<br/>[App.tsx]"]
  node_index_page["Index<br/>page<br/>[Index.tsx]"]
  node_explore_page["Explore<br/>page<br/>[Explore.tsx]"]
  node_delivery_page["Delivery<br/>page<br/>[Delivery.tsx]"]
  node_track_page["Track Orders<br/>page<br/>[TrackOrders.tsx]"]
  node_notfound_page["Not Found<br/>page<br/>[NotFound.tsx]"]
  node_navbar["Navbar<br/>navigation<br/>[Navbar.tsx]"]
  node_hero["Hero<br/>marketing section<br/>[HeroSection.tsx]"]
  node_contact["Contact<br/>marketing section<br/>[ContactSection.tsx]"]
end

subgraph group_studio["Studio workflow"]
  node_studio_page["Studio<br/>page<br/>[Studio.tsx]"]
  node_design_canvas["Design Canvas<br/>editor surface<br/>[DesignCanvas.tsx]"]
  node_design_categories["Categories<br/>tool selector"]
  node_templates_tool["Templates<br/>asset tool<br/>[TemplatesTool.tsx]"]
  node_logos_tool["Logos<br/>asset tool<br/>[LogoTool.tsx]"]
  node_images_tool["Images<br/>asset tool<br/>[ImagesTool.tsx]"]
  node_illustrations_tool["Illustrations<br/>asset tool"]
  node_model_viewer["Model Viewer<br/>3d preview<br/>[ModelViewer.tsx]"]
end

subgraph group_shared["Shared UI"]
  node_error_boundary["Error Boundary<br/>resilience<br/>[ErrorBoundary.tsx]"]
  node_ui_primitives["UI Primitives<br/>component kit<br/>[button.tsx]"]
  node_hooks_utils["Hooks & Utils<br/>shared helpers<br/>[use-mobile.tsx]"]
end

subgraph group_assets["Static assets"]
  node_public_model[("Tshirt GLB<br/>3d asset")]
  node_public_robots["robots.txt<br/>static file<br/>[robots.txt]"]
end

subgraph group_tooling["Build tooling"]
  node_index_css["index.css<br/>global styles<br/>[index.css]"]
  node_app_css["App.css<br/>app styles<br/>[App.css]"]
  node_vite_config["vite.config.ts<br/>build config<br/>[vite.config.ts]"]
  node_tailwind_config["tailwind.config.ts<br/>style config<br/>[tailwind.config.ts]"]
  node_postcss_config["postcss.config.js<br/>style config<br/>[postcss.config.js]"]
end

node_index_html -->|"loads"| node_main_tsx
node_main_tsx -->|"mounts"| node_app_tsx
node_app_tsx -->|"routes"| node_index_page
node_app_tsx -->|"routes"| node_studio_page
node_app_tsx -->|"routes"| node_explore_page
node_app_tsx -->|"routes"| node_delivery_page
node_app_tsx -->|"routes"| node_track_page
node_app_tsx -->|"fallback"| node_notfound_page
node_index_page -->|"uses"| node_navbar
node_index_page -->|"composes"| node_hero
node_index_page -->|"composes"| node_contact
node_studio_page -->|"coordinates"| node_design_categories
node_studio_page -->|"drives"| node_design_canvas
node_studio_page -->|"previews"| node_model_viewer
node_design_categories -->|"switches"| node_templates_tool
node_design_categories -->|"switches"| node_logos_tool
node_design_categories -->|"switches"| node_images_tool
node_design_categories -->|"switches"| node_illustrations_tool
node_templates_tool -->|"adds assets"| node_design_canvas
node_logos_tool -->|"adds assets"| node_design_canvas
node_images_tool -->|"adds assets"| node_design_canvas
node_illustrations_tool -->|"adds assets"| node_design_canvas
node_design_canvas -->|"syncs"| node_model_viewer
node_model_viewer -->|"loads"| node_public_model
node_error_boundary -.->|"wraps"| node_studio_page
node_ui_primitives -->|"supports"| node_navbar
node_ui_primitives -->|"supports"| node_design_canvas
node_hooks_utils -->|"supports"| node_design_canvas
node_hooks_utils -->|"supports"| node_ui_primitives
node_index_css -->|"styles"| node_app_tsx
node_app_css -->|"styles"| node_app_tsx
node_tailwind_config -->|"configures"| node_ui_primitives
node_postcss_config -->|"processes"| node_index_css
node_vite_config -->|"bundles"| node_main_tsx
node_public_robots -->|"served with"| node_index_html

click node_index_html "https://github.com/anmolmehra435/looma/blob/main/index.html"
click node_main_tsx "https://github.com/anmolmehra435/looma/blob/main/src/main.tsx"
click node_app_tsx "https://github.com/anmolmehra435/looma/blob/main/src/App.tsx"
click node_index_page "https://github.com/anmolmehra435/looma/blob/main/src/pages/Index.tsx"
click node_studio_page "https://github.com/anmolmehra435/looma/blob/main/src/pages/Studio.tsx"
click node_explore_page "https://github.com/anmolmehra435/looma/blob/main/src/pages/Explore.tsx"
click node_delivery_page "https://github.com/anmolmehra435/looma/blob/main/src/pages/Delivery.tsx"
click node_track_page "https://github.com/anmolmehra435/looma/blob/main/src/pages/TrackOrders.tsx"
click node_notfound_page "https://github.com/anmolmehra435/looma/blob/main/src/pages/NotFound.tsx"
click node_navbar "https://github.com/anmolmehra435/looma/blob/main/src/components/Navbar.tsx"
click node_hero "https://github.com/anmolmehra435/looma/blob/main/src/components/HeroSection.tsx"
click node_contact "https://github.com/anmolmehra435/looma/blob/main/src/components/ContactSection.tsx"
click node_design_canvas "https://github.com/anmolmehra435/looma/blob/main/src/components/DesignCanvas.tsx"
click node_design_categories "https://github.com/anmolmehra435/looma/blob/main/src/components/DesignCategories.tsx"
click node_templates_tool "https://github.com/anmolmehra435/looma/blob/main/src/components/TemplatesTool.tsx"
click node_logos_tool "https://github.com/anmolmehra435/looma/blob/main/src/components/LogoTool.tsx"
click node_images_tool "https://github.com/anmolmehra435/looma/blob/main/src/components/ImagesTool.tsx"
click node_illustrations_tool "https://github.com/anmolmehra435/looma/blob/main/src/components/IllustrationsTool.tsx"
click node_model_viewer "https://github.com/anmolmehra435/looma/blob/main/src/components/ModelViewer.tsx"
click node_error_boundary "https://github.com/anmolmehra435/looma/blob/main/src/components/ErrorBoundary.tsx"
click node_ui_primitives "https://github.com/anmolmehra435/looma/blob/main/src/components/ui/button.tsx"
click node_hooks_utils "https://github.com/anmolmehra435/looma/blob/main/src/hooks/use-mobile.tsx"
click node_index_css "https://github.com/anmolmehra435/looma/blob/main/src/index.css"
click node_app_css "https://github.com/anmolmehra435/looma/blob/main/src/App.css"
click node_public_model "https://github.com/anmolmehra435/looma/blob/main/public/Animated Walking Tshirt.glb"
click node_public_robots "https://github.com/anmolmehra435/looma/blob/main/public/robots.txt"
click node_vite_config "https://github.com/anmolmehra435/looma/blob/main/vite.config.ts"
click node_tailwind_config "https://github.com/anmolmehra435/looma/blob/main/tailwind.config.ts"
click node_postcss_config "https://github.com/anmolmehra435/looma/blob/main/postcss.config.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_index_html,node_main_tsx,node_app_tsx,node_index_page,node_explore_page,node_delivery_page,node_track_page,node_notfound_page,node_navbar,node_hero,node_contact toneBlue
class node_studio_page,node_design_canvas,node_design_categories,node_templates_tool,node_logos_tool,node_images_tool,node_illustrations_tool,node_model_viewer toneAmber
class node_error_boundary,node_ui_primitives,node_hooks_utils toneMint
class node_public_model,node_public_robots toneRose
class node_index_css,node_app_css,node_vite_config,node_tailwind_config,node_postcss_config toneIndigo
```

## Components

### SPA shell

Client app entry, routing, pages, and global styling.

- [index.html](https://github.com/anmolmehra435/looma/blob/main/index.html): entry document · HTML entry point for the SPA. · `index.html`
- [main.tsx](https://github.com/anmolmehra435/looma/blob/main/src/main.tsx): bootstrap · Mounts the React application. · `src/main.tsx`
- [App.tsx](https://github.com/anmolmehra435/looma/blob/main/src/App.tsx): app shell · Top-level composition and route wiring. · `src/App.tsx`
- [Index](https://github.com/anmolmehra435/looma/blob/main/src/pages/Index.tsx): page · Landing page entry route. · `src/pages/Index.tsx`
- [Explore](https://github.com/anmolmehra435/looma/blob/main/src/pages/Explore.tsx): page · Browsing and discovery route. · `src/pages/Explore.tsx`
- [Delivery](https://github.com/anmolmehra435/looma/blob/main/src/pages/Delivery.tsx): page · Fulfillment and delivery route. · `src/pages/Delivery.tsx`
- [Track Orders](https://github.com/anmolmehra435/looma/blob/main/src/pages/TrackOrders.tsx): page · Order tracking route. · `src/pages/TrackOrders.tsx`
- [Not Found](https://github.com/anmolmehra435/looma/blob/main/src/pages/NotFound.tsx): page · Fallback route for unknown paths. · `src/pages/NotFound.tsx`
- [Navbar](https://github.com/anmolmehra435/looma/blob/main/src/components/Navbar.tsx): navigation · Top-level navigation shell for public pages. · `src/components/Navbar.tsx`
- [Hero](https://github.com/anmolmehra435/looma/blob/main/src/components/HeroSection.tsx): marketing section · Landing-page hero content. · `src/components/HeroSection.tsx`
- [Contact](https://github.com/anmolmehra435/looma/blob/main/src/components/ContactSection.tsx): marketing section · Contact/conversion section. · `src/components/ContactSection.tsx`

### Studio workflow

Design workspace, asset tools, canvas, and 3D preview.

- [Studio](https://github.com/anmolmehra435/looma/blob/main/src/pages/Studio.tsx): page · Primary design workspace route. · `src/pages/Studio.tsx`
- [Design Canvas](https://github.com/anmolmehra435/looma/blob/main/src/components/DesignCanvas.tsx): editor surface · Primary design composition surface. · `src/components/DesignCanvas.tsx`
- [Categories](https://github.com/anmolmehra435/looma/blob/main/src/components/DesignCategories.tsx): tool selector · Category navigation for studio assets. · `src/components/DesignCategories.tsx`
- [Templates](https://github.com/anmolmehra435/looma/blob/main/src/components/TemplatesTool.tsx): asset tool · Template browsing and selection. · `src/components/TemplatesTool.tsx`
- [Logos](https://github.com/anmolmehra435/looma/blob/main/src/components/LogoTool.tsx): asset tool · Logo browsing and selection. · `src/components/LogoTool.tsx`
- [Images](https://github.com/anmolmehra435/looma/blob/main/src/components/ImagesTool.tsx): asset tool · Image browsing and selection. · `src/components/ImagesTool.tsx`
- [Illustrations](https://github.com/anmolmehra435/looma/blob/main/src/components/IllustrationsTool.tsx): asset tool · Illustration browsing and selection. · `src/components/IllustrationsTool.tsx`
- [Model Viewer](https://github.com/anmolmehra435/looma/blob/main/src/components/ModelViewer.tsx): 3d preview · Renders the garment preview model. · `src/components/ModelViewer.tsx`

### Shared UI

Reusable UI primitives, hooks, and helpers.

- [Error Boundary](https://github.com/anmolmehra435/looma/blob/main/src/components/ErrorBoundary.tsx): resilience · Contains render-time failures. · `src/components/ErrorBoundary.tsx`
- [UI Primitives](https://github.com/anmolmehra435/looma/blob/main/src/components/ui/button.tsx): component kit · Shared shadcn-style UI building blocks. · `src/components/ui/button.tsx`
- [Hooks & Utils](https://github.com/anmolmehra435/looma/blob/main/src/hooks/use-mobile.tsx): shared helpers · Responsive and toast helpers plus utility composition. · `src/hooks/use-mobile.tsx`

### Static assets

Files served directly by the client bundle.

- [Tshirt GLB](https://github.com/anmolmehra435/looma/blob/HEAD/public/Animated%20Walking%20Tshirt.glb): 3d asset · Static 3D garment model used by the viewer. · `public/Animated Walking Tshirt.glb`
- [robots.txt](https://github.com/anmolmehra435/looma/blob/main/public/robots.txt): static file · Crawler instructions served from public assets. · `public/robots.txt`

### Build tooling

Vite, TypeScript, and CSS/tooling boundaries.

- [index.css](https://github.com/anmolmehra435/looma/blob/main/src/index.css): global styles · Global styling and Tailwind entry styles. · `src/index.css`
- [App.css](https://github.com/anmolmehra435/looma/blob/main/src/App.css): app styles · App-specific styling overrides. · `src/App.css`
- [vite.config.ts](https://github.com/anmolmehra435/looma/blob/main/vite.config.ts): build config · Vite dev server and bundling configuration. · `vite.config.ts`
- [tailwind.config.ts](https://github.com/anmolmehra435/looma/blob/main/tailwind.config.ts): style config · Tailwind theme and utility configuration. · `tailwind.config.ts`
- [postcss.config.js](https://github.com/anmolmehra435/looma/blob/main/postcss.config.js): style config · PostCSS pipeline configuration. · `postcss.config.js`

## Connections

- index.html → main.tsx: loads · HTML bootstraps the React entry.
- main.tsx → App.tsx: mounts · Application bootstrap renders the top-level app.
- App.tsx → Index: routes · App selects the landing page.
- App.tsx → Studio: routes · App selects the studio workspace.
- App.tsx → Explore: routes · App selects discovery flows.
- App.tsx → Delivery: routes · App selects fulfillment flows.
- App.tsx → Track Orders: routes · App selects order tracking.
- App.tsx → Not Found: fallback · Unknown routes resolve here.
- Index → Navbar: uses · Landing page shares the navigation shell.
- Index → Hero: composes · Landing page presents the hero section.
- Index → Contact: composes · Landing page includes contact/conversion content.
- Studio → Categories: coordinates · Studio organizes asset choices through categories.
- Studio → Design Canvas: drives · Studio sends selections into the canvas.
- Studio → Model Viewer: previews · Studio connects design state to 3D preview.
- Categories → Templates: switches · Category selection exposes templates.
- Categories → Logos: switches · Category selection exposes logos.
- Categories → Images: switches · Category selection exposes images.
- Categories → Illustrations: switches · Category selection exposes illustrations.
- Templates → Design Canvas: adds assets · Template choice updates the canvas.
- Logos → Design Canvas: adds assets · Logo choice updates the canvas.
- Images → Design Canvas: adds assets · Image choice updates the canvas.
- Illustrations → Design Canvas: adds assets · Illustration choice updates the canvas.
- Design Canvas → Model Viewer: syncs · Canvas state is reflected in the 3D preview.
- Model Viewer → Tshirt GLB: loads · Viewer consumes the static GLB asset.
- Error Boundary → Studio: wraps · Contains runtime failures in the studio flow.
- UI Primitives → Navbar: supports · Navigation uses shared UI building blocks.
- UI Primitives → Design Canvas: supports · Editor uses reusable controls and layouts.
- Hooks & Utils → Design Canvas: supports · Shared hooks and utilities assist editor behavior.
- Hooks & Utils → UI Primitives: supports · Helpers back component composition and feedback.
- index.css → App.tsx: styles · Global styles apply to the app shell.
- App.css → App.tsx: styles · App-specific styles apply to top-level composition.
- tailwind.config.ts → UI Primitives: configures · Tailwind shapes the shared component system.
- postcss.config.js → index.css: processes · PostCSS transforms the global stylesheet.
- vite.config.ts → main.tsx: bundles · Vite builds and serves the React entry.
- robots.txt → index.html: served with · Static public files ship alongside the SPA.
