Spaces:
Running
Running
| title: YapStation Backend | |
| emoji: π | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| # β‘ YapStation backend | |
| FastAPI backend for YapStation: REST endpoints + WebSockets, backed by Supabase (Postgres + Storage). | |
| ## βΆοΈ Run (recommended) | |
| From the repo root on Windows: | |
| - `run-backend.bat` (starts FastAPI on `http://localhost:7860/docs`) | |
| Or run directly: | |
| ```bash | |
| cd backend | |
| pip install -r requirements.txt | |
| python -m uvicorn server:app --host 0.0.0.0 --port 7860 --reload | |
| ``` | |
| ## π Environment variables | |
| The backend loads environment variables from the **repo root** `.env` (see `server.py`). | |
| **Required** | |
| - `SUPABASE_URL` | |
| - `SUPABASE_KEY` (anon/publishable key) | |
| **Optional** | |
| - `SUPABASE_SERVICE_KEY` (privileged server operations; keep secret) | |
| - `JWT_SECRET` (session cookie signing) | |
| - `FRONTEND_URL` (CORS + password reset link base) | |
| **π§ Email (password reset)** | |
| - `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASSWORD`, `MAIL_FROM` | |
| **π€ BitAI (optional)** | |
| - `GROQ_API_KEY` | |
| ## π§ Notes | |
| - **Port**: this project uses **7860** (not 8000). | |
| - **Auth cookie**: local dev runs on HTTP so cookies default to non-secure. In production behind HTTPS, set `SESSION_COOKIE_SECURE=true`. | |