simon-something/buildor

generate diy projects

★ 0Forks 0PythonGitHub ↗Compare

README

Buildor

Turn natural language hardware descriptions into complete, buildable DIY project specifications.

Describe what you want to build — Buildor generates a bill of materials with real part numbers, a 3D-printable enclosure, wiring diagrams, firmware code, and step-by-step assembly instructions.

How It Works

Type a prompt like "portable CO2 monitor with OLED display and buzzer alert" and Buildor runs a 7-stage pipeline:

  1. Interpreter — Parses your description into a structured device specification
  2. Parts Selector — Picks real components from a curated database of 329 parts
  3. Validator — Checks power budget, voltage compatibility, pin availability, and more
  4. CAD Generator — Creates a parametric 3D enclosure sized to your components
  5. Wiring Generator — Assigns pins and renders an SVG wiring diagram
  6. Firmware Generator — Writes platform-specific code (Arduino or MicroPython)
  7. Assembly Guide — Produces step-by-step build instructions with tools and time estimates

Progress streams to the UI in real-time via SSE. After a build completes, you can refine your design with follow-up prompts — only affected stages re-run.

Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • uv (Python package manager)
  • An OpenRouter API key

Backend

cd backend
uv sync
OPENROUTER_API_KEY=your-key-here uv run uvicorn app.main:app --reload

The API starts at http://localhost:8000. On first launch it initializes a SQLite database with 329 curated components.

Frontend

cd frontend
npm install
npm run dev

Opens at http://localhost:5173.

Configuration

The API key is read directly from OPENROUTER_API_KEY. Other settings use the BUILDOR_ prefix:

Variable Default Description
OPENROUTER_API_KEY (required) Your OpenRouter API key
BUILDOR_OPENROUTER_MODEL anthropic/claude-opus-4.6 LLM model to use
BUILDOR_OPENROUTER_BASE_URL https://openrouter.ai/api/v1 API base URL
BUILDOR_DATABASE_PATH data/parts.db SQLite database location
BUILDOR_PROJECTS_PATH data/projects Project output directory
BUILDOR_DEBUG false Enable debug logging

Parts Database

329 curated real-world components across 8 categories:

Category Count Examples
Boards 15 ESP32-DevKitC, Pico W, Arduino Nano 33 IoT
Sensors 99 BME280, MH-Z19B, MPU6050, VL53L0X, INA219
Displays 15 SSD1306 OLED, ILI9341 TFT, E-Ink, 7-segment
Actuators 24 SG90 servo, NEMA 17 stepper, relay modules
Communication 23 LoRa RFM95W, GPS NEO-6M, NRF24L01, RC522 RFID
UI Elements 45 Buttons, rotary encoders, NeoPixels, buzzers
Power 30 LiPo batteries, TP4056, buck/boost converters
Mechanical 78 Standoffs, screws, JST connectors, breadboards

All parts have real manufacturer part numbers, accurate electrical specs, physical dimensions, and supplier links.

API Endpoints

Method Endpoint Description
GET /api/health Health check
POST /api/build Start a build pipeline (returns project_id)
GET /api/build/{id}/stream SSE stream of pipeline progress
POST /api/projects/{id}/refine Refine an existing project
GET /api/projects/{id}/download Download project as ZIP

Tech Stack

Backend: Python, FastAPI, Pydantic, SQLite (aiosqlite), trimesh, SSE-Starlette

Frontend: React, TypeScript, Vite, TailwindCSS, Three.js (@react-three/fiber)

LLM: Claude via OpenRouter

Testing

# Backend (157 tests)
cd backend && uv run python -m pytest tests/ -v

# Frontend (39 tests)
cd frontend && npx vitest run

Project Structure

buildor/
├── backend/
│   └── app/
│       ├── main.py                 # FastAPI app + SSE endpoints
│       ├── config.py               # Settings (env vars)
│       ├── models/                 # Pydantic data models (8 files)
│       ├── pipeline/               # 7 pipeline stages + orchestrator
│       ├── parts_db/               # SQLite DB + 329-component seed data
│       ├── cad/                    # Parametric enclosure templates
│       ├── llm/                    # OpenRouter client
│       └── storage/                # Project persistence + ZIP export
├── frontend/
│   └── src/
│       ├── App.tsx                 # Main layout
│       ├── components/             # PromptInput, ProgressBar, 5 result tabs, RefineInput
│       ├── hooks/                  # useSSE, useBuild
│       ├── api/                    # API client
│       └── types/                  # TypeScript types
└── docs/
    └── plans/                      # Design and implementation docs

License

MIT

Contributors

simon-something

Issues