Spaces:
Sleeping
Sleeping
File size: 1,241 Bytes
b5aa3c3 62442b7 df98da1 34f3738 df98da1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | ---
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`.
|