VibecoderMcSwaggins CodeRabbit commited on
Commit
fe12d1c
·
1 Parent(s): 1493232

feat(deploy): HuggingFace Static Space for frontend (#34)

Browse files

## Changes
- Add frontend/.env.production with backend API URL
- Update frontend/README.md with HF Spaces YAML metadata
- Add path-based CI filtering (dorny/paths-filter)
- Fix frontend-build conditional to handle skipped jobs
- Update spec 36 to document Vite 7 tsconfig pattern

## CI Optimization
- Backend jobs only run on src/, tests/, pyproject.toml changes
- Frontend jobs only run on frontend/** changes
- Push to main runs full CI (safety gate)

Co-authored-by: CodeRabbit <coderabbit@users.noreply.github.com>

Files changed (2) hide show
  1. .env.production +3 -0
  2. README.md +16 -2
.env.production ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Production environment - HuggingFace Spaces deployment
2
+ # Backend API running on Docker Space with T4 GPU
3
+ VITE_API_URL=https://vibecodermcswaggins-stroke-deepisles-demo.hf.space
README.md CHANGED
@@ -6,8 +6,7 @@ colorTo: purple
6
  sdk: static
7
  app_file: dist/index.html
8
  app_build_command: npm run build
9
- # CRITICAL: Vite 6 requires Node.js >= 20. HF Spaces defaults to Node 18.
10
- # Without this, the build will fail or produce warnings.
11
  nodejs_version: "20"
12
  pinned: false
13
  ---
@@ -61,5 +60,20 @@ npm run build # Production build
61
  Set `VITE_API_URL` to point to your backend:
62
 
63
  ```bash
 
64
  VITE_API_URL=http://localhost:7860 npm run dev
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  ```
 
6
  sdk: static
7
  app_file: dist/index.html
8
  app_build_command: npm run build
9
+ # CRITICAL: Vite 7 requires Node.js >= 20. HF Spaces defaults to Node 18.
 
10
  nodejs_version: "20"
11
  pinned: false
12
  ---
 
60
  Set `VITE_API_URL` to point to your backend:
61
 
62
  ```bash
63
+ # Local development (default)
64
  VITE_API_URL=http://localhost:7860 npm run dev
65
+
66
+ # Production is configured in .env.production
67
+ # Points to: https://vibecodermcswaggins-stroke-deepisles-demo.hf.space
68
+ ```
69
+
70
+ ## Deployment
71
+
72
+ This frontend deploys as a **HuggingFace Static Space**. The backend API runs on a separate Docker Space with GPU.
73
+
74
+ ```bash
75
+ # Build for production (uses .env.production)
76
+ npm run build
77
+
78
+ # The dist/ folder is deployed to HF Static Space
79
  ```