2D/3D Floor Planner Readme

2D/3D Floor Planner

A best-in-class TypeScript boilerplate for designing interior floor plans with matched 2D and 3D views of the same scene โ€” built on React, Three.js, Zustand, and Zod โ€” so you can build at the speed of thought with AI, ship an accurate planner, and rank #1 on Google.

โšก Demo: 2d-3d-floor-planner.gallop.software
๐ŸŽจ Template: gallop.software/templates
๐Ÿ“ฆ Repository: github.com/gallop-software/2d-3d-floor-planner-pro
๐Ÿท๏ธ Category: 2D/3D Floor Planner Boilerplate


Why Use Gallop Templates?

Just chat with AI inside your code editor using our Gallop templates, and you will never want to wrestle with a heavyweight CAD suite, a bloated drag-and-drop room designer, or a proprietary file format again. Simply describe the space you want, and AI writes the code. No SketchUp, no AutoCAD, no visual editors, and no design limitations. Just type and watch. Lay out rooms and walls, place windows, doors, cabinets and appliances, toggle between accurate 2D and 3D views, configure your SEO and AI discoverability instantly, expand endlessly, and get prompting tips from our Gallop community. Go live in minutes.


Features

  • ๐Ÿงฑ One typed scene, two views โ€” a single source-of-truth JSON scene drives both the 2D plan and the 3D model, so they can never drift
  • ๐Ÿชš Cabinet CAD โ†’ CNC cut files โ€” a standalone /cad/ workspace turns one typed cabinet definition into a 3D drawing, CNC-ready DXF cut sheets, and GRBL G-code for every board, all derived from the same data
  • ๐Ÿงญ Multi-page app โ€” a built-in page menu hops between the Floor Plan and the Cabinet CAD workspace; Vite bundles both pages in one build
  • ๐Ÿ“ Precise dimensions โ€” all linear values stored in inches; imperial (ft / in) display by default with an in toggle
  • โš›๏ธ React 18 + TypeScript with strict typing end-to-end
  • ๐ŸงŠ Three.js via @react-three/fiber + @react-three/drei for the 3D view
  • โœ๏ธ Plain SVG 2D floor plan โ€” crisp at any zoom, fully measured
  • ๐Ÿ—‚๏ธ Edit one file โ€” describe your whole space in src/design/home.ts; an edge/bounds authoring DSL keeps the math out of your way
  • ๐Ÿ›ก๏ธ Zod-validated scene contract โ€” bad layouts surface as clear errors instead of broken renders
  • ๐ŸŽฏ Click-to-select any wall, opening, room, or fixture in either view, with a shared tooltip showing labels and dimensions
  • ๐Ÿงญ Live compass that stays north-up in 2D and tracks the camera in 3D
  • ๐Ÿค– AI-friendly codebase structure with TypeScript strict mode
  • ๐Ÿ” SEO and AI optimized with meta tags, Open Graph, and Twitter cards
  • โšก Vite for instant hot reload and lightning-fast production builds
  • ๐Ÿ  Starter home included so the project runs out of the box

Cabinet CAD โ€” From Definition to CNC Cut Files

