Blueprint is AI-native full-stack hardware. It turns a prompt (and optionally an image) into a structured, validated Hardware IR package plus generated product imagery, wiring diagrams, BOM, and build steps.
This repository is an MVP and research prototype focused on low-voltage maker electronics (3.3V–5V) and safe, educational projects.
- Compile a hardware idea into typed Hardware IR (Pydantic)
- Run rule-based electrical validation (shorts, voltage mismatch, unpowered ICs, pin conflicts, overcurrent risk)
- Visualize wiring with:
- Interactive React Flow schematic
- Generated SVG schematic
- View a lightweight 3D mechanical layout (Three.js / React Three Fiber)
- Generate an optional product concept image with an image model
- Persist generated projects to Supabase through the Supabase client when configured, with an automatic SQLite fallback
- Let external agents integrate over REST long-polling, WebSocket, optional TCP JSONL sockets, or MCP-style JSON-RPC tools
Blueprint follows a sequential processing pipeline:
- Input: User provides a prompt and optional image
- Agent Processing: ADK-style sequential agents process the input using the configured structured LLM provider
- Hardware IR Generation: Agents produce typed Hardware IR (Pydantic models)
- Validation & Repair: Rule-based validation checks the design and repairs issues automatically
- UI Outputs: Generate interactive visualizations (product image, React Flow schematic, SVG diagrams, 3D mechanical layout) and save to database
- Persistence: Project data is stored in Supabase or SQLite
Blueprint intentionally limits scope to low-voltage maker electronics:
- 3.3V–5V DC systems
- Breadboard-friendly microcontrollers, sensors, displays, and actuators
- Educational and hobbyist prototypes
It blocks or warns on high-risk domains (mains AC, medical, automotive control, weapons, high-power battery packs). See docs/validation.md.
Detailed instructions live in docs/setup.md. The short version:
From the repo root:
./scripts/dev.shThis starts the FastAPI backend and Next.js frontend together. Use BACKEND_PORT, FRONTEND_PORT, BACKEND_HOST, or FRONTEND_HOST to override defaults.
Build and run both images from the repo root:
docker compose up --buildThe Docker setup runs the backend on port 8000, the frontend on port 3000, and stores SQLite data in a named Docker volume. Set LLM_PROVIDER, OPENAI_API_KEY, LLM_API_KEY, or the other variables from .env.example before running Compose to use a live model provider; otherwise the backend defaults to simulation mode.
If you change the published backend URL, rebuild the frontend with a matching public API URL:
BACKEND_PORT=8010 NEXT_PUBLIC_API_URL=http://localhost:8010 docker compose up --buildFrom the repo root:
python3 -m venv .venv
source .venv/bin/activate
pip install -r backend/requirements.txtOptional: seed the component library The server auto-seeds the component library on startup if empty. To seed manually:
python3 backend/seed_db.pyRun the backend:
uvicorn backend.main:app --reload --port 8000Backend CLI:
./scripts/blueprint-backend serve --reload
./scripts/blueprint-backend health
./scripts/blueprint-backend jobs --status running
./scripts/blueprint-backend jobs --local --limit 10
./scripts/blueprint-backend seedThe CLI uses .venv/bin/python when present and falls back to python3. health
checks the root, component, and A2A jobs endpoints; jobs --local reads the
SQLite job metadata store directly when the API server is not running.
To run with OpenAI:
LLM_PROVIDER=openai OPENAI_API_KEY=your_openai_api_key_here OPENAI_MODEL=gpt-4o-mini uvicorn backend.main:app --reload --port 8000Environment variables (recommended via a repo-root .env; see .env.example):
SUPABASE_URL: Supabase project API URL, for examplehttps://your-project-ref.supabase.co.SUPABASE_SERVICE_ROLE_KEY/SUPABASE_SECRET_KEY: Backend-only Supabase key for writes. Do not use anon/publishable keys.DATABASE_BACKEND: Optional override:supabaseorsqlite.SQLITE_DATABASE_URL: SQLite fallback URL (default:sqlite:///./blueprint.db).BLUEPRINT_DEPLOYMENT: Whentrue, deployed builds without a live LLM show generated examples plus an alpha signup form instead of running generation.LLM_PROVIDER: Live generation provider:gemini,openai,openai-compatible, orsimulation.OPENAI_API_KEY: API key for first-party OpenAI whenLLM_PROVIDER=openai.OPENAI_MODEL: OpenAI model ID. The example default isgpt-4o-mini.OPENAI_RESPONSE_FORMAT: OpenAI response format. Defaults tojson_schema;json_objectandnoneare also supported.OPENAI_TIMEOUT_SECONDS: First-party OpenAI read timeout. Defaults to300.OPENAI_REASONING_EFFORT: Optional reasoning effort for GPT-5/o-series models, for examplelow.OPENAI_TEMPERATURE: Optional first-party OpenAI sampling temperature. Omitted by default so models that only support their default temperature can run.OPENAI_PROJECT_ID/OPENAI_ORG_ID: Optional OpenAI project and organization routing headers.IMAGE_OUTPUT_ENABLED: Optional global default for generated product images. The UI and API can opt in per job withgenerate_image=true.IMAGE_PROVIDER: Image provider. Supportsopenai,openai-compatible, ornone.OPENAI_IMAGE_MODEL: OpenAI image model ID. The example default isgpt-image-2.OPENAI_IMAGE_SIZE: Generated image size, for example1024x1024.SUPABASE_S3_ENDPOINT: Supabase Storage S3 endpoint associated with image uploads. Defaults fromSUPABASE_URL; this project useshttps://knmuwxhfrgkykyvblzwi.storage.supabase.co/storage/v1/s3.SUPABASE_S3_BUCKET: Supabase Storage bucket for image uploads (default:contents).SUPABASE_S3_ACCESS_KEY_ID/SUPABASE_S3_SECRET_ACCESS_KEY: Optional S3-compatible fallback credentials. The normal backend path uploads through the Supabase client withSUPABASE_URLplus the service-role/secret key.SUPABASE_IMAGE_SIGNED_URL_SECONDS: Lifetime for refreshed Supabase Storage read URLs when projects are loaded (default:86400).LLM_API_KEY: Generic provider API key alias. For Gemini,GEMINI_API_KEYorGOOGLE_API_KEYstill work.LLM_MODEL: Model to use, for examplegemini-3.5-flashor an OpenAI/OpenAI-compatible model ID.LLM_TIMEOUT_SECONDS: Generic read timeout. OpenAI-compatible endpoints default to90.LLM_REASONING_EFFORT: Optional generic reasoning effort for compatible endpoints that support it.LLM_TEMPERATURE: Optional generic sampling temperature. OpenAI-compatible endpoints default to0.2; setdefault,none, oromitto omit it.STRICT_LLM: Set totrue(default) to fail fast when model validation is enabled and the model is unavailable. Set tofalseto attempt fallback.LLM_FALLBACK_MODEL: Optional fallback model whenSTRICT_LLM=false.LLM_BASE_URL: Optional base URL for OpenAI-compatible providers.JOB_METADATA_BACKEND: Durable A2A job metadata backend.autouses Supabase when the main app DB is Supabase, otherwise SQLite.JOB_METADATA_DB_PATH: SQLite file used when A2A job metadata is on SQLite (default:./blueprint_jobs.db).A2A_SOCKET_ENABLED: Set totrueto start the optional TCP JSONL A2A socket.A2A_SOCKET_HOST/A2A_SOCKET_PORT: Host and port for the optional TCP JSONL listener.
If no live LLM provider is configured or generation fails, the backend returns deterministic simulation outputs based on built-in example projects.
cd frontend
npm install
npm run devOpen:
- http://localhost:3000 (UI)
- http://localhost:8000/api/docs (API docs)
Tip: load an example directly with http://localhost:3000/?example=pocket_mp3_player (or any JSON under frontend/public/examples/).
