How anmolmehra435/looma works
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: App.tsx App.tsx · DesignCanvas.tsx Design Canvas · DesignCategories.tsx Categories · Studio.tsx Studio
Components 29
SPA shell
Client app entry, routing, pages, and global styling.
- index.html · HTML entry point for the SPA.
index.html - main.tsx · Mounts the React application.
src/main.tsx - App.tsx · Top-level composition and route wiring.
src/App.tsx - Index · Landing page entry route.
src/pages/Index.tsx - Explore · Browsing and discovery route.
src/pages/Explore.tsx - Delivery · Fulfillment and delivery route.
src/pages/Delivery.tsx - Track Orders · Order tracking route.
src/pages/TrackOrders.tsx - Not Found · Fallback route for unknown paths.
src/pages/NotFound.tsx - Navbar · Top-level navigation shell for public pages.
src/components/Navbar.tsx - Hero · Landing-page hero content.
src/components/HeroSection.tsx - Contact · Contact/conversion section.
src/components/ContactSection.tsx
Studio workflow
Design workspace, asset tools, canvas, and 3D preview.
- Studio · Primary design workspace route.
src/pages/Studio.tsx - Design Canvas · Primary design composition surface.
src/components/DesignCanvas.tsx - Categories · Category navigation for studio assets.
src/components/DesignCategories.tsx - Templates · Template browsing and selection.
src/components/TemplatesTool.tsx - Logos · Logo browsing and selection.
src/components/LogoTool.tsx - Images · Image browsing and selection.
src/components/ImagesTool.tsx - Illustrations · Illustration browsing and selection.
src/components/IllustrationsTool.tsx - Model Viewer · Renders the garment preview model.
src/components/ModelViewer.tsx
Shared UI
Reusable UI primitives, hooks, and helpers.
- Error Boundary · Contains render-time failures.
src/components/ErrorBoundary.tsx - UI Primitives · Shared shadcn-style UI building blocks.
src/components/ui/button.tsx - Hooks & Utils · Responsive and toast helpers plus utility composition.
src/hooks/use-mobile.tsx
Static assets
Files served directly by the client bundle.
- Tshirt GLB · Static 3D garment model used by the viewer.
public/Animated Walking Tshirt.glb - robots.txt · Crawler instructions served from public assets.
public/robots.txt
Build tooling
Vite, TypeScript, and CSS/tooling boundaries.
- index.css · Global styling and Tailwind entry styles.
src/index.css - App.css · App-specific styling overrides.
src/App.css - vite.config.ts · Vite dev server and bundling configuration.
vite.config.ts - tailwind.config.ts · Tailwind theme and utility configuration.
tailwind.config.ts - postcss.config.js · PostCSS pipeline configuration.
postcss.config.js
Connections 35
- 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.