Spaces:
Running
Running
fix
Browse files- Dockerfile +0 -2
- README.md +0 -8
- README_GRADIO.md +0 -145
- app.py +0 -31
- backend_search_replace.py +1 -1
Dockerfile
CHANGED
|
@@ -52,7 +52,6 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
| 52 |
pip install --no-cache-dir -r requirements.txt
|
| 53 |
|
| 54 |
# Copy application code
|
| 55 |
-
COPY --chown=user:user anycoder_app/ ./anycoder_app/
|
| 56 |
COPY --chown=user:user backend_api.py .
|
| 57 |
COPY --chown=user:user backend_models.py .
|
| 58 |
COPY --chown=user:user backend_docs_manager.py .
|
|
@@ -61,7 +60,6 @@ COPY --chown=user:user backend_parsers.py .
|
|
| 61 |
COPY --chown=user:user backend_deploy.py .
|
| 62 |
COPY --chown=user:user backend_search_replace.py .
|
| 63 |
COPY --chown=user:user project_importer.py .
|
| 64 |
-
COPY --chown=user:user app.py .
|
| 65 |
|
| 66 |
# Copy built frontend from builder stage
|
| 67 |
COPY --chown=user:user --from=frontend-builder /build/.next ./frontend/.next
|
|
|
|
| 52 |
pip install --no-cache-dir -r requirements.txt
|
| 53 |
|
| 54 |
# Copy application code
|
|
|
|
| 55 |
COPY --chown=user:user backend_api.py .
|
| 56 |
COPY --chown=user:user backend_models.py .
|
| 57 |
COPY --chown=user:user backend_docs_manager.py .
|
|
|
|
| 60 |
COPY --chown=user:user backend_deploy.py .
|
| 61 |
COPY --chown=user:user backend_search_replace.py .
|
| 62 |
COPY --chown=user:user project_importer.py .
|
|
|
|
| 63 |
|
| 64 |
# Copy built frontend from builder stage
|
| 65 |
COPY --chown=user:user --from=frontend-builder /build/.next ./frontend/.next
|
README.md
CHANGED
|
@@ -14,8 +14,6 @@ hf_oauth_scopes:
|
|
| 14 |
- write-discussions
|
| 15 |
---
|
| 16 |
|
| 17 |
-
> **Note:** This is the Docker Space configuration for the React frontend version.
|
| 18 |
-
> For the original Gradio app, see `README_GRADIO.md`.
|
| 19 |
|
| 20 |
# AnyCoder - AI Code Generator with React Frontend
|
| 21 |
|
|
@@ -42,12 +40,6 @@ anycoder/
|
|
| 42 |
│ │ ├── lib/ # API client, auth utilities
|
| 43 |
│ │ └── types/ # TypeScript types
|
| 44 |
│ └── package.json
|
| 45 |
-
├── anycoder_app/ # Original Gradio app modules
|
| 46 |
-
│ ├── agent.py
|
| 47 |
-
│ ├── config.py
|
| 48 |
-
│ ├── deploy.py
|
| 49 |
-
│ └── ...
|
| 50 |
-
├── app.py # Original Gradio interface
|
| 51 |
├── requirements.txt # Python dependencies
|
| 52 |
├── Dockerfile # Docker Space configuration
|
| 53 |
└── start_fullstack.sh # Local development script
|
|
|
|
| 14 |
- write-discussions
|
| 15 |
---
|
| 16 |
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# AnyCoder - AI Code Generator with React Frontend
|
| 19 |
|
|
|
|
| 40 |
│ │ ├── lib/ # API client, auth utilities
|
| 41 |
│ │ └── types/ # TypeScript types
|
| 42 |
│ └── package.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
├── requirements.txt # Python dependencies
|
| 44 |
├── Dockerfile # Docker Space configuration
|
| 45 |
└── start_fullstack.sh # Local development script
|
README_GRADIO.md
DELETED
|
@@ -1,145 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Anycoder
|
| 3 |
-
emoji: 🔥
|
| 4 |
-
colorFrom: indigo
|
| 5 |
-
colorTo: indigo
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 5.49.1
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
disable_embedding: true
|
| 11 |
-
hf_oauth: true
|
| 12 |
-
hf_oauth_scopes:
|
| 13 |
-
- manage-repos
|
| 14 |
-
---
|
| 15 |
-
|
| 16 |
-
# AnyCoder - AI Code Generator
|
| 17 |
-
|
| 18 |
-
> **📱 New:** A React/TypeScript frontend version is now the default! This file is the backup Gradio version. For the Docker Space with modern React UI, see `README.md`.
|
| 19 |
-
|
| 20 |
-
AnyCoder is an AI-powered code generator that helps you create applications by describing them in plain English. It supports multiple AI models, multimodal input, website redesign, and one-click deployment to Hugging Face Spaces. The UI is built with Gradio theming for a minimal, modern experience.
|
| 21 |
-
|
| 22 |
-
## Features
|
| 23 |
-
|
| 24 |
-
- **Multi-Model Support**: Choose from Moonshot Kimi-K2, Kimi K2 Turbo (Preview), Kimi K2 Thinking, DeepSeek V3, DeepSeek R1, ERNIE-4.5-VL, MiniMax M2, Qwen3-235B-A22B, Qwen3-30B-A3B-Instruct-2507, Qwen3-30B-A3B-Thinking-2507, SmolLM3-3B, GLM-4.1V-9B-Thinking, Gemini 2.5 Flash and Gemini 2.5 Pro (OpenAI-compatible)
|
| 25 |
-
- Claude-Opus-4.1 (via Poe)
|
| 26 |
-
- **Flexible Input**: Describe your app in text, upload a UI design image (for multimodal models), provide a reference file (PDF, TXT, MD, CSV, DOCX, or image), or enter a website URL for redesign
|
| 27 |
-
- **Web Search Integration**: Enable real-time web search (Tavily, with advanced search depth) to enhance code generation with up-to-date information and best practices
|
| 28 |
-
- **Code Generation**: Generate code in HTML, Python, JS, and more. Special support for transformers.js apps (outputs index.html, index.js, style.css)
|
| 29 |
-
- **Live Preview**: Instantly preview generated HTML in a sandboxed iframe
|
| 30 |
-
- **Modify Existing Code**: Use search/replace block format to update generated HTML
|
| 31 |
-
- **One-Click Deployment**: Deploy your app to Hugging Face Spaces (Gradio, Streamlit, Static HTML, or Transformers.js) with OAuth login
|
| 32 |
-
- **History & Examples**: Chat-like history of all interactions and quick example prompts for fast prototyping
|
| 33 |
-
- **Minimal, Modern UI**: Built with Gradio 5.x, using only built-in theming and styling (no custom CSS)
|
| 34 |
-
|
| 35 |
-
## Installation
|
| 36 |
-
|
| 37 |
-
1. Clone the repository:
|
| 38 |
-
```bash
|
| 39 |
-
git clone <repository-url>
|
| 40 |
-
cd anycoder
|
| 41 |
-
```
|
| 42 |
-
2. Install dependencies:
|
| 43 |
-
```bash
|
| 44 |
-
pip install -r requirements.txt
|
| 45 |
-
```
|
| 46 |
-
3. Set up environment variables:
|
| 47 |
-
```bash
|
| 48 |
-
export HF_TOKEN="your_huggingface_token"
|
| 49 |
-
export DASHSCOPE_API_KEY="your_dashscope_api_key" # Required for Qwen3-30B models via DashScope
|
| 50 |
-
export POE_API_KEY="your_poe_api_key" # Required for GPT-5, Grok-4, and Grok-Code-Fast-1 via Poe
|
| 51 |
-
export GEMINI_API_KEY="your_gemini_api_key" # Required for Gemini models
|
| 52 |
-
export MOONSHOT_API_KEY="your_moonshot_api_key" # Required for Kimi models
|
| 53 |
-
export MINIMAX_API_KEY="your_minimax_api_key" # Required for MiniMax M2 model
|
| 54 |
-
```
|
| 55 |
-
|
| 56 |
-
## Usage
|
| 57 |
-
|
| 58 |
-
1. Run the application:
|
| 59 |
-
```bash
|
| 60 |
-
python app.py
|
| 61 |
-
```
|
| 62 |
-
2. Open your browser and navigate to the provided URL
|
| 63 |
-
3. Describe your application in the text input field, or:
|
| 64 |
-
- Upload a UI design image (for multimodal models)
|
| 65 |
-
- Upload a reference file (PDF, TXT, MD, CSV, DOCX, or image)
|
| 66 |
-
- Enter a website URL for redesign (the app will extract and analyze the HTML and content)
|
| 67 |
-
- Enable web search for up-to-date information
|
| 68 |
-
- Choose a different AI model or code language
|
| 69 |
-
4. Click "Generate" to create your code
|
| 70 |
-
5. View the generated code in the Code tab or see it in action in the Preview tab
|
| 71 |
-
6. Use the History tab to review previous generations
|
| 72 |
-
7. **Deploy to Space**: Enter a title and click "🚀 Deploy App" to publish your application (OAuth login required) - the SDK is automatically matched to your selected code language
|
| 73 |
-
|
| 74 |
-
## Supported Models
|
| 75 |
-
|
| 76 |
-
- Moonshot Kimi-K2
|
| 77 |
-
- Kimi K2 Turbo (Preview)
|
| 78 |
-
- Kimi K2 Thinking
|
| 79 |
-
- DeepSeek V3
|
| 80 |
-
- DeepSeek V3.1
|
| 81 |
-
- DeepSeek V3.1 Terminus
|
| 82 |
-
- DeepSeek V3.2-Exp
|
| 83 |
-
- DeepSeek R1
|
| 84 |
-
- MiniMax M2
|
| 85 |
-
- Qwen3-235B-A22B
|
| 86 |
-
- Qwen3-4B-Instruct-2507
|
| 87 |
-
- Qwen3-4B-Thinking-2507
|
| 88 |
-
- Qwen3-30B-A3B-Instruct-2507 (via DashScope)
|
| 89 |
-
- Qwen3-30B-A3B-Thinking-2507 (via DashScope)
|
| 90 |
-
- GPT-5 (via Poe)
|
| 91 |
-
- Grok-4 (via Poe)
|
| 92 |
-
- Claude-Opus-4.1 (via Poe)
|
| 93 |
-
- Gemini 2.5 Flash (OpenAI-compatible)
|
| 94 |
-
- Gemini 2.5 Pro (OpenAI-compatible)
|
| 95 |
-
|
| 96 |
-
## Input Options
|
| 97 |
-
|
| 98 |
-
- **Text Prompt**: Describe your app or code requirements
|
| 99 |
-
- **Image Upload**: For multimodal models, upload a UI design image to generate code from visuals
|
| 100 |
-
- **File Upload**: Provide a reference file (PDF, TXT, MD, CSV, DOCX, or image) for code generation or text extraction (OCR for images)
|
| 101 |
-
- **Website URL**: Enter a URL to extract and redesign the website (HTML and content are analyzed and modernized)
|
| 102 |
-
|
| 103 |
-
## Code Generation & Modification
|
| 104 |
-
|
| 105 |
-
- Generates code in HTML, Python, JS, and more (selectable via dropdown)
|
| 106 |
-
- Special support for transformers.js apps (outputs index.html, index.js, style.css)
|
| 107 |
-
- Svelte apps
|
| 108 |
-
- For HTML, provides a live preview in a sandboxed iframe
|
| 109 |
-
- For modification requests, uses a search/replace block format to update existing HTML
|
| 110 |
-
|
| 111 |
-
## Deployment
|
| 112 |
-
|
| 113 |
-
- Deploy generated apps to Hugging Face Spaces directly from the UI
|
| 114 |
-
- Supported SDKs: Gradio (Python), Streamlit (Python), Static (HTML), Transformers.js
|
| 115 |
-
- OAuth login with Hugging Face is required for deployment to user-owned Spaces
|
| 116 |
-
|
| 117 |
-
## History & Examples
|
| 118 |
-
|
| 119 |
-
- Maintains a chat-like history of user/assistant interactions
|
| 120 |
-
- Quick example prompts are available in the sidebar for fast prototyping
|
| 121 |
-
|
| 122 |
-
## UI/UX
|
| 123 |
-
|
| 124 |
-
- Built with Gradio 5.x, using only Gradio's built-in theming and styling (no custom CSS)
|
| 125 |
-
- Minimal, uncluttered sidebar and interface
|
| 126 |
-
|
| 127 |
-
## Environment Variables
|
| 128 |
-
|
| 129 |
-
- `HF_TOKEN`: Your Hugging Face API token (required)
|
| 130 |
-
- `GEMINI_API_KEY`: Your Google Gemini API key (required to use Gemini models)
|
| 131 |
-
- `MOONSHOT_API_KEY`: Your Moonshot AI API key (required to use Kimi models)
|
| 132 |
-
- `MINIMAX_API_KEY`: Your MiniMax API key (required to use MiniMax M2 model)
|
| 133 |
-
|
| 134 |
-
## Project Structure
|
| 135 |
-
|
| 136 |
-
```
|
| 137 |
-
anycoder/
|
| 138 |
-
├── app.py # Main application (all logic and UI)
|
| 139 |
-
├── requirements.txt
|
| 140 |
-
├── README.md # This file
|
| 141 |
-
```
|
| 142 |
-
|
| 143 |
-
## License
|
| 144 |
-
|
| 145 |
-
[Add your license information here]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
DELETED
|
@@ -1,31 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
AnyCoder - AI Code Generator
|
| 3 |
-
Main application entry point - now with modular architecture!
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
-
# Import initialization functions from modules
|
| 7 |
-
from anycoder_app.docs_manager import (
|
| 8 |
-
initialize_gradio_docs,
|
| 9 |
-
initialize_comfyui_docs,
|
| 10 |
-
initialize_fastrtc_docs
|
| 11 |
-
)
|
| 12 |
-
from anycoder_app.ui import demo
|
| 13 |
-
|
| 14 |
-
if __name__ == "__main__":
|
| 15 |
-
# Initialize documentation systems
|
| 16 |
-
print("Initializing Gradio documentation...")
|
| 17 |
-
initialize_gradio_docs()
|
| 18 |
-
|
| 19 |
-
print("Initializing ComfyUI documentation...")
|
| 20 |
-
initialize_comfyui_docs()
|
| 21 |
-
|
| 22 |
-
print("Initializing FastRTC documentation...")
|
| 23 |
-
initialize_fastrtc_docs()
|
| 24 |
-
|
| 25 |
-
# Launch the application
|
| 26 |
-
print("Launching AnyCoder application...")
|
| 27 |
-
demo.queue(api_open=False, default_concurrency_limit=20).launch(
|
| 28 |
-
show_api=False,
|
| 29 |
-
ssr_mode=True,
|
| 30 |
-
mcp_server=False
|
| 31 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
backend_search_replace.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
"""
|
| 2 |
Search/Replace utilities for applying targeted code changes.
|
| 3 |
-
|
| 4 |
"""
|
| 5 |
|
| 6 |
# Search/Replace block markers
|
|
|
|
| 1 |
"""
|
| 2 |
Search/Replace utilities for applying targeted code changes.
|
| 3 |
+
Search/Replace utilities for applying targeted code changes.
|
| 4 |
"""
|
| 5 |
|
| 6 |
# Search/Replace block markers
|