NeerajCodz commited on
Commit
ac3ec82
Β·
1 Parent(s): df861a1

docs: update README with HuggingFace Spaces deployment

Browse files
Files changed (1) hide show
  1. README.md +107 -1
README.md CHANGED
@@ -7,4 +7,110 @@ sdk: docker
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.