Venus CAD is a modern web-based 3D CAD application that combines AI-powered model generation with real-time 3D visualization, collaborative features, and hand gesture control.
- Purpose: Core UI framework
- Usage:
- Component-based architecture for all UI elements
- Hooks for state management (useState, useEffect, useContext)
- Context API for global state (Auth, Model, FS)
- Key Components:
App.tsx- Main application containerLandingPage.tsx- Landing page with authEditorPanel.tsx- Code editor interfaceViewerPanel.tsx- 3D model viewerAIChatPanel.tsx- AI assistant chatChatsPanel.tsx- Session management
- Purpose: Type-safe JavaScript
- Usage:
- Strong typing for all components and functions
- Interface definitions for data structures
- Type safety for Firebase operations
- Better IDE support and error catching
- Key Types:
Session,ChatMessage,UserProfile(Firestore)State,Model(App state)- Component props interfaces
- Purpose: React UI component library
- Usage:
Button- All interactive buttonsInputTextarea- Text input for promptsDialog- Modal dialogs (Auth, Settings)ToggleButton- Code/AI Assistant togglesProgressSpinner- Loading indicatorsToast- Notifications (copy link, errors)ConfirmDialog- Confirmation prompts
- Styling: Custom dark theme matching editor aesthetic
- Purpose: Icon library
- Usage:
pi-sparkles- AI featurespi-code- Code editorpi-comments- Chat sessionspi-link- Share linkspi-sign-out- Logoutpi-bars- Sidebar togglepi-arrow-left- Back navigation
- Purpose: CSS utility library
- Usage: Responsive layouts and spacing utilities
- Purpose: 3D model display component
- Usage:
- Renders GLB/GLTF 3D models
- Interactive camera controls (orbit, pan, zoom)
- Lighting and environment setup
- AR support for mobile devices
- Features:
- Auto-rotate
- Camera controls
- Shadow rendering
- Environment lighting
- @gltf-transform/core 4.1.1
- @gltf-transform/extensions 4.1.1
- Purpose: 3D model manipulation
- Usage:
- Convert OpenSCAD output to GLB
- Optimize 3D models
- Add materials and textures
- Export in multiple formats (STL, GLB, 3MF)
- Purpose: VS Code-powered code editor
- Usage:
- OpenSCAD code editing
- Syntax highlighting
- Auto-completion
- Error detection
- Custom language support
- Integration:
@monaco-editor/react 4.6.0- React wrapper@monaco-editor/loader 1.4.0- Dynamic loading
- Features:
- Custom OpenSCAD language definition
- Built-in functions and modules
- Code completion for OpenSCAD
- Dark theme integration
- Purpose: In-browser file system
- Usage:
- Store OpenSCAD files locally
- Manage library files
- Cache 3D models
- Persistent storage in IndexedDB
- Features:
- Virtual file system
- ZIP archive support
- Library management
- File persistence
- Purpose: ZIP file handling
- Usage:
- Extract library archives
- Package multiple files
- Import/export projects
- Handle font libraries
- firebase 10.x (latest)
- Purpose: User authentication
- Usage:
- Google OAuth sign-in
- Email/Password authentication
- Session management
- User profile creation
- Implementation:
src/firebase/auth.ts- Auth functionssrc/contexts/AuthContext.tsx- React context- Automatic token refresh
- Secure session handling
- Purpose: NoSQL database
- Usage:
- Store user profiles
- Save chat sessions
- Store 3D model code
- Collaborative session sharing
- Collections:
users/{userId} - uid, email, displayName, photoURL - createdAt, lastLogin sessions/{sessionId} - userId, title, isShared - messages[], modelCode - createdAt, updatedAt - Security Rules:
- User-based access control
- Collaborative sharing support
- Owner-only delete permissions
- Purpose: Usage tracking
- Usage: Track user interactions and feature usage
- Model: gemini-3-flash-preview
- Purpose: AI-powered 3D model generation
- Usage:
- Natural language to OpenSCAD code
- Code modification and refinement
- Image-to-3D model conversion
- Contextual code suggestions
- Features:
- Multi-modal input (text + images)
- Conversation history
- Code-only output mode
- Temperature control for creativity
- Purpose: Alternative AI provider
- Usage: Fallback for text-only generation
- @tensorflow/tfjs
- @tensorflow-models/hand-pose-detection
- Purpose: Hand gesture recognition
- Usage:
- Real-time hand tracking via webcam
- Gesture recognition (5 gestures):
- Point (index up) - Hover mode
- Pinch (thumb+index) - Grab/rotate
- Open hand - Pan view
- Closed fist - Orbit camera
- Two hands - Zoom in/out
- Features:
- MediaPipe Hands model
- Real-time skeleton drawing
- Gesture-based 3D controls
- Camera feed overlay
- Purpose: Module bundler
- Usage:
- Bundle React application
- Code splitting
- Asset optimization
- Development server
- Plugins:
copy-webpack-plugin- Copy static assetsworkbox-webpack-plugin- Service worker
- ts-loader 9.5.1
- Purpose: Compile TypeScript to JavaScript
- Usage: Type checking and transpilation
- Purpose: Development server
- Usage:
- Hot module replacement
- Live reload
- Proxy API requests
- HTTPS support
- Purpose: Component styling
- Usage:
- Dark theme (#000000, #0a0a0a, #141414)
- Inline styles for components
- CSS animations (fadeInUp, pulse)
- Responsive layouts
- Purpose: Animated particle background
- Usage:
- Canvas-based particle system
- Mathematical flow fields
- Mouse interaction
- Performance-optimized rendering
- Purpose: Offline support and caching
- Usage:
- Cache static assets
- Offline functionality
- Progressive Web App (PWA)
- Background sync
- dotenv 17.2.3
- Purpose: Configuration management
- Usage:
- Firebase credentials
- API keys (Gemini, Groq)
- Build-time configuration
User Input (Landing Page)
↓
AI Chat Panel (Gemini API)
↓
OpenSCAD Code Generation
↓
Monaco Editor (Code Display)
↓
OpenSCAD WASM Compiler
↓
3D Model Output (OFF/STL)
↓
GLTF Transform (Convert to GLB)
↓
Model Viewer (3D Display)
↓
Firebase (Save Session)
- User-based access control
- Session ownership validation
- Collaborative sharing permissions
- Read/write restrictions
- Secure OAuth flow
- Token-based sessions
- Automatic token refresh
- HTTPS-only connections
- Client-side encryption
- Secure API key storage
- Environment variable protection
- No sensitive data in code
- Lazy loading components
- Dynamic imports
- Route-based splitting
- Service worker caching
- Browser storage (IndexedDB)
- Firebase offline persistence
- Asset caching
- React.memo for expensive components
- Virtual scrolling for long lists
- Debounced input handlers
- RequestAnimationFrame for animations
- Installable on desktop/mobile
- Offline functionality
- App-like experience
- Push notifications (future)
- App icons (192px, 512px)
- Theme colors
- Display mode
- Start URL
- Purpose: Unit testing framework
- Usage: Component and function testing
- Purpose: E2E testing
- Usage: Browser automation and testing
- Purpose: Jest + Puppeteer integration
- Usage: End-to-end test automation
- Purpose: Dependency management
- Usage:
- Install packages
- Run scripts
- Manage versions
- Lock dependencies
{
"start": "webpack serve --mode=development",
"build": "webpack --mode=production",
"test:e2e": "jest",
"build:libs": "webpack --config webpack.libs.config.js"
}- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
- WebAssembly support
- WebGL 2.0
- IndexedDB
- Service Workers
- MediaDevices API (for hand tracking)
- Client-side rendering
- Serverless backend (Firebase)
- CDN-ready static assets
- Horizontal scaling via Firebase
- Server-side rendering (SSR)
- Edge computing for AI
- Real-time collaboration (WebRTC)
- Distributed rendering
AuthContext- User authentication stateModelContext- 3D model and app stateFSContext- File system state
- Component-level useState
- Session storage for temporary data
- LocalStorage for preferences
- Firebase Firestore for persistent data
- Real-time listeners for updates
- Optimistic UI updates
- AI-Powered Generation - Gemini API + Monaco Editor
- Real-time 3D Visualization - model-viewer + GLTF Transform
- Hand Gesture Control - TensorFlow.js + MediaPipe
- Collaborative Sharing - Firebase Firestore + Security Rules
- Offline Support - Service Workers + BrowserFS
- Professional Code Editor - Monaco Editor + OpenSCAD Language
- Session Management - Firebase Auth + Firestore
- Responsive UI - React + PrimeReact + Custom CSS
- Cross-platform - PWA + Responsive Design
- Type Safety - TypeScript throughout
- React: https://react.dev
- TypeScript: https://www.typescriptlang.org
- Firebase: https://firebase.google.com/docs
- PrimeReact: https://primereact.org
- Monaco Editor: https://microsoft.github.io/monaco-editor
- TensorFlow.js: https://www.tensorflow.org/js
- Gemini API: https://ai.google.dev
Tech Stack Version: 1.0 Last Updated: 2026-02-03 Maintained By: Venus CAD Team