Spaces:
Sleeping
Sleeping
Commit Β·
ac3ec82
1
Parent(s): df861a1
docs: update README with HuggingFace Spaces deployment
Browse files
README.md
CHANGED
|
@@ -7,4 +7,110 @@ sdk: docker
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# ScrapeRL π
|
| 11 |
+
|
| 12 |
+
A reinforcement learning-powered web scraping tool with a FastAPI backend and React frontend.
|
| 13 |
+
|
| 14 |
+
## Features
|
| 15 |
+
|
| 16 |
+
- π€ **RL-Powered Scraping** - Intelligent web scraping using reinforcement learning
|
| 17 |
+
- π **Multi-LLM Support** - Works with OpenAI, Anthropic, Google, and Groq
|
| 18 |
+
- β‘ **FastAPI Backend** - High-performance async API
|
| 19 |
+
- π¨ **React Frontend** - Modern, responsive UI
|
| 20 |
+
- π³ **Docker Ready** - Easy deployment with Docker
|
| 21 |
+
- π€ **HuggingFace Spaces** - One-click deployment
|
| 22 |
+
|
| 23 |
+
## Quick Start
|
| 24 |
+
|
| 25 |
+
### Docker (Recommended)
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
# Clone the repository
|
| 29 |
+
git clone https://github.com/yourusername/scrapeRL.git
|
| 30 |
+
cd scrapeRL
|
| 31 |
+
|
| 32 |
+
# Copy environment file
|
| 33 |
+
cp .env.example .env
|
| 34 |
+
|
| 35 |
+
# Build and run
|
| 36 |
+
docker-compose up --build
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
Access the app at http://localhost:7860
|
| 40 |
+
|
| 41 |
+
### Local Development
|
| 42 |
+
|
| 43 |
+
**Backend:**
|
| 44 |
+
```bash
|
| 45 |
+
cd backend
|
| 46 |
+
pip install -r requirements.txt
|
| 47 |
+
uvicorn app.main:app --reload --port 7860
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
**Frontend:**
|
| 51 |
+
```bash
|
| 52 |
+
cd frontend
|
| 53 |
+
npm install
|
| 54 |
+
npm run dev
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## API Endpoints
|
| 58 |
+
|
| 59 |
+
| Method | Endpoint | Description |
|
| 60 |
+
|--------|----------|-------------|
|
| 61 |
+
| GET | `/health` | Health check |
|
| 62 |
+
| GET | `/api/v1/...` | API routes |
|
| 63 |
+
| GET | `/` | Serve frontend |
|
| 64 |
+
|
| 65 |
+
## Architecture
|
| 66 |
+
|
| 67 |
+
```
|
| 68 |
+
scrapeRL/
|
| 69 |
+
βββ backend/
|
| 70 |
+
β βββ app/
|
| 71 |
+
β β βββ main.py # FastAPI app entry
|
| 72 |
+
β β βββ api/ # API routes
|
| 73 |
+
β β βββ core/ # Core logic
|
| 74 |
+
β β βββ services/ # Business logic
|
| 75 |
+
β βββ requirements.txt
|
| 76 |
+
βββ frontend/
|
| 77 |
+
β βββ src/
|
| 78 |
+
β βββ package.json
|
| 79 |
+
βββ Dockerfile # Multi-stage build
|
| 80 |
+
βββ docker-compose.yml # Local development
|
| 81 |
+
βββ .env.example
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
## Configuration
|
| 85 |
+
|
| 86 |
+
Set these environment variables (see `.env.example`):
|
| 87 |
+
|
| 88 |
+
| Variable | Description | Required |
|
| 89 |
+
|----------|-------------|----------|
|
| 90 |
+
| `OPENAI_API_KEY` | OpenAI API key | No |
|
| 91 |
+
| `ANTHROPIC_API_KEY` | Anthropic API key | No |
|
| 92 |
+
| `GOOGLE_API_KEY` | Google AI API key | No |
|
| 93 |
+
| `GROQ_API_KEY` | Groq API key | No |
|
| 94 |
+
| `HF_TOKEN` | HuggingFace token | No |
|
| 95 |
+
| `DEBUG` | Enable debug mode | No |
|
| 96 |
+
| `LOG_LEVEL` | Logging level | No |
|
| 97 |
+
|
| 98 |
+
## Deployment
|
| 99 |
+
|
| 100 |
+
### HuggingFace Spaces
|
| 101 |
+
|
| 102 |
+
This app is configured for HuggingFace Spaces with Docker SDK:
|
| 103 |
+
- Port: 7860
|
| 104 |
+
- Health check: `/health`
|
| 105 |
+
- Auto-builds on push
|
| 106 |
+
|
| 107 |
+
### Manual Docker
|
| 108 |
+
|
| 109 |
+
```bash
|
| 110 |
+
docker build -t scraperl .
|
| 111 |
+
docker run -p 7860:7860 --env-file .env scraperl
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
## License
|
| 115 |
+
|
| 116 |
+
MIT License - see [LICENSE](LICENSE) for details.
|