djsnova/event-horizon-api
0
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Runtime Contract
This API expects MongoDB and admin credentials from environment variables.
Required variables:
MONGO_URI: Hosted MongoDB URI (MongoDB Atlas recommended).MONGO_DB_NAME: Database name (defaultevent_horizon).ADMIN_SECRET_TOKEN: Strong random secret for admin routes.CORS_ORIGINS: JSON array or comma-separated origins.
Recommended for this project:
HOST=0.0.0.0PORT=7860
Example:
MONGO_URI=mongodb+srv://<user>:<password>@<cluster>.mongodb.net/?retryWrites=true&w=majority
MONGO_DB_NAME=event_horizon
ADMIN_SECRET_TOKEN=replace_with_32_plus_chars
CORS_ORIGINS=["https://your-frontend.vercel.app","http://localhost:5173"]
HOST=0.0.0.0
PORT=7860
SEED_TEST_ACCOUNTS=falseDeploy To Hugging Face Spaces
- Create a Docker Space and push this folder.
- In Space Settings, add all required variables above.
- Ensure Mongo network access allows Hugging Face egress.
- Redeploy.
Smoke Checks
After deployment, verify:
GET /returns{"app":"Event Horizon 3.0","status":"running"}.GET /api/docsloads Swagger.POST /api/v1/auth/loginworks for a registered user.- Frontend origin can call API without CORS errors.
