Spaces:
Running
Running
delete README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143---title: AnyCoderemoji: πcolorFrom: bluecolorTo: purplesdk: dockerapp_port: 7860pinned: falsedisable_embedding: falsehf_oauth: truehf_oauth_scopes: - manage-repos---
> **Note:** This is the Docker Space configuration for the React frontend version. > For the original Gradio app, see `README_GRADIO.md`.
# AnyCoder - AI Code Generator with React Frontend
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.
## π¨ Features
- **Modern React UI**: Apple-inspired design with VS Code layout- **Real-time Streaming**: Server-Sent Events for live code generation- **Multi-Model Support**: MiniMax M2, DeepSeek V3, and more via HuggingFace InferenceClient- **Multiple Languages**: HTML, Gradio, Streamlit, React, Transformers.js, ComfyUI- **Authentication**: HuggingFace OAuth + Dev mode for local testing- **One-Click Deployment**: Deploy generated apps directly to HF Spaces
## ποΈ Architecture
```anycoder/βββ backend_api.py # FastAPI backend with streamingβββ frontend/ # Next.js React frontendβ βββ src/β β βββ app/ # Pages (page.tsx, layout.tsx, globals.css)β β βββ components/ # React componentsβ β βββ lib/ # API client, auth utilitiesβ β βββ types/ # TypeScript typesβ βββ package.jsonβββ anycoder_app/ # Original Gradio app modulesβ βββ agent.pyβ βββ config.pyβ βββ deploy.pyβ βββ ...βββ app.py # Original Gradio interfaceβββ requirements.txt # Python dependenciesβββ Dockerfile # Docker Space configurationβββ start_fullstack.sh # Local development script```
## π Quick Start
### Local Development
1. **Backend**:```bashexport HF_TOKEN="your_huggingface_token"export GEMINI_API_KEY="your_gemini_api_key"python backend_api.py```
2. **Frontend** (new terminal):```bashcd frontendnpm installnpm run dev```
3. Open `http://localhost:3000`
### Using start script:```bashexport HF_TOKEN="your_token"export GEMINI_API_KEY="your_gemini_api_key"./start_fullstack.sh```
## π³ Docker Space Deployment
This app runs as a Docker Space on HuggingFace. The Dockerfile:- Builds the Next.js frontend- Runs FastAPI backend on port 7860- Uses proper user permissions (UID 1000)- Handles environment variables securely
## π Authentication
- **Dev Mode** (localhost): Mock login for testing- **Production**: HuggingFace OAuth with manage-repos scope
## π Supported Languages
- `html` - Static HTML pages- `gradio` - Python Gradio apps- `streamlit` - Python Streamlit apps- `react` - React/Next.js apps- `transformers.js` - Browser ML apps- `comfyui` - ComfyUI workflows
## π€ Available Models
- **Gemini 3 Pro Preview** (Default) - Google's latest with deep thinking & Google Search- MiniMax M2 (via HF router with Novita)- DeepSeek V3/V3.1- DeepSeek R1- And more via HuggingFace InferenceClient
## π― Usage
1. Sign in with HuggingFace (or use Dev Login locally)2. Select a language and AI model3. Describe your app in the chat4. Watch code generate in real-time5. Click **π Deploy** to publish to HF Spaces
## π οΈ Environment Variables
- `HF_TOKEN` - HuggingFace API token (required)- `GEMINI_API_KEY` - Google Gemini API key (required for Gemini 3 Pro Preview)- `POE_API_KEY` - Poe API key (optional, for GPT-5 and Claude models)- `DASHSCOPE_API_KEY` - DashScope API key (optional, for Qwen models)- `OPENROUTER_API_KEY` - OpenRouter API key (optional, for Sherlock models)- `MISTRAL_API_KEY` - Mistral API key (optional, for Mistral models)
## π¦ Tech Stack
**Frontend:**- Next.js 14- TypeScript- Tailwind CSS- Monaco Editor
**Backend:**- FastAPI- HuggingFace Hub- Server-Sent Events (SSE)
## π License
MITREADME.mdDeleted-143