Spaces:
Running
Running
metadata
title: CodeGen
emoji: 🤖
colorFrom: indigo
colorTo: blue
sdk: docker
python_version: 3.1
app_file: main.py
app_port: 8000
pinned: false
CodeGen
A FastAPI service that generates single-page web applications using AI. This service takes natural language descriptions and automatically generates web applications, creates GitHub repositories, and handles deployments.
Features
- AI-powered web application generation
- Automatic GitHub repository creation and management
- GitHub Pages hosting setup
- Built-in evaluation submission handling
- Support for multi-round updates
- Secure API with secret key authentication
Requirements
- Python 3.10 or higher
- GitHub account with API access
- AI API key (OpenRouter)
Setup
Clone the repository:
git clone <repo url or ssh> cd codegenCreate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activateCreate a
.envfile with your credentials:SECRET_KEY=your_secret GITHUB_TOKEN=your_github_token AI_API_KEY=your_ai_keyInstall dependencies:
uv syncInstall development dependencies:
uv sync -G dev
Usage
Start the development server:
uvicorn main:app --reload
The server will listen on http://localhost:8000 for incoming task requests.
API Endpoints
GET /: Health check endpointPOST /task1: Main endpoint for task processing- Requires authentication via
secretfield - Handles both initial creation (round 1) and updates (round > 1)
- Returns repository and GitHub Pages URLs
- Requires authentication via
License
MIT License - See LICENSE file for details