Full-stack platform for "vibe-coding" indoor layouts. Next.js 15 frontend with React Three Fiber, FastAPI orchestration, and ML layout stubs (gen-sem-layout) backed by Postgres + Drizzle. Ships a layout worker to call the ML service and persist jobs/results.
VoxelGen now includes a browser-based parametric CAD editor powered by OpenSCAD WASM. This integration brings:
- AI-Driven Furniture Generation: Describe furniture in natural language, get OpenSCAD code
- Live Parameter Editing: Adjust dimensions, materials, and features with real-time preview
- STL Export: Download manufacturing-ready mesh files
- Library Support: BOSL2, MCAD, and custom OpenSCAD libraries
Access the editor at /studio/furniture or via the "Furniture Editor" button in VoxelGen Studio.
- apps/web: Next.js (App Router), Tailwind 4, Drizzle ORM (Postgres), Stripe stub, layout worker (
scripts/layoutJobWorker.ts), R3F viewers (@3dix/three). - services/api: FastAPI gateway with vibe encode/search, jobs stubs, and proxies to ML; Prometheus optional.
- services/gen-sem-layout: Stub layout generator + CLIP vibe encoder + constraint solver.
- packages:
types- TypeScript contracts and type definitionsthree- React Three Fiber viewers and 3D componentsui- Chat panel and shared UI componentsopenscad- OpenSCAD WASM integration for parametric CAD (CADAM)config- Shared configuration
- infra: Dockerfiles/compose, observability.
# 0) From repo root
cd /path/to/VoxelGen
# 1) Postgres (container on 54322)
docker run -d --name voxelgen-postgres \
-e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=postgres \
-p 54322:5432 postgres:15
# 2) Web env
cp apps/web/.env.example apps/web/.env.local
# ensure POSTGRES_URL=postgres://postgres:postgres@localhost:54322/postgres
# 3) Install deps
pnpm install
cd services/api && pip install -r requirements.txt && cd ../..
# 4) Migrations
cd apps/web && POSTGRES_URL=postgres://postgres:postgres@localhost:54322/postgres pnpm exec drizzle-kit migrate && cd ../..
# 5) Run services (separate terminals)
cd services/api && ENV_STATE=dev uvicorn manage:app --host 0.0.0.0 --port 8000 --reload
cd services/gen-sem-layout && uvicorn main:app --host 0.0.0.0 --port 8001 --reload
cd apps/web && pnpm dev --port 3000
# Layout worker (optional): cd apps/web && pnpm dlx tsx ./scripts/layoutJobWorker.tsOpen http://localhost:3000 (web), http://localhost:8000/api/v1/ (API), http://localhost:8001/health (layout stub).
Navigate to http://localhost:3000/studio/furniture for the parametric furniture editor.
apps/web/.env.localPOSTGRES_URL=postgres://postgres:postgres@localhost:54322/postgresSTRIPE_SECRET_KEY,STRIPE_WEBHOOK_SECRET(stubs ok locally)BASE_URL=http://localhost:3000NEXT_PUBLIC_API_URL=http://localhost:8000AUTH_SECRETany dev secretOPENROUTER_API_KEY- Required for AI furniture generation (get from OpenRouter)
services/api/.env.devENV_STATE=devDEV_*metadata +DEV_PORT=8000,DEV_LOG_LEVEL=debugDEV_DBcurrently unused (Mongo stub), Postgres used via web app
- Web:
pnpm dev --port 3000,pnpm build,pnpm test - API:
ENV_STATE=dev uvicorn manage:app --port 8000 --reload - Layout service:
uvicorn main:app --port 8001 --reload - DB:
pnpm exec drizzle-kit migrate(usesdrizzle.config.ts) - Worker:
pnpm dlx tsx ./scripts/layoutJobWorker.ts(readsLAYOUT_ML_URL, defaults tohttp://localhost:8001/generate-layout)
- Web → API proxy:
curl -s http://localhost:3000/api/vibe/echo -X POST -H "Content-Type: application/json" -d '{"message":"hi"}' - API echo:
curl -s http://localhost:8000/api/v1/vibe/echo -X POST -H "Content-Type: application/json" -d '{"message":"hi"}' - ML stub:
curl -s http://localhost:8001/health - Postgres tables:
docker exec voxelgen-postgres psql -U postgres -c '\dt'
- Frontend:
cd apps/web && pnpm test - Python:
cd services/api && python -m pytest(tests mostly template) - ML stubs:
cd services/gen-sem-layout && python -m pytest tests/ -v
- API code still carries Mongo scaffolding; production persistence should be Postgres/pgvector.
gen-sem-layoutattempts to load CLIP (Hugging Face); provide a token/model or rely on mock embeddings.- Many API routes are stubs; job system relies on web worker + Postgres
layout_jobs.
The parametric furniture editor is based on the CADAM project, which provides:
- OpenSCAD WASM compilation for browser-based CAD
- AI-assisted OpenSCAD code generation
- Real-time parametric editing with live preview
The @3dix/openscad package provides:
OpenSCADWrapper- Core WASM wrapper for compilationuseOpenSCAD- React hook for OpenSCAD operationsparseParameters- Extract and manipulate OpenSCAD parameters- Worker-based compilation for non-blocking UI