How justinscitech/sceneit works
Project type and purpose
• This is a full-stack, server-rendered e-commerce web application built with Next.js (using the new /app directory), React, Tailwind CSS, and various UI components.
• It integrates with Shopify, exposes REST/HTTP APIs for 3D-model generation and image analysis, and leverages Python scripts for AI/ML tasks (e.g., generate_3d_model.py, benchmark_triposr.py).
File structure
• Top-level “app” directory: Next.js app routes, React pages, layouts, error handling.
• app/api: serverless API endpoints written in TypeScript (3D models, image analysis, product sync).
• pages/api/vapi: legacy Next.js API routes for voice-AI assistant (OpenAI).
• components, components/ui: shared React components, UI primitives, layout, cart, product viewers.
• lib/shopify, lib/utils: Shopify integration, utilities, context providers.
• Python scripts at root: standalone microservices for 3D model generation and benchmarking.
• public/3D: static 3D assets (GLB files).
• server/tmp: temporary storage for vendor product data.
• configuration files: next.config.mjs, tailwind.config.js, tsconfig.json, package.json.
README for additional insights
• The README (“Scene it will revolutionize … voice ai sales guides”) indicates a voice-AI assistant layer on top of e-commerce product browsing and 3D visualization.
Components and relationships
a. Main components
• Client (Browser/Mobile): Next.js-driven React UI, 3D viewer, voice UI
• Next.js Server (Node.js): SSR/ISR, API routes under /app/api and /pages/api/vapi
• Python AI/ML Service: separate microservice(s) running Python scripts for 3D-model generation and image analysis
• Shopify API: external e-commerce backend for product catalog
• Data Store / File Store: public/3D for static assets, server/tmp for intermediate JSON, possible cloud storage or CDN
• Voice-AI Provider: external OpenAI or custom voice assistant API
b. Relationships and interactions
• Browser → Next.js Server: HTTP(S) requests for pages, SSR data-fetching, client-side navigation
• Next.js API routes ←→ Shopify API: sync products, fetch catalog data
• Next.js API routes → Python AI Service: REST or gRPC calls to trigger model generation or analysis
• Python AI Service → File Store/CDN: persists generated 3D models under public/3D or server/tmp
• Browser → Voice-AI Provider: via Next.js /pages/api/vapi routes for creating assistant sessions and webhooks
c. Architectural patterns and design principles
• Jamstack/Serverless Functions for backend logic (Next.js API Routes)
• Microservices for heavy AI tasks (Python scripts decoupled from Node.js)
• Component-based UI with shared “components/ui” primitives for consistency
• Context Providers for global state (Cart, Vendor)
• Static asset hosting plus SSR for SEO and performance
d. Key technologies and frameworks
• Next.js 13 with the /app router
• React + TypeScript
• Tailwind CSS
• Shopfiy Storefront API
• Python (TensorFlow/PyTorch or custom AI libs)
• OpenAI or custom voice-AI API
• CDN or cloud file storage for 3D assets
Elements
• from Browser to Next.js SSR (page requests)
• SSR to API Routes (data fetching)
• API Routes to Python service and to Shopify
• Python service to File Storage
• Browser direct fetches for static assets
• Browser to Voice-AI via Next.js vapi routes