An AI-powered website generator that turns natural language prompts into production-ready, live-previewed web applications in seconds β powered by Gemini 2.5 Flash and WebContainers.
β¨ Features Β· π οΈ Tech Stack Β· π¦ Project Structure Β· π Getting Started Β· π» Usage Β· π€ Contributing
- π€ AI-Powered Code Generation β Generates complete, production-ready React or Node.js projects from plain English descriptions using Google's Gemini 2.5 Flash model.
- π In-Browser Execution β Runs a full Node.js dev environment entirely inside the browser via WebContainers β zero backend servers, zero cloud VMs.
- ποΈ Instant Live Preview β Preview your generated website in a real embedded iframe with a live dev server β see it the moment it's built.
- π Integrated Code Editor β View and inspect generated source code in a Monaco Editor (the engine behind VS Code) with full syntax highlighting.
- π Interactive File Explorer β Navigate the generated project's file tree with collapsible folders, language-aware icons, and one-click file selection.
- π¬ Iterative Refinement via Chat β Don't like something? Send follow-up prompts to tweak, extend, or restyle your website conversationally.
- π₯ One-Click Export β Download the entire generated project as a bundled file, ready to run locally or deploy to any host.
- π¨ Premium Glassmorphism UI β Stunning dark-mode interface with floating orbs, gradient effects, animated transitions, and micro-interactions throughout.
- β‘ Smart Template Detection β AI automatically decides whether to scaffold a React or Node.js project based on the user's intent.
- π Secure by Default β COOP/COEP headers pre-configured for WebContainer compatibility across all deployment targets.
Screenshots and demo GIFs coming soon!
| Landing Page | Generation Workspace |
|---|---|
π₯ Live Demo: Coming Soon
| Layer | Technology | Purpose |
|---|---|---|
| Framework | Next.js 16 | App Router, Server Actions, Turbopack |
| Language | TypeScript 5 | End-to-end type safety |
| UI Library | React 19 | Component rendering |
| AI Model | Gemini 2.5 Flash | Code generation & prompt analysis |
| Browser Runtime | WebContainers API | In-browser Node.js environment |
| Code Editor | Monaco Editor | Syntax-highlighted code viewer |
| UI Components | shadcn/ui + Radix UI | Accessible, composable primitives |
| Styling | Tailwind CSS 4 | Utility-first CSS |
| Icons | Lucide React | Beautiful open-source icons |
| HTTP Client | Axios | API requests |
| Containerization | Docker | Multi-stage Alpine-based builds |
BlinkBuild/
β
βββ app/ # Next.js App Router
β βββ page.tsx # Landing page β hero + prompt form
β βββ layout.tsx # Root layout (Geist fonts, metadata)
β βββ actions.ts # Server Action β redirect to /generate
β βββ globals.css # Global styles & CSS variables
β β
β βββ generate/ # Generation workspace
β β βββ page.tsx # Suspense wrapper
β β βββ generation-content.tsx # Core UI: steps, editor, preview, chat
β β
β βββ api/ # API Routes
β β βββ template/route.ts # POST β AI selects React vs Node scaffold
β β βββ chat/route.ts # POST β Gemini multi-turn code generation
β β βββ gemini/route.ts # POST β Streaming Gemini endpoint (Edge)
β β
β βββ lib/ # Shared logic
β βββ prompt.ts # System prompts & instruction templates
β βββ steps.ts # boltArtifact XML β Step[] parser
β βββ constants.ts # WORK_DIR, allowed HTML elements
β βββ stripindents.ts # Template literal dedent utility
β βββ defaults/
β βββ react.ts # React + Vite starter scaffold
β βββ node.ts # Node.js starter scaffold
β
βββ components/ # React components
β βββ CodeEditor.tsx # Monaco Editor wrapper (read-only)
β βββ FileExplorer.tsx # Recursive file tree browser
β βββ PreviewFrame.tsx # WebContainer β iframe live preview
β βββ ui/ # shadcn/ui primitives
β βββ badge.tsx
β βββ button.tsx
β βββ card.tsx
β βββ label.tsx
β βββ progress.tsx
β βββ scroll-area.tsx
β βββ tabs.tsx
β βββ textarea.tsx
β
βββ hooks/
β βββ useWebcontainers.ts # Singleton WebContainer boot hook
β
βββ lib/
β βββ utils.ts # cn() β clsx + tailwind-merge helper
β
βββ public/ # Static assets (SVGs, favicon)
βββ DockerFile # Multi-stage production build
βββ docker-compose.yml # Compose config (1 CPU, 1 GB RAM limit)
βββ vercel.json # COOP/COEP headers for WebContainers
βββ next.config.ts # Standalone output + security headers
βββ tailwind.config.js # Tailwind configuration
βββ tsconfig.json # TypeScript config
βββ components.json # shadcn/ui configuration
βββ package.json # Dependencies & scripts
| Tool | Version | Notes |
|---|---|---|
| Node.js | β₯ 20.x | Download |
| npm | β₯ 9.x | Bundled with Node.js |
| Gemini API Key | β | Get a free key |
| Docker (optional) | β₯ 24.x | Only for containerized deployment |
git clone https://github.com/SinghalSahab/BlinkBuild.git
cd BlinkBuildnpm installCreate a .env.local file in the project root:
# .env.local
# βββββββββββββββββββββββββββββββββββββββββββββ
# Required: Google Gemini API key
API_KEY=your_gemini_api_key_hereTip
You can get a free Gemini API key at aistudio.google.com/apikey.
npm run devOpen http://localhost:3000 in your browser. π
Important
WebContainers require these HTTP headers to function. They are already configured in next.config.ts and vercel.json:
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
# Start with Turbopack (fast HMR)
npm run dev
# Lint the codebase
npm run lint# Create an optimized production build
npm run build
# Start the production server
npm run start# Build and run with Docker Compose
docker compose up -d --build
# Or build and run manually
docker build -t blinkbuild .
docker run -p 3000:3000 -e API_KEY=your_gemini_api_key blinkbuildThe Dockerfile uses a 3-stage build (deps β builder β runner) with Next.js standalone output for a minimal image size (~150 MB).
# Or deploy via CLI
npx vercel --prodSet API_KEY in your Vercel project's Settings β Environment Variables.
sequenceDiagram
participant User
participant Landing as Landing Page
participant Template as /api/template
participant Chat as /api/chat
participant Gemini as Gemini 2.5 Flash
participant WC as WebContainer
User->>Landing: Types a prompt
Landing->>Template: POST { prompt }
Template->>Gemini: "React or Node?"
Gemini-->>Template: "react"
Template-->>Landing: Base prompts + UI scaffold
Landing->>Chat: POST { messages }
Chat->>Gemini: Generate full project
Gemini-->>Chat: boltArtifact XML response
Chat-->>Landing: Parsed steps & file tree
Landing->>WC: Mount files to in-browser FS
WC->>WC: npm install && npm run dev
WC-->>User: Live preview in iframe β¨
Contributions, issues, and feature requests are warmly welcome!
- Fork the repository
- Create your feature branch
git checkout -b feature/your-amazing-feature
- Commit your changes with a descriptive message
git commit -m "feat: add your amazing feature" - Push to your branch
git push origin feature/your-amazing-feature
- Open a Pull Request against
main
- Follow existing code style and conventions
- Write meaningful commit messages (Conventional Commits preferred)
- Test your changes locally before submitting
- Keep PRs focused β one feature or fix per PR
Note
Not sure where to start? Check out the open issues or suggest a new feature!
This project is licensed under the MIT License. See the LICENSE file for details.
MIT License β Copyright (c) 2025 Prakhar Singhal
Bolt.new β Inspiration for AI-powered dev workflows Β· StackBlitz β WebContainers technology Β· Vercel β Next.js & hosting Β· Google AI β Gemini models
Built with β‘ by Prakhar Singhal
If this project helped you, consider giving it a β β it means a lot!