CoolFace
Apppublic

djsnova/event-horizon-api

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

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 (default event_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.0
  • —PORT=7860

Example:

env
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=false

Deploy To Hugging Face Spaces

  1. 1.Create a Docker Space and push this folder.
  2. 2.In Space Settings, add all required variables above.
  3. 3.Ensure Mongo network access allows Hugging Face egress.
  4. 4.Redeploy.

Smoke Checks

After deployment, verify:

  1. 1.GET / returns {"app":"Event Horizon 3.0","status":"running"}.
  2. 2.GET /api/docs loads Swagger.
  3. 3.POST /api/v1/auth/login works for a registered user.
  4. 4.Frontend origin can call API without CORS errors.