Render is the sole supported hosted CommodityChain API. Production frontend remains on Vercel; frontend previews may also run on Netlify. Local development is not a hosted deployment.
Use the existing service at https://commoditychain-1xwi.onrender.com. Do not create a duplicate service or paid infrastructure.
| Setting | Value |
|---|---|
| Repository | ayushcmd/commoditychain |
| Branch | main |
| Runtime | Python |
| Region | Singapore |
| Plan | Free |
| Root Directory | backend |
| Build | pip install -r requirements.txt |
| Start | uvicorn main:app --host 0.0.0.0 --port $PORT --workers 1 --timeout-graceful-shutdown 10 |
| Health check | /api/health |
| Auto-Deploy | Off (manual deployment) |
| PYTHON_VERSION | 3.11.9 |
| ALLOWED_ORIGINS | https://commoditychain.vercel.app |
The root render.yaml is the declarative reference. Confirm actual settings in the Render dashboard; changing a tracked Blueprint file does not prove the hosted settings changed. Add optional GROQ_API_KEY, NEWS_API_KEY and EIA_API_KEY privately in Render Environment, not in Git or public frontend variables. EIA is a separate optional spot-price source; its timeout remains deferred.
From the repository root, run the unit tests and frontend build described in README. When a backend change is merged, manually deploy the latest verified main commit using the existing Render service. For frontend-only and documentation changes, a backend deployment is generally unnecessary. Verify Vercel deployed main.
BASE=https://commoditychain-1xwi.onrender.com
curl -i --max-time 120 "$BASE/api/health"
curl -i --max-time 30 "$BASE/api/ready"
curl -fsS --max-time 30 "$BASE/api/prices"
curl -i --max-time 30 -H "Origin: https://commoditychain.vercel.app" "$BASE/api/health"Liveness checks process availability only. Readiness is cache-only and can be degraded or unavailable during upstream outages. Inspect actual quote counts, timestamps, units, source and stale/unavailable status; no fabricated market prices. For full endpoint checks, run the manual Render production smoke test, inspect its artifact and verify the browser independently.
Production builds use the fixed HTTPS origin above and wss://commoditychain-1xwi.onrender.com for sockets; the former backend URL environment overrides no longer affect builds. Keep ALLOWED_ORIGINS on Render restricted to the exact production frontend origin, with any temporary preview origin added explicitly when necessary and removed afterward. CORS is not authentication. Preview builds use production Render, so test responsibly and avoid load testing or consuming provider quotas.
Local development uses http://localhost:8000 and ws://localhost:8000. Set local ALLOWED_ORIGINS=http://localhost:3000. Do not place hosted provider keys in the frontend.
If a release fails, restore the previously verified Render deployment and matching Vercel frontend release. Keep their commit identifiers and re-run the smoke test and browser checks. Never switch to an unverified backend. Do not use automatic keepalive requests.
Render Free may sleep, cold starts can exceed client request deadlines, provider quotas apply, and the instance filesystem/cache is ephemeral. One worker avoids duplicated process caches. No uptime guarantee. Refer to https://render.com/docs/free and https://render.com/docs/health-checks for current plan behavior.
See Render connectivity, Render-only cleanup and launch readiness. Existing file name is retained so historical links remain valid; this is an operational runbook, not an unfinished migration plan.