Status: ✅ LIVE — System is deployed and operational.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ Database │
│ (Vercel) │────▶│ (Render) │────▶│ (InfluxDB Cloud)│
│ React + Vite │ │ FastAPI │ │ Time-Series │
└─────────────────┘ └─────────────────┘ └─────────────────┘
| Component | Technology | Hosting |
|---|---|---|
| Frontend | React 18 + Vite | Vercel |
| Backend | FastAPI + Uvicorn + Docker | Render |
| Database | InfluxDB 2.x | InfluxDB Cloud (AWS us-east-1) |
| Service | URL | Status |
|---|---|---|
| Frontend | https://predictive-maintenance-ten.vercel.app/ | ✅ Live |
| Backend API | https://predictive-maintenance-uhlb.onrender.com | ✅ Live |
| API Docs | https://predictive-maintenance-uhlb.onrender.com/docs | ✅ Live |
| Health Check | https://predictive-maintenance-uhlb.onrender.com/health | ✅ Live |
Already deployed at https://predictive-maintenance-uhlb.onrender.com
Environment Variables (configured in Render Dashboard):
ENVIRONMENT=production
PORT=8000
INFLUX_URL=https://us-east-1-1.aws.cloud2.influxdata.com
INFLUX_TOKEN=<your-token>
INFLUX_ORG=<your-org-id>
INFLUX_BUCKET=sensor_data
-
Connect Repository:
- Go to vercel.com
- Import the GitHub repository
- Set Root Directory to
frontend
-
Build Settings:
- Framework: Vite
- Build Command:
npm run build - Output Directory:
dist
-
Deploy:
- Click "Deploy"
- Vercel will auto-configure rewrites from
vercel.json
# Start all services
docker-compose up --build
# Access
# Frontend: http://localhost:5173
# Backend: http://localhost:8000
# API Docs: http://localhost:8000/docsBackend:
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn backend.api.main:app --reloadFrontend:
cd frontend
npm install
npm run dev| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/system/calibrate |
POST | Start calibration (builds baseline + legacy + batch ML models) |
/system/inject-fault |
POST | Inject fault (type: spike/drift/jitter, severity: mild/medium/severe) |
/system/reset |
POST | Reset to idle |
/system/purge |
POST | Wipe all data + reset DI to 0.0 |
/system/status/{asset_id} |
GET | Get system state (calibrating/monitoring/fault) |
/api/v1/status/{asset_id} |
GET | Get asset status (health, DI, RUL) |
/api/v1/data/history/{asset_id} |
GET | Get sensor history + events + health scoring |
/api/v1/report/{asset_id} |
GET | Generate PDF/Excel report (format: pdf/xlsx/industrial) |
/sandbox/predict |
POST | What-If analysis |
/ping |
GET | Keep-alive heartbeat (prevents Render cold starts) |
| Variable | Required | Description | Example |
|---|---|---|---|
ENVIRONMENT |
Yes | Runtime mode | production |
PORT |
Yes | Server port | 8000 |
INFLUX_URL |
Yes | InfluxDB Cloud URL | https://us-east-1-1.aws.cloud2.influxdata.com |
INFLUX_TOKEN |
Yes | InfluxDB API token | kg2i8Mq... |
INFLUX_ORG |
Yes | InfluxDB Organization ID | 67c4314d97304c09 |
INFLUX_BUCKET |
Yes | InfluxDB bucket name | sensor_data |
| Variable | Required | Description | Example |
|---|---|---|---|
VITE_API_URL |
No | Backend URL (handled via rewrites) | https://predictive-maintenance-uhlb.onrender.com |
The frontend/vercel.json file handles API proxying:
{
"rewrites": [
{
"source": "/api/:path*",
"destination": "https://predictive-maintenance-uhlb.onrender.com/api/:path*"
},
{
"source": "/system/:path*",
"destination": "https://predictive-maintenance-uhlb.onrender.com/system/:path*"
},
{
"source": "/health",
"destination": "https://predictive-maintenance-uhlb.onrender.com/health"
},
{
"source": "/ping",
"destination": "https://predictive-maintenance-uhlb.onrender.com/ping"
}
]
}This allows the frontend to call /api/... and have Vercel proxy to Render automatically.
- InfluxDB Dashboard: https://cloud2.influxdata.com
- Render Logs: Render Dashboard → Service → Logs
- Vercel Logs: Vercel Dashboard → Project → Functions
Problem: Committing node_modules/ from Windows uploads Windows-specific binaries (.cmd, .exe). When Vercel (Linux) tries to execute these, you get:
Error: Command "npm run build" exited with 126
Solution:
- Ensure
node_modules/is in.gitignore - If already committed, remove with:
git rm -r --cached frontend/node_modules git commit -m "fix: remove node_modules from tracking" git push - Redeploy on Vercel
Free-tier Render services spin down after 15 minutes of inactivity. First request after idle may take 30-60 seconds.
The frontend sends a 10-minute keep-alive ping to /ping automatically to prevent this during active browser sessions.
The Cumulative Degradation Index is persisted to InfluxDB. On backend restart, DI is hydrated from InfluxDB via |> last(). The POST /system/purge endpoint writes DI=0.0 (InfluxDB Cloud Serverless v3 does not support range deletes).
Ensure your InfluxDB token has read/write access to the sensor_data bucket.
curl https://predictive-maintenance-uhlb.onrender.com/healthExpected: {"status":"healthy","database":"connected",...}
- Check browser DevTools → Network tab
- Verify Vercel rewrites are working (requests to
/api/*should proxy to Render)
- Verify credentials in Render environment variables
- Check InfluxDB Cloud dashboard for bucket access