Beyond the floor planner, the template ships a second, standalone page at /cad/ for taking a single cabinet all the way to the shop. Open it from the page menu in the top-left of the toolbar (or visit http://localhost:5173/cad/ directly).

Each cabinet is described once as a typed definition (cad/cabinets/*.ts). From that one source of truth the page generates:

  • ๐ŸงŠ A 3D drawing โ€” every part rendered as its assembled box, with an explode slider, dimension callouts, per-part cut sizes, and a toggleable layer/legend.
  • ๐Ÿ“„ DXF cut sheets โ€” true finished part outlines nested onto each board (one per material thickness), ready to import into your CAM software. Drag a .dxf back onto the canvas to inspect it.
  • โš™๏ธ GRBL G-code โ€” ready-to-run toolpaths per board for a BobsCNC KL744 (1/4" bit): pockets first while parts are still captive, then outside profiles with holding tabs. Includes a separate wasteboard-surfacing program.

Two build variants ship as worked examples โ€” upper18 (CNC face-frame upper on 48ร—48 boards) and upper18saw (the same cabinet as straight saw cuts on 4ร—8 sheets).

Machine-safety audit: because bad G-code breaks bits and gouges stock, every generated job is checked by npm run audit:gcode โ€” it flags un-parseable lines, plunges into stock, travel below safe height, cuts deeper than the material, out-of-bounds moves, and more, and confirms every toolpath lands exactly on the 3D plan.


Getting Started

New to this? No problem. You'll have AI guiding you the entire way. Choose your editor below and follow the steps.

Choose Your Editor

We recommend the Gallop AI Editor for the best experience with Gallop templates โ€” whether you're a beginner or an advanced developer who wants AI-assisted iteration. It was purpose-built for this workflow and requires zero configuration. VS Code is also a fine choice if you prefer to work without AI assistance.

Gallop AI EditorVS Code
Best forNon-programmers, junior programmers, advanced programmersAdvanced programmers
AI built inYes โ€” Claude AI ready to goNo (optional extensions available)
AI setup requirementEnter Claude API keysInstall extensions manually
Template browserBuilt-in marketplaceDownload ZIP from GitHub
Media managerBuilt-in Studio with CDN syncManual file management
Font managerBuilt-in Studio with WOFF2 font generationNo support
SEO AuditAnalyze SEO & Structured DataNo support
GitBetter Git UI with modal diff viewerDefault Git UI
Node.jsBuilt-in installer and version managerInstall Node.js separately

The Gallop AI Editor is a desktop app built specifically for AI-powered web development. It includes everything you need โ€” code editor, AI assistant, Git, terminal, media manager, font manager, SEO & structured data scanner, and a template marketplace โ€” all in one window with nothing to configure.

Available for Mac and Windows.

Step 1: Install Gallop AI Editor

  1. Go to gallop.software and download the installer for your platform
  2. Open the installer and follow the prompts
  3. Launch the Gallop AI Editor
  4. If prompted, the editor will walk you through installing Node.js automatically โ€” just follow the on-screen steps

Step 2: Open This Template

From the built-in template marketplace:

  1. Click the Templates tab in the sidebar
  2. Find 2D/3D Floor Planner and click Clone
  3. Choose a folder on your computer (like your Desktop)
  4. The editor will download and set up the project for you

Or from a ZIP download:

  1. Click the green Code button at the top of this GitHub page, then click Download ZIP
  2. Unzip the folder somewhere easy to find (like your Desktop)
  3. In the Gallop AI Editor, click Open Project and select the unzipped 2d-3d-floor-planner folder

Step 3: Start the Dev Server

  1. Click the Terminal tab at the bottom of the editor
  2. Click Install to install dependencies, then click Start to run the dev server
  3. Open http://localhost:5173 in your browser to see your floor plan

Step 4: Chat with AI

Click the AI Chat panel (or press Cmd+E on Mac / Ctrl+E on Windows) to open the AI assistant. Now just ask:

I'm new to this. Help me turn this template into my own floor plan.

The AI assistant can read and edit your project files, run commands, and explain anything you're confused about. Just describe what you want in plain English:

Replace the starter home with my one-bedroom apartment
Add a kitchen island and a row of base cabinets along the north wall
Move the front door to the south wall and add two 48" windows
Turn the living room into an open-plan living and dining space

Tip: Press Cmd+Ctrl+3 (Mac) to take a screenshot of your running plan and attach it to the chat. The AI can see exactly what you see and suggest changes visually.


Option B: VS Code

VS Code is a good choice if you prefer to work without AI assistance. You'll need to install a few things manually.

Step 1: Install Prerequisites

  1. Install VS Code
  2. Install Node.js (version 20 or higher)
  3. Install Git

Step 2: Download This Template

Click the green Code button at the top of this GitHub page, then click Download ZIP. Unzip the folder somewhere easy to find (like your Desktop).

Step 3: Open in VS Code

  1. Open VS Code
  2. Click File โ†’ Open Folder
  3. Select the unzipped 2d-3d-floor-planner folder
  4. Click Open

Step 4: Install and Run

Open the terminal in VS Code (Ctrl+` on Mac/Windows) and run:

npm install
npm run dev

Open http://localhost:5173 to see your floor plan. Press Ctrl+C to stop the server.

Step 5: Start Building

Edit src/design/home.ts to model your own space. Refer to the Project Structure and Available Scripts sections below for guidance.


Join the Community

Connect with other Gallop users on Slack. Share your progress, swap AI prompting tips, and see what people are building with the help of AI.


Put Your Floor Planner Online

When you're ready to share your floor planner with the world, you'll need a free GitHub account to store your code and a free Vercel account to host your build.

The Easy Way

Just ask your AI assistant:

Help me create a GitHub account, push this project to GitHub, and deploy to Vercel

The AI will walk you through every step. When you're done, your planner will be live with a URL you can share.

For Technical Users

If you're comfortable with Git:

Step 1: Create Your Repository

Step 2: Clone Your Repository

Ask your AI assistant:

Help me clone my new GitHub repository and run it locally

Or run these commands in your terminal:

git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git
cd YOUR-REPO-NAME
npm install
npm run dev

Open http://localhost:5173 to view your floor plan. Press Ctrl+C to stop the server. When ready to test the production build, run npm run build then npm run preview.

Step 3: Deploy to Vercel

Select your repository, and Vercel will automatically deploy whenever you push changes.

Congratulations! Your floor planner is now live to the world. Share your new URL and start growing your audience. Ready for a custom domain? See Vercel's domain setup guide.


About Gallop Templates

2D/3D Floor Planner is part of the Gallop template ecosystem. Gallop templates are designed to be built with AI โ€” just describe what you want in plain English and watch your project come to life.

Gallop AI Editor

The Gallop AI Editor is a desktop code editor built specifically for AI-powered development. It combines a full code editor, Claude AI assistant, visual Git interface, integrated terminal, media manager, and template marketplace into one app. Everything is preconfigured to work with Gallop templates out of the box โ€” no extensions, no plugins, no setup.

Key highlights:

  • Claude AI built in โ€” Chat with Claude to lay out rooms, place fixtures, and learn the authoring API as you go. Supports Opus 4.7, Sonnet 4.6, and Haiku 4.5 models
  • Agent and Plan modes โ€” Agent mode lets AI apply changes automatically. Plan mode shows you what AI wants to do before it does it, so you stay in control
  • Screenshot capture โ€” Press Cmd+Ctrl+3 to screenshot your running plan and share it with AI for visual feedback
  • Built-in template marketplace โ€” Browse and clone Gallop templates without leaving the editor
  • Visual Git โ€” Stage, commit, and merge with a 3-column visual interface. No command line required
  • Studio media manager โ€” Manage images and assets with thumbnail previews and CDN sync
  • Node.js manager โ€” Install and switch Node.js versions without touching the terminal
  • Auto-updates โ€” The editor keeps itself up to date automatically

Built for SEO and AI Discoverability

This template was crafted from the ground up to get your project ranked #1 on Google and recommended by AI assistants like ChatGPT and Google's Gemini. The HTML shell ships with complete metadata, Open Graph, and Twitter cards that search engines and AI models actually parse.

AI mentions are becoming more important than traditional SEO. When someone asks an AI assistant for "tools to plan a room layout," you want yours in that answer. Gallop templates are built with the metadata and semantic markup that AI models rely on to understand and recommend your work.

What You Can Build

  • Design with AI โ€” Let AI do the technical heavy lifting while you provide creative direction
  • Skip the boring work โ€” Let AI place walls, cut openings, and pack cabinet runs while you describe the room
  • Accurate everywhere โ€” Inches under the hood with imperial display means measurements stay true across 2D and 3D
  • One source of truth โ€” Edit a single typed file and both views update instantly via HMR
  • Get found online โ€” SEO foundation with metadata for search engines and AI assistants
  • Deploy instantly โ€” Static-build output that drops onto Vercel, Netlify, Cloudflare Pages, or any static host

Built by Industry Veterans

The team behind Gallop has decades of combined experience building websites, apps, and web applications for top global brands. We've helped projects achieve #1 Google rankings in competitive markets and understand what it takes to ship something polished. That expertise is baked into every template, every component, and every line of code.


Project Structure

2d-3d-floor-planner/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ main.tsx # React entry โ€” mounts <App> into #root
โ”‚ โ”œโ”€โ”€ App.tsx # Layout shell: Toolbar + 2D / 3D / Split views
โ”‚ โ”œโ”€โ”€ design/
โ”‚ โ”‚ โ””โ”€โ”€ home.ts # THE DESIGN โ€” your rooms, walls, openings, fixtures (EDIT THIS)
โ”‚ โ”œโ”€โ”€ scene/ # The template engine (reference it; don't change it)
โ”‚ โ”‚ โ”œโ”€โ”€ schema.ts # Zod schema + types โ€” the scene contract
โ”‚ โ”‚ โ”œโ”€โ”€ build.ts # Edge/bounds authoring DSL used from home.ts
โ”‚ โ”‚ โ”œโ”€โ”€ geometry.ts # Polygon, wall, and opening math
โ”‚ โ”‚ โ”œโ”€โ”€ units.ts # Imperial / inch formatting helpers
โ”‚ โ”‚ โ”œโ”€โ”€ describe.ts # Shared tooltip + selection text for both views
โ”‚ โ”‚ โ””โ”€โ”€ store.ts # Zustand state (view mode, units, selection)
โ”‚ โ”œโ”€โ”€ views/ # The renderers
โ”‚ โ”‚ โ”œโ”€โ”€ Plan2D.tsx # SVG 2D floor plan
โ”‚ โ”‚ โ”œโ”€โ”€ Scene3D.tsx # react-three-fiber 3D scene + camera
โ”‚ โ”‚ โ”œโ”€โ”€ Compass.tsx # Cardinal compass rose
โ”‚ โ”‚ โ””โ”€โ”€ three/ # 3D primitives
โ”‚ โ”‚ โ”œโ”€โ”€ Wall3D.tsx # Zero-thickness wall plane with openings cut out
โ”‚ โ”‚ โ”œโ”€โ”€ Opening3D.tsx # Window / door / cased opening
โ”‚ โ”‚ โ”œโ”€โ”€ Floor3D.tsx # Room floor polygon
โ”‚ โ”‚ โ””โ”€โ”€ Fixture3D.tsx # Box / cylinder / prism cabinets & appliances
โ”‚ โ”œโ”€โ”€ ui/ # Toolbar chrome
โ”‚ โ”‚ โ”œโ”€โ”€ Toolbar.tsx # Top bar (page menu + brand + toggles)
โ”‚ โ”‚ โ”œโ”€โ”€ PageMenu.tsx # Dropdown to switch between Floor Plan and Cabinet CAD pages
โ”‚ โ”‚ โ”œโ”€โ”€ ViewModeToggle.tsx # 2D Plan / 3D View / Split
โ”‚ โ”‚ โ”œโ”€โ”€ UnitsToggle.tsx # ft / in ยท in
โ”‚ โ”‚ โ””โ”€โ”€ ZoomControls.tsx # Shared +/- zoom buttons
โ”‚ โ””โ”€โ”€ styles/
โ”‚ โ””โ”€โ”€ index.css # Tailwind entry + global styles
โ”œโ”€โ”€ cad/ # Standalone Cabinet CAD page (/cad/) โ€” 3D + DXF + G-code
โ”‚ โ”œโ”€โ”€ index.html # SEO-rich HTML shell for the CAD page
โ”‚ โ”œโ”€โ”€ main.ts # CAD app entry โ€” canvas, sheets, downloads, page menu
โ”‚ โ”œโ”€โ”€ model.ts # Cabinet definition types + DXF generation (single source of truth)
โ”‚ โ”œโ”€โ”€ view3d.ts # Three.js 3D drawing of a cabinet (explode, callouts, layers)
โ”‚ โ”œโ”€โ”€ gcode.ts # CAM โ€” generates GRBL G-code per board from the cabinet
โ”‚ โ”œโ”€โ”€ surfacing.ts # Wasteboard-surfacing G-code program
โ”‚ โ”œโ”€โ”€ audit.ts # Machine-safety + dimensional audit of every G-code job
โ”‚ โ”œโ”€โ”€ viewer.css # Styling for the CAD page
โ”‚ โ””โ”€โ”€ cabinets/ # Cabinet definitions (edit / add your own)
โ”‚ โ”œโ”€โ”€ upper18.ts # CNC face-frame upper (48ร—48 boards)
โ”‚ โ””โ”€โ”€ upper18saw.ts # Circular-saw build of the same cabinet (4ร—8 sheets)
โ”œโ”€โ”€ public/
โ”‚ โ””โ”€โ”€ screenshot.jpg # Featured image for OG / template marketplaces
โ”œโ”€โ”€ index.html # SEO-rich HTML shell (meta, Open Graph, Twitter cards)
โ”œโ”€โ”€ vite.config.ts # Vite configuration (multi-page: index.html + cad/index.html)
โ”œโ”€โ”€ tsconfig.json # TypeScript config (strict)
โ”œโ”€โ”€ tailwind.config.js # Tailwind CSS configuration
โ”œโ”€โ”€ postcss.config.js # PostCSS (Tailwind + Autoprefixer)
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

Available Scripts

Development

  • npm run dev โ€” Start development server at http://localhost:5173 with hot reload (Floor Plan at /, Cabinet CAD at /cad/)
  • npm run build โ€” Type-check, then bundle both pages to dist/ for production
  • npm run preview โ€” Serve the production build locally for testing
  • npm run typecheck โ€” TypeScript type checking without emitting
  • npm run audit:gcode โ€” Machine-safety + dimensional audit of every generated CNC G-code job

Technologies

Frontend (Runtime)

Every dependency is battle-tested in production and chosen for stability, performance, and long-term maintainability.

  • React 18.3 โ€” UI library powering both view shells
  • Three.js 0.169 โ€” WebGL 3D renderer
  • @react-three/fiber 8.17 โ€” React renderer for Three.js
  • @react-three/drei 9.114 โ€” Helpers for fiber (OrbitControls, Grid, Html, Edges)
  • Zustand 5.0 โ€” Minimal state management with localStorage persistence
  • Zod 3.23 โ€” Runtime schema validation for the scene contract

Build & Tooling

Tools for building and developing the planner:

  • Vite 5.4 โ€” Dev server and bundler with instant HMR
  • @vitejs/plugin-react 4.3 โ€” React Fast Refresh + JSX transform
  • TypeScript 5.6 โ€” Type safety and IntelliSense (strict mode)
  • Tailwind CSS 3.4 โ€” Utility-first styling for UI chrome
  • PostCSS 8.4 + Autoprefixer 10.4 โ€” CSS processing pipeline

Support & Community


License

MIT License โ€” see LICENSE for details


Credits

Contributors:

Built with โค๏ธ by the team at Gallop


Learn More

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

ยฉ 2026 Web Plant Media, LLC