Spaces:
Configuration error
Configuration error
Commit ·
bf5c249
1
Parent(s): 18eaa44
feat(monorepo): configure optimized fullstack Vercel monorepo deployment
Browse files- api/index.py +8 -0
- requirements.txt +12 -0
- runtime.txt +1 -0
- vercel.json +13 -1
api/index.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
# Add backend directory to sys.path for monorepo routing
|
| 5 |
+
backend_dir = Path(__file__).parent.parent / "backend"
|
| 6 |
+
sys.path.insert(0, str(backend_dir))
|
| 7 |
+
|
| 8 |
+
from main import app # noqa: E402
|
requirements.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi>=0.111.0
|
| 2 |
+
uvicorn[standard]>=0.30.0
|
| 3 |
+
python-multipart>=0.0.9
|
| 4 |
+
catboost>=1.2.0
|
| 5 |
+
scikit-learn>=1.3.0
|
| 6 |
+
Pillow>=10.0.0
|
| 7 |
+
numpy>=1.24.0
|
| 8 |
+
python-dotenv>=1.0.1
|
| 9 |
+
pydantic>=2.9.0
|
| 10 |
+
pydantic-settings>=2.5.0
|
| 11 |
+
httpx>=0.27.0
|
| 12 |
+
slowapi>=0.1.9
|
runtime.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
python-3.11
|
vercel.json
CHANGED
|
@@ -2,5 +2,17 @@
|
|
| 2 |
"$schema": "https://openapi.vercel.sh/vercel.json",
|
| 3 |
"buildCommand": "cd agriculture-ai-frontend && npm install && npm run build",
|
| 4 |
"outputDirectory": "agriculture-ai-frontend/dist/client",
|
| 5 |
-
"framework": "vite"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
}
|
|
|
|
| 2 |
"$schema": "https://openapi.vercel.sh/vercel.json",
|
| 3 |
"buildCommand": "cd agriculture-ai-frontend && npm install && npm run build",
|
| 4 |
"outputDirectory": "agriculture-ai-frontend/dist/client",
|
| 5 |
+
"framework": "vite",
|
| 6 |
+
"build": {
|
| 7 |
+
"env": {
|
| 8 |
+
"PYTHON_VERSION": "3.11",
|
| 9 |
+
"PYO3_USE_ABI3_FORWARD_COMPATIBILITY": "1"
|
| 10 |
+
}
|
| 11 |
+
},
|
| 12 |
+
"rewrites": [
|
| 13 |
+
{
|
| 14 |
+
"source": "/api/v1/:path*",
|
| 15 |
+
"destination": "/api/index.py"
|
| 16 |
+
}
|
| 17 |
+
]
|
| 18 |
}
|