How mtcto/cadam works
CADAM is a browser-based text-to-CAD application: users describe or reference a model, receive AI-generated parametric OpenSCAD, adjust dimensions, preview the result, and export it. The graph preserves the documented image-input, library, and export capabilities alongside the chat, rendering, and persistence layers. Several server and parameter-generation links are documented only at product level; those relationships are shown as unverified where source excerpts do not establish their wiring.
Main entry points: ChatSession.tsx Chat session · MeshPreview.tsx 3D preview · TextAreaChat.tsx Prompt and images · supabase.ts Supabase client
Components 19
User experience
- Application shell
src/App.tsx - Chat session
src/components/chat/ChatSession.tsx - Prompt and images
src/components/TextAreaChat.tsx - Message display
src/components/chat/MessageBubble.tsx
Model generation
- Generation API
src/routes/api - AI chat orchestration
src/server/aiChat.ts - Parameter extraction
shared/parseParameters.ts
Model editing and preview
- Parametric controls
src/components/parameter - Model editor
src/views/EditorView.tsx - 3D preview
src/components/viewer/MeshPreview.tsx - Model export
src/components/viewer/DownloadMenu.tsx
Identity and persistence
- Mesh data access
src/hooks/useMeshData.ts - Message persistence
src/services/messageService.ts - Supabase client
src/lib/supabase.ts - Authentication provider
src/contexts/AuthProvider.tsx
Browser computation
- Tool execution worker
src/worker/toolWorker.ts - OpenSCAD worker
src/worker/worker.ts
Other components
- CADAM user
- Supabase backend
Connections 23
- CADAM user → Prompt and images: describes model
README.md - Prompt and images → Chat session: submits prompt
src/components/chat/ChatSession.tsx - Chat session → Prompt and images: renders input
src/components/chat/ChatSession.tsx - Chat session → Message display: renders messages
src/components/chat/ChatSession.tsx - Chat session → Tool execution worker: executes tools
src/components/chat/ChatSession.tsx - Chat session → Message persistence: persists messages
src/components/chat/ChatSession.tsx - Chat session → AI chat orchestration: requests generation
- AI chat orchestration → Generation API: serves generation
- AI chat orchestration → Parameter extraction: extracts parameters
- CADAM user → Model editor: adjusts model
README.md - Model editor → Parametric controls: offers controls
- Model editor → 3D preview: shows preview
- 3D preview → Model export: offers downloads
src/components/viewer/MeshPreview.tsx - 3D preview → Mesh data access: loads mesh
src/components/viewer/MeshPreview.tsx - Mesh data access → Supabase client: reads mesh data
src/hooks/useMeshData.ts - Message persistence → Supabase client: reads and writes
src/services/messageService.ts - Supabase client → Supabase backend: accesses backend
- Tool execution worker → OpenSCAD worker: dispatches preview
src/worker/toolWorker.ts - Authentication provider → Supabase client: uses client
src/contexts/AuthProvider.tsx - Application shell → Authentication provider: provides auth
src/App.tsx - CADAM user → 3D preview: views generated model
README.md - CADAM user → Prompt and images: adds image reference
README.md - CADAM user → Model export: exports model
README.md