Open Source Alternative to Lovable, v0, Bolt, Replit, Emergent. ๐ Star if you like it!
Micracode
Open-Source AI Web App Builder

Describe an app in natural language and Micracode streams code into an in-browser workspace.
Iterate by chat or edit the code directly in a Monaco editor โ everything runs on your laptop.
Quick Install
pip install micracode
Requires Python 3.12+. No Node.js, no Docker, no separate frontend setup.
1. Set your API key
Google Gemini (default, free tier available):
export GOOGLEAPIKEY=your-key
OpenAI:
export LLM_PROVIDER=openai export OPENAIAPIKEY=your-key export OPENAI_MODEL=gpt-4o
Ollama (local, no API key needed):
export LLM_PROVIDER=ollama export OLLAMA_MODEL=llama3.2 # any model you have pulled
Or put any of the above in a .env file in your working directory.
2. Start
micracode web
Open http://localhost:8000 โ the full UI and API run from the same process.
micracode web --port 9000 # change port
micracode web --host 0.0.0.0 # expose on your local network
3. Build something
- Type a description on the home screen โ Micracode generates a working project
- Chat to iterate, edit code in the Monaco editor, and preview your app live
- Projects are saved as plain folders at
~/opener-apps/
Getting started & staying tuned with us.
Star us, and you will receive all release notifications from GitHub without any delay!
Features
- Natural-Language Codegen โ Describe an app in plain English; Micracode streams a working project into the workspace file by file.
- Iterative Chat โ Refine your project through conversation. Ask for changes, fixes, or new features and watch them stream in.
- In-Browser Monaco Editor โ Edit generated code directly in a full Monaco editor; changes persist to disk.
- Pluggable LLM Providers โ Ships with Google Gemini by default; switch to OpenAI or local Ollama with one env var. Ollama models are discovered dynamically โ no API key required.
- Local-First Storage โ Projects live as plain folders on your filesystem. No database, no auth, no cloud service required.
- Streaming Backend โ Server-sent events deliver generated code in real time using a typed stream-event contract shared between web and API.
- Snapshots & Prompt History โ Every project keeps its prompt history and snapshots so you can review or roll back.
Tech Stack
Backend
- FastAPI โ High-performance Python web framework
- LangChain + Google Gemini / OpenAI / Ollama โ Pluggable LLM orchestration (gemini-2.5-flash by default)
- SSE-Starlette โ Server-sent events for streaming code generation
- UV โ Modern Python package manager
- Pytest โ Storage and HTTP test suite
Frontend
- Next.js 15 โ React framework with App Router
- React 19 โ Latest React with concurrent features
- Tailwind CSS โ Utility-first CSS framework
- Radix UI + shadcn/ui โ Accessible component primitives
- Monaco Editor โ VS Code's editor in the browser
- WebContainer API โ Run Node.js apps directly in the browser
- Zustand โ Lightweight state management
- ai-sdk โ Vercel AI SDK for chat streaming
Tooling
- Bun โ JS workspace manager and runtime
- TypeScript โ End-to-end type safety, with shared types in
packages/shared
Development Setup
For contributors and people building from source. If you just want to use Micracode, see Quick Install above.
Prerequisites
- Node.js v22.18.0 (pinned via
.nvmrc) - Bun โฅ 1.1.0
- Python โฅ 3.12 (managed automatically by
uv) - uv โฅ 0.4
- A Google Gemini or OpenAI API key, or a locally running Ollama instance (no API key needed)
Environment Setup
Copy the example env file into the API app and add your key:
cp .env.example apps/api/.env $EDITOR apps/api/.env
Minimum config (Gemini, the default provider):
LLM_PROVIDER=gemini GOOGLEAPIKEY=yourgeminiapi_key
Or use OpenAI:
LLM_PROVIDER=openai OPENAIAPIKEY=youropenaiapi_key OPENAI_MODEL=gpt-4o
Or use a local Ollama model (no API key required):
LLM_PROVIDER=ollama OLLAMABASEURL=http://localhost:11434 OLLAMA_MODEL=llama3.2
Ollama models are discovered dynamically from your local daemon โ any model you have pulled (ollama pull <model>) will appear in the UI picker automatically.
See docs/configuration.md for the full reference and supported model IDs.
Installation
nvm use # picks up .nvmrc -> Node 22.18.0
bun install # JS workspaces (web + shared)
bun run api:install # Python deps for the API (creates a uv-managed venv)
Running the Application
Start both apps in parallel:
bun run dev
- Web:
- API:
bun run dev:web # Next.js only
bun run dev:api # FastAPI only (uvicorn --reload)
Open
Project Structure
micracode/
โโโ apps/
โ โโโ web/ # Next.js 15 frontend
โ โ โโโ src/
โ โ โ โโโ app/ # App Router pages
โ โ โ โโโ components/ # React components (incl. shadcn/ui)
โ โ โ โโโ lib/ # Utilities and clients
โ โ โ โโโ store/ # Zustand stores
โ โ โโโ package.json
โ โ
โ โโโ api/ # FastAPI backend
โ โโโ src/micracode_api/
โ โ โโโ agents/ # LLM orchestrator, prompts, model catalog
โ โ โโโ routers/ # health, models, projects, generate
โ โ โโโ schemas/ # Pydantic request/response models
โ โ โโโ starter/ # Starter project templates
โ โ โโโ config.py # Settings (env vars)
โ โ โโโ storage.py # Local filesystem project storage
โ โ โโโ main.py # FastAPI app entry point
โ โโโ tests/
โ โโโ pyproject.toml
โ
โโโ packages/
โ โโโ shared/ # Shared TypeScript types (stream event contract)
โ
โโโ docs/ # End-user documentation
โโโ README.md
API Endpoints
All endpoints are mounted under /v1.
| Method | Endpoint | Description | |--------|----------|-------------| | GET | /v1/health | Service health check | | GET | /v1/models | List available LLM models | | POST | /v1/generate | Stream code generation events (SSE) | | GET | /v1/projects | List all projects | | POST | /v1/projects | Create a new project | | GET | /v1/projects/{id} | Get a project by id | | DELETE | /v1/projects/{id} | Delete a project | | GET | /v1/projects/{id}/files | List/read project files | | PUT | /v1/projects/{id}/files | Write project files | | GET | /v1/projects/{id}/download | Download project as archive | | GET | /v1/projects/{id}/prompts | Get prompt history | | POST | /v1/projects/{id}/prompts/pop-assistant | Pop last assistant message | | GET | /v1/projects/{id}/snapshots | List project snapshots |
Documentation
End-user docs live in docs/:
- Getting Started โ install prerequisites, configure an API key, and run the app.
- Configuration โ environment variables, switching between OpenAI and Gemini, and supported model IDs.
- Using the Workspace โ the home page, chat, editor, and preview panels.
- Projects on Disk โ where your generated apps live and how to work with them outside the app.
- Troubleshooting โ common errors and how to fix them.
- FAQ โ short answers to common questions.
Useful Scripts
bun run dev # web + api in parallel
bun run dev:web # Next.js only
bun run dev:api # FastAPI only (uvicorn --reload, 127.0.0.1:8000)
bun run typecheck # TS across all workspaces
bun run lint # eslint across workspaces
bun run format # prettier
bun run test:api # pytest (storage + HTTP tests)
bun run api:lint # ruff check
bun run api:format # ruff format
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Feel free to open issues and pull requests.
Join our community Discord