Case Study 02
OpenBlueprint
From Measurements to Intelligent Blueprints.
OpenBlueprint is an AI-assisted architectural planning system: plot measurements and requirements in, reasoned floor-plan options out, then 2D editing, 3D visualisation, INR cost estimation and PDF/PNG/SVG/JSON export. Verified stack: Next.js 16 + React 19 + shadcn, Three.js, Zustand, Prisma/SQLite, OpenAI-compatible AI with offline fallback.
01 · Overview
Overview
- Turns plot size, setbacks, floors, rooms and Vastu preferences into scored layout options and an editable workspace.
- Solves the cold-start problem: converting measurements into feasible arrangements respecting orientation, adjacency and privacy.
- For homeowners, architecture students and early design exploration — not licensed structural review.
- Pairs an LLM reason-then-place planner with a deterministic BSP/zone solver, validation, scoring and cost modules.
02 · The Problem
The Problem
- '30×40 plot, south road' → workable plan means juggling setbacks, sizes, adjacency, ventilation, privacy and Vastu.
- Sketch tools don't propose; chat tools don't enforce geometry.
- Cost feedback arrives too late.
03 · The Solution
The Solution
- Guided wizard: plot → rooms → preferences/Vastu → summary → floor-distribution dialog.
- AI planner (reasoning, assumptions, questions, placements) + deterministic packing, openings, connectivity repair, auto-furniture.
- Workspace: 2D canvas, 3D view, AI assistant, validation/Vastu panels, cost panel, export modal; Prisma persistence.
04 · How It Works
How It Works
01 · 1. Plot input-
dimensions, setbacks, road/north, floors with live preview.
02 · 2. Requirements+
rooms, preferences, Vastu; floor-distribution dialog.
03 · 3. AI analysis+
POST /api/layout/generate; 428 without key, 422 clarification, offline fallback.
04 · 4. Five strategies+
Space, Ventilation, Modern Open, Privacy, Vastu Compliant.
05 · 5. Floor plan+
parking carve, BSP pack, openings, repair, connectivity, furniture; 8+ rules.
06 · 6. 2D editor+
move/resize/split, doors/windows, 47 furniture items, undo/redo.
07 · 7. 3D+
R3F clay render.
08 · 8. Cost+
INR grades 1500/1800/2300/3000 per sqft with breakdowns.
09 · 9. Export+
SVG/PNG + A4 PDF sheet + JSON.
Select a stage to expand it. Every stage maps to code in the repository.
05 · System Architecture
System Architecture
Next.js 16 + React 19 + TS + Tailwind 4 + shadcn (47 primitives); Zustand + TanStack Query.
nine routes: projects, layout generate/validate, AI assistant, knowledge, cost, export pdf/image.
OpenAI-compatible provider, reason-then-place planner, assistant with offline fallback, keyword RAG over 10 topics.
engine, rules, planner, scoring, validation, SVG renderer, catalogs.
Prisma + SQLite: User, Project, DesignVersion, AiConversation, CostEstimate.
06 · Core Features
Core Features
Plot wizard with live preview and buildable-area math.
Plot wizard with live preview and buildable-area math.
Five scored strategies (6-axis) making trade-offs explicit.
Five scored strategies (6-axis) making trade-offs explicit.
Reason-then-place AI with auditable reasoning.
Reason-then-place AI with auditable reasoning.
2D editor + 47 furniture items.
2D editor + 47 furniture items.
3D clay render.
3D clay render.
INR cost grades with Lakhs/Crores formatting.
INR cost grades with Lakhs/Crores formatting.
AI assistant + knowledge RAG with offline fallback.
AI assistant + knowledge RAG with offline fallback.
Floor-distribution dialog, validation + Vastu report, export suite.
Floor-distribution dialog, validation + Vastu report, export suite.
07 · Technical Implementation
Technical Implementation
- App Router pages, Zustand (30×40 default), TanStack Query, recharts, sharp.
- API routes with zod/uuid; Prisma via lib/db.ts.
- Custom chat/completions provider; z-ai SDK present.
- three + R3F + drei (SSR off); Playwright/e2e, ESLint, Bun.
08 · My Contribution
My Contribution
- Pipeline: wizard → generate API → solver → workspace → persistence → export.
- AI: planner, assistant actions, knowledge retrieval with fallbacks.
- UI: canvas tooling, 3D wiring, cost/validation/Vastu panels, export modal.
- Schema across projects, versions, conversations, estimates.
09 · Tech Stack
Tech Stack
- Frontend
- Next.js 16 · React 19 · TS · Tailwind 4 · shadcn.
- State
- Zustand · TanStack Query.
- 3D
- Three.js · R3F · drei.
- Backend
- API routes · Prisma · SQLite.
- AI
- provider · planner · assistant · knowledge RAG.
- Export
- SVG · sharp · PDF.
10 · Challenges & Decisions
Challenges & Decisions
- LLM must obey geometry → LLM proposes intent, solver places rectangles + validation/repair → auditable plans.
- Missing key/ambiguity → 428/422 + cached draft + offline generator → usable without key.
- Vastu vs objectives → bias + dedicated option + enforcement → visible trade-offs.
11 · Result
Result
- Wizard, 5-strategy generation, 2D editor (47 items), 3D view, cost panel, assistant, validation/Vastu, persistence, exports.
- Deterministic core verified in lib/.
12 · Links