Skip to content

krishij03/appBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppBuilder

AI-powered full-stack application builder that transforms natural language prompts into runnable React + FastAPI applications. Built with a multi-agent architecture using LLMs.

Features

  • Natural language to working application
  • Multi-agent system (Product Manager, Backend Dev, Frontend Dev, QA, Auto-Fixer)
  • Real-time progress streaming via Server-Sent Events
  • Docker-based sandbox for running generated apps
  • Support for multiple LLM providers (OpenAI, DeepSeek, Google Gemini, Groq)
  • Optional Supabase integration for data persistence
  • Auto-fix system for build and runtime errors

Tech Stack

Backend:

  • Django 5.x with Django REST Framework
  • Django Channels for WebSocket support
  • Celery for async task processing (optional)
  • SQLite for development (PostgreSQL ready)

Frontend:

  • React 18 with TypeScript
  • Vite for fast development
  • Server-Sent Events for real-time updates

Generated Apps:

  • FastAPI backend with Pydantic models
  • React + TypeScript + Vite frontend
  • Docker Compose for containerization

Prerequisites

  • Python 3.11 or higher
  • Node.js 18 or higher
  • Docker Desktop (required for sandbox)
  • At least one LLM API key (OpenAI, DeepSeek, Google, or Groq)

Quick Start

1. Clone the Repository

git clone https://github.com/krishij03/appBuilder.git
cd appBuilder

2. Backend Setup

cd backend

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create environment file
cp .env.template .env

Edit backend/.env and add your API keys:

# Required: At least one LLM provider
OPENAI_API_KEY=sk-your-key-here
# OR
DEEPSEEK_API_KEY=sk-your-key-here
# OR
GOOGLE_API_KEY=AIza-your-key-here

Run database migrations and start the server:

python manage.py migrate
python manage.py runserver 8000

3. Frontend Setup

Open a new terminal:

cd frontend

# Install dependencies
npm install

# Create environment file
cp .env.template .env.local

# Start development server
npm run dev

4. Access the Application

Open http://localhost:5173 in your browser.

Usage

  1. Enter a prompt describing the app you want (e.g., "Build a todo list app with categories")
  2. Click Generate and watch the agents work in real-time
  3. Review the generated code when prompted
  4. Approve to start the Docker sandbox
  5. Click "Open App" to view your running application

Configuration

LLM Models

Edit backend/api/config/llm_config.py to configure which models each agent uses:

LLM_CONFIG = {
    "product_manager": {
        "model": "openai:gpt-4o-mini",
        "temperature": 0.3,
    },
    "backend_dev": {
        "model": "deepseek:deepseek-chat",
        "temperature": 0.2,
    },
    # ... other agents
}

Supported Providers:

Provider Models Notes
OpenAI gpt-4o-mini, gpt-4o, gpt-4-turbo Most reliable
DeepSeek deepseek-chat, deepseek-reasoner Cost-effective
Google gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro Free tier available
Groq llama-3.1-8b-instant, llama-3.1-70b-versatile Fast inference

Storage Mode

The frontend allows choosing between:

  • Local Storage: In-memory data (default, no persistence)
  • Supabase: Cloud database with persistence (requires Supabase setup)

Architecture

User Prompt
    |
    v
[Product Manager Agent] --> Spec JSON
    |
    v
[Backend Dev Agent] --> FastAPI code
    |
    v
[Frontend Dev Agent] --> React code
    |
    v
[QA Agent] --> Validation
    |
    v (auto-fix if issues)
[Auto-Fixer Agent] --> Fixed code
    |
    v
[DevOps] --> Docker configs
    |
    v
[Bundler] --> ZIP package
    |
    v
[Sandbox] --> Running containers

API Endpoints

Endpoint Method Description
/healthz GET Health check
/generate-app POST Start app generation
/runs/{id} GET Get run status
/runs/{id}/events GET SSE stream for progress
/runs/{id}/review POST Submit review decision
/runs/{id}/download GET Download bundle
/runs/{id}/sandbox/start POST Start sandbox
/runs/{id}/sandbox/stop POST Stop sandbox
/runs/{id}/container-logs GET Get Docker logs
/projects GET List running projects
/models GET Get LLM configurations

Environment Variables

Backend (.env)

Variable Required Description
DEBUG No Enable debug mode (default: True)
DJANGO_SECRET_KEY No Django secret key
ALLOWED_ORIGINS No CORS origins (default: localhost:5173)
OPENAI_API_KEY One required OpenAI API key
DEEPSEEK_API_KEY One required DeepSeek API key
GOOGLE_API_KEY One required Google Gemini API key
GROQ_API_KEY One required Groq API key
SUPABASE_URL No Supabase project URL
SUPABASE_SERVICE_ROLE_KEY No Supabase service key

Frontend (.env.local)

Variable Required Description
VITE_API_BASE_URL Yes Backend URL (default: http://localhost:8000)
VITE_SUPABASE_URL No Supabase URL for storage mode
VITE_SUPABASE_ANON_KEY No Supabase anon key

Development

Running with Django Development Server

cd backend
python manage.py runserver 8000

Running with Daphne (Better SSE Support)

cd backend
daphne -b 0.0.0.0 -p 8000 django_backend.asgi:application

Running with Uvicorn

cd backend
uvicorn django_backend.asgi:application --host 0.0.0.0 --port 8000 --reload

Running Celery (Optional)

For async task processing with Redis:

# Start Redis first
# Then start Celery worker
celery -A django_backend worker -l info

# Start Celery beat for scheduled tasks
celery -A django_backend beat -l info

Troubleshooting

Docker Sandbox Fails to Start

  • Ensure Docker Desktop is running
  • Check if ports are in use: lsof -i :8050
  • Verify Docker Compose: docker compose version

SSE Connection Issues

  • Check CORS settings in backend .env
  • Try using Daphne or Uvicorn instead of Django runserver
  • Check browser console for errors

Build Fails with QA Errors

The system automatically attempts to fix QA issues. If problems persist:

  • Check the Docker logs in the UI
  • Review the generated code in the workflow log
  • Try a more specific prompt

Generated App Shows 422 Errors

This usually means API contract mismatch. The auto-fixer should handle this, but if it persists:

  • Ensure the frontend sends only required fields in POST/PUT requests
  • Check that Pydantic models match the frontend expectations

Project Structure

appBuilder/
├── backend/
│   ├── api/
│   │   ├── agents/          # LLM agents
│   │   ├── config/          # LLM configuration
│   │   ├── services/        # Core services
│   │   └── views.py         # API endpoints
│   ├── django_backend/      # Django settings
│   ├── requirements.txt
│   └── .env.template
├── frontend/
│   ├── src/
│   │   ├── App.tsx          # Main application
│   │   └── lib/             # Utilities
│   ├── package.json
│   └── .env.template
└── infra/
    └── docker-compose.yml   # For running AppBuilder itself

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors