How ck20831/product-display works
Project type and purpose
• This is a single-page React + TypeScript application built with Vite that delivers an immersive 3D product showcase in the browser.
• There is no separate backend or database; all code lives in src/, and assets (3D models, fonts, images) are served statically from public/.
File structure
• Top-level files:
• index.html – host page
• vite.config.ts, tsconfig.json – build and type configurations
• package.json, .eslintrc.cjs – dependencies, scripts, and lint rules
• src/ contains the React application:
• main.tsx – application entry point (mounts <App />)
• App.tsx – root component orchestrating subcomponents
• components/ImmersiveSession.tsx – likely wraps WebGL/three.js canvas
• components/html/ – UI overlays
• components/product-display/ – group of components handling product listing, grid, sidebar, intro, team info
• components/ui/ – reusable UI pieces (Glass, IconButton)
• public/ holds static assets: 3D GLB models, skybox HDR, fonts, images.
README
• It’s the standard Vite + React + TS template README.
• Confirms use of @vitejs/plugin-react for fast refresh and ESLint recommendations.
Main components
a. Client Browser (User Interface)
b. Static Asset Server (Vite dev server or deployed static host)
c. React Application
• App Root (App.tsx)
• ImmersiveSession (WebGL canvas layer)
• Product Display Module (Intro, Grid, Card, Sidebar, Team)
• HTML Overlay Components (enter, info)
• UI Library Components (Glass effect, IconButton)
d. Public Assets Storage
• 3D Models folder
• Skybox images
• Fonts & JSON
e. Build & Tooling
• Vite + plugins (React, SWC/Babel)
• TypeScript compiler
• ESLint
Relationships and data flows
• Browser requests index.html from Static Server → loads JS bundle
• React App bootstraps in Browser memory
• ImmersiveSession fetches 3D assets (GLB, HDR) from Static Server → renders via WebGL
• Product-Display components may fetch or import JSON/metadata from public/ or /src/resources
• UI components get props from parent components; all state lives in React memory
• Build system (Vite) transforms TSX → JS, applies HMR in dev, bundles for production
Architectural patterns & design principles
• Component-based UI (React) with clear separation:
• Presentation (UI) vs Feature (Product-Display, ImmersiveSession)
• Static assets separated under public/
• Single Page Application (SPA) served statically
• Development pipeline: Vite dev server + fast refresh plugin
• Type safety via TypeScript; linting via ESLint plugin