How pirouzmehmandoost/para works
PARA is a Next.js showcase for interactive 3D-printed product models. Visitors explore a persistent Three.js carousel, focus a model, then open a project view for specifications, material selection, and rotation controls. Project metadata is fetched from the database and supplied to the scene and project pages. The graph preserves the documented carousel, terrain, texture, and model-interaction capabilities; some store and API wiring is not shown in the excerpts, so uncertain links are omitted.
Main entry points: ProjectDataModal.tsx Project controls and details · projects.ts Project queries and mapping · SceneComposer.tsx Scene composition · layout.tsx App layout
Components 27
App shell and routes
- App layout
src/app/layout.tsx - Project page
src/app/projects/[slug]/page.tsx - Intercepted project route
src/app/@modal/(.)projects/[slug]/page.tsx - Project API routes
src/app/api/projects
3D scene and navigation
- Persistent canvas
src/app/components/three/canvas/RootCanvas.tsx - Scene composition
src/app/components/three/scenes/SceneComposer.tsx - Camera carousel
src/app/components/three/rigs/Carousel.tsx - Target registry
src/lib/targetRegistry/TargetRegistry.ts - Project models
src/app/components/three/meshes/ProjectMesh.tsx - Terrain grid
src/app/components/three/instancedMeshes/TerrainGrid.tsx - Texture initialization
src/app/components/three/textures/TextureInitializer.ts
Project interaction
- Selection display
src/app/components/ui/modals/SelectionDisplayModal.tsx - Project controls and details
src/app/components/ui/modals/ProjectDataModal.tsx - Sidebar navigation
src/app/components/ui/Sidebar.tsx - Action buttons
src/app/components/ui/buttons/ActionButton.tsx - Auto-rotation control
src/app/components/ui/buttons/AutoRotateButton.tsx - Manual rotation controls
src/app/components/ui/buttons/ManualRotateButtonGroup.tsx - Material state
src/app/stores/materialStore.ts - Selection state
src/app/stores/selectionStore.ts - Project state
src/app/stores/projectStore.ts
Project data
- Project queries and mapping
src/db/projects.ts - Neon database
src/db/db.ts - Project schema
src/db/schema.ts - Project data types
src/types/project.ts - Material types
src/types/material.ts - Transform types
src/types/Transform3.ts
Other components
- Visitor
Connections 29
- Visitor → App layout: opens app
src/app/layout.tsx - App layout → Project queries and mapping: loads projects
src/app/layout.tsx - App layout → Persistent canvas: mounts canvas
src/app/layout.tsx - App layout → Sidebar navigation: renders navigation
src/app/layout.tsx - Persistent canvas → Scene composition: renders scene
src/app/components/three/canvas/RootCanvas.tsx - Persistent canvas → Texture initialization: initializes textures
src/app/components/three/canvas/RootCanvas.tsx - Scene composition → Project models: mounts models
src/app/components/three/scenes/SceneComposer.tsx - Scene composition → Terrain grid: mounts terrain
src/app/components/three/scenes/SceneComposer.tsx - Scene composition → Camera carousel: mounts camera rig
src/app/components/three/scenes/SceneComposer.tsx - Camera carousel → Target registry: tracks targets
README.md - Project models → Material state: reads materials
src/app/components/three/meshes/ProjectMesh.tsx - Terrain grid → Material state: reads materials
src/app/components/three/instancedMeshes/TerrainGrid.tsx - Texture initialization → Material state: sets textures
src/app/components/three/textures/TextureInitializer.ts - Scene composition → Selection state: updates selection
README.md - Visitor → Project page: opens project
src/app/projects/[slug]/page.tsx - Visitor → Intercepted project route: opens project modal
src/app/@modal/(.)projects/[slug]/page.tsx - Project page → Project queries and mapping: loads by slug
src/app/projects/[slug]/page.tsx - Intercepted project route → Project queries and mapping: loads by slug
src/app/@modal/(.)projects/[slug]/page.tsx - Project page → Project controls and details: renders project view
src/app/projects/[slug]/page.tsx - Intercepted project route → Project controls and details: renders project view
src/app/@modal/(.)projects/[slug]/page.tsx - Project controls and details → Material state: reads materials
src/app/components/ui/modals/ProjectDataModal.tsx - Project controls and details → Selection state: reads and updates selection
src/app/components/ui/modals/ProjectDataModal.tsx - Project controls and details → Action buttons: renders actions
src/app/components/ui/modals/ProjectDataModal.tsx - Project controls and details → Auto-rotation control: renders control
src/app/components/ui/modals/ProjectDataModal.tsx - Project controls and details → Manual rotation controls: renders controls
src/app/components/ui/modals/ProjectDataModal.tsx - Project queries and mapping → Neon database: queries records
src/db/projects.ts - Project queries and mapping → Project schema: queries table
src/db/projects.ts - Project queries and mapping → Project data types: maps to type
src/db/projects.ts - Project API routes → Project queries and mapping