Spaces:
Running
Running
delete README.md
#80
by
khairul91
- opened
README.md
DELETED
|
@@ -1,143 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: AnyCoder
|
| 3 |
-
emoji: 🚀
|
| 4 |
-
colorFrom: blue
|
| 5 |
-
colorTo: purple
|
| 6 |
-
sdk: docker
|
| 7 |
-
app_port: 7860
|
| 8 |
-
pinned: false
|
| 9 |
-
disable_embedding: false
|
| 10 |
-
hf_oauth: true
|
| 11 |
-
hf_oauth_scopes:
|
| 12 |
-
- manage-repos
|
| 13 |
-
---
|
| 14 |
-
|
| 15 |
-
> **Note:** This is the Docker Space configuration for the React frontend version.
|
| 16 |
-
> For the original Gradio app, see `README_GRADIO.md`.
|
| 17 |
-
|
| 18 |
-
# AnyCoder - AI Code Generator with React Frontend
|
| 19 |
-
|
| 20 |
-
AnyCoder is a full-stack AI-powered code generator with a modern React/TypeScript frontend and FastAPI backend. Generate applications by describing them in plain English, with support for multiple AI models and one-click deployment to Hugging Face Spaces.
|
| 21 |
-
|
| 22 |
-
## 🎨 Features
|
| 23 |
-
|
| 24 |
-
- **Modern React UI**: Apple-inspired design with VS Code layout
|
| 25 |
-
- **Real-time Streaming**: Server-Sent Events for live code generation
|
| 26 |
-
- **Multi-Model Support**: MiniMax M2, DeepSeek V3, and more via HuggingFace InferenceClient
|
| 27 |
-
- **Multiple Languages**: HTML, Gradio, Streamlit, React, Transformers.js, ComfyUI
|
| 28 |
-
- **Authentication**: HuggingFace OAuth + Dev mode for local testing
|
| 29 |
-
- **One-Click Deployment**: Deploy generated apps directly to HF Spaces
|
| 30 |
-
|
| 31 |
-
## 🏗️ Architecture
|
| 32 |
-
|
| 33 |
-
```
|
| 34 |
-
anycoder/
|
| 35 |
-
├── backend_api.py # FastAPI backend with streaming
|
| 36 |
-
├── frontend/ # Next.js React frontend
|
| 37 |
-
│ ├── src/
|
| 38 |
-
│ │ ├── app/ # Pages (page.tsx, layout.tsx, globals.css)
|
| 39 |
-
│ │ ├── components/ # React components
|
| 40 |
-
│ │ ├── lib/ # API client, auth utilities
|
| 41 |
-
│ │ └── types/ # TypeScript types
|
| 42 |
-
│ └── package.json
|
| 43 |
-
├── anycoder_app/ # Original Gradio app modules
|
| 44 |
-
│ ├── agent.py
|
| 45 |
-
│ ├── config.py
|
| 46 |
-
│ ├── deploy.py
|
| 47 |
-
│ └── ...
|
| 48 |
-
├── app.py # Original Gradio interface
|
| 49 |
-
├── requirements.txt # Python dependencies
|
| 50 |
-
├── Dockerfile # Docker Space configuration
|
| 51 |
-
└── start_fullstack.sh # Local development script
|
| 52 |
-
```
|
| 53 |
-
|
| 54 |
-
## 🚀 Quick Start
|
| 55 |
-
|
| 56 |
-
### Local Development
|
| 57 |
-
|
| 58 |
-
1. **Backend**:
|
| 59 |
-
```bash
|
| 60 |
-
export HF_TOKEN="your_huggingface_token"
|
| 61 |
-
export GEMINI_API_KEY="your_gemini_api_key"
|
| 62 |
-
python backend_api.py
|
| 63 |
-
```
|
| 64 |
-
|
| 65 |
-
2. **Frontend** (new terminal):
|
| 66 |
-
```bash
|
| 67 |
-
cd frontend
|
| 68 |
-
npm install
|
| 69 |
-
npm run dev
|
| 70 |
-
```
|
| 71 |
-
|
| 72 |
-
3. Open `http://localhost:3000`
|
| 73 |
-
|
| 74 |
-
### Using start script:
|
| 75 |
-
```bash
|
| 76 |
-
export HF_TOKEN="your_token"
|
| 77 |
-
export GEMINI_API_KEY="your_gemini_api_key"
|
| 78 |
-
./start_fullstack.sh
|
| 79 |
-
```
|
| 80 |
-
|
| 81 |
-
## 🐳 Docker Space Deployment
|
| 82 |
-
|
| 83 |
-
This app runs as a Docker Space on HuggingFace. The Dockerfile:
|
| 84 |
-
- Builds the Next.js frontend
|
| 85 |
-
- Runs FastAPI backend on port 7860
|
| 86 |
-
- Uses proper user permissions (UID 1000)
|
| 87 |
-
- Handles environment variables securely
|
| 88 |
-
|
| 89 |
-
## 🔑 Authentication
|
| 90 |
-
|
| 91 |
-
- **Dev Mode** (localhost): Mock login for testing
|
| 92 |
-
- **Production**: HuggingFace OAuth with manage-repos scope
|
| 93 |
-
|
| 94 |
-
## 📝 Supported Languages
|
| 95 |
-
|
| 96 |
-
- `html` - Static HTML pages
|
| 97 |
-
- `gradio` - Python Gradio apps
|
| 98 |
-
- `streamlit` - Python Streamlit apps
|
| 99 |
-
- `react` - React/Next.js apps
|
| 100 |
-
- `transformers.js` - Browser ML apps
|
| 101 |
-
- `comfyui` - ComfyUI workflows
|
| 102 |
-
|
| 103 |
-
## 🤖 Available Models
|
| 104 |
-
|
| 105 |
-
- **Gemini 3 Pro Preview** (Default) - Google's latest with deep thinking & Google Search
|
| 106 |
-
- MiniMax M2 (via HF router with Novita)
|
| 107 |
-
- DeepSeek V3/V3.1
|
| 108 |
-
- DeepSeek R1
|
| 109 |
-
- And more via HuggingFace InferenceClient
|
| 110 |
-
|
| 111 |
-
## 🎯 Usage
|
| 112 |
-
|
| 113 |
-
1. Sign in with HuggingFace (or use Dev Login locally)
|
| 114 |
-
2. Select a language and AI model
|
| 115 |
-
3. Describe your app in the chat
|
| 116 |
-
4. Watch code generate in real-time
|
| 117 |
-
5. Click **🚀 Deploy** to publish to HF Spaces
|
| 118 |
-
|
| 119 |
-
## 🛠️ Environment Variables
|
| 120 |
-
|
| 121 |
-
- `HF_TOKEN` - HuggingFace API token (required)
|
| 122 |
-
- `GEMINI_API_KEY` - Google Gemini API key (required for Gemini 3 Pro Preview)
|
| 123 |
-
- `POE_API_KEY` - Poe API key (optional, for GPT-5 and Claude models)
|
| 124 |
-
- `DASHSCOPE_API_KEY` - DashScope API key (optional, for Qwen models)
|
| 125 |
-
- `OPENROUTER_API_KEY` - OpenRouter API key (optional, for Sherlock models)
|
| 126 |
-
- `MISTRAL_API_KEY` - Mistral API key (optional, for Mistral models)
|
| 127 |
-
|
| 128 |
-
## 📦 Tech Stack
|
| 129 |
-
|
| 130 |
-
**Frontend:**
|
| 131 |
-
- Next.js 14
|
| 132 |
-
- TypeScript
|
| 133 |
-
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