dev-rexpro commited on
Commit
0fc2868
·
verified ·
1 Parent(s): 40f581b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -113
README.md CHANGED
@@ -1,114 +1,8 @@
1
- # RexPro AI
2
-
3
- RexPro AI is a production-ready chatbot application built with a high-performance FastAPI backend and a minimalist, responsive Svelte/Vite frontend. The project is designed with efficiency in mind, optimizing for low-resource environments (such as Hugging Face Spaces or lightweight VPS nodes) by preventing common Out-of-Memory (OOM) errors.
4
-
5
  ---
6
-
7
- ## Project Structure
8
-
9
- ```
10
- rexpro-ai/
11
- ├── Dockerfile # Root multi-stage build file
12
- ├── .dockerignore # Excludes development artifacts from Docker context
13
- ├── .gitignore # Root git ignore patterns
14
- ├── backend/ # FastAPI backend source code
15
- │ ├── rexpro_ai/ # Python application source
16
- │ ├── requirements.txt # Python dependencies
17
- │ └── start.sh # Production container entrypoint script
18
- └── frontend/ # Svelte/Vite frontend source code
19
- ├── src/ # Svelte components & logic
20
- └── package.json # Frontend dependencies
21
- ```
22
-
23
- ---
24
-
25
- ## Environment Variables
26
-
27
- ### Backend Configuration
28
-
29
- The backend is configured via environment variables. In local development, these can be set in a `.env` file inside the `backend` or root folder.
30
-
31
- | Variable | Description | Default |
32
- |---|---|---|
33
- | `PORT` | Container or server port | `7860` |
34
- | `HOST` | Bind address for uvicorn | `0.0.0.0` |
35
- | `CORS_ALLOW_ORIGIN` | Allowed origin for CORS (separate with commas) | `http://localhost:5173` |
36
- | `REXPRO_SECRET_KEY` | Secret key used for cryptographic signing | *Auto-generated if empty* |
37
- | `USE_SLIM` | When true, skips heavy local ML model cache downloads | `true` |
38
- | `UVICORN_WORKERS` | Number of Uvicorn worker processes | `1` |
39
- | `OMP_NUM_THREADS` | Limits thread count for OpenMP to prevent OOM | `1` |
40
-
41
- ### Frontend Configuration
42
-
43
- The frontend utilizes Vite environment variables, which must be prefixed with `VITE_`.
44
-
45
- | Variable | Description | Purpose |
46
- |---|---|---|
47
- | `VITE_API_URL` | Endpoint base URL for the backend API | Set to empty (`""`) in production to use relative URLs (same host), or to the backend URL in dual-origin development. |
48
-
49
- ---
50
-
51
- ## Getting Started
52
-
53
- ### Local Development
54
-
55
- To run the application locally in development mode:
56
-
57
- 1. **Start the Backend**:
58
- ```bash
59
- cd backend
60
- # Set up a python virtual environment
61
- python -m venv venv
62
- source venv/bin/activate # On Windows: .\venv\Scripts\activate
63
-
64
- # Install dependencies
65
- pip install --upgrade pip
66
- pip install -r requirements.txt
67
-
68
- # Run development server
69
- uvicorn rexpro_ai.main:app --host 127.0.0.1 --port 8080 --reload
70
- ```
71
-
72
- 2. **Start the Frontend**:
73
- ```bash
74
- cd frontend
75
- # Install node dependencies
76
- npm install
77
-
78
- # Run Vite development server
79
- npm run dev
80
- ```
81
- Open `http://localhost:5173` in your browser.
82
-
83
- ---
84
-
85
- ## Production Deployment with Docker
86
-
87
- To avoid CPU-starvation and memory-exhaustion (OOM) hangs when compiling the Svelte/Vite frontend in resource-restricted cloud environments, the project uses a pre-built static deployment strategy. The frontend is compiled locally, committed to Git, and copied directly into the Docker image.
88
-
89
- ### Building and Deploying
90
-
91
- 1. **Build the Frontend Locally**:
92
- Ensure you are in the `frontend/` directory and run:
93
- ```bash
94
- cd frontend
95
- VITE_API_URL="" npm run build
96
- ```
97
- This compiles the static assets into `frontend/build/`. Commit this folder to Git before pushing.
98
-
99
- 2. **Build the Docker Image**:
100
- From the root directory:
101
- ```bash
102
- docker build -t rexpro-ai:latest .
103
- ```
104
- This will create a lightweight Python container and copy the pre-built `frontend/build/` directly, finishing the build in seconds.
105
-
106
- 3. **Run the Container**:
107
- ```bash
108
- docker run -d -p 7860:7860 \
109
- -e REXPRO_SECRET_KEY="your_secure_random_key" \
110
- -e CORS_ALLOW_ORIGIN="http://localhost:7860" \
111
- rexpro-ai:latest
112
- ```
113
- The application will be accessible at `http://localhost:7860`.
114
-
 
 
 
 
 
1
  ---
2
+ title: Rexpro AI
3
+ emoji: 🚀
4
+ colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: docker
7
+ pinned: false
8
+ ---