Backend that powers two things for FTGIOO's Streamer University weekend:
- Auto-updating Fossabot commands via
$(customapi ...)— set each command once and it always returns the right class based on Central Time. - Shared mod control board —
mark as doneand "current class" sync across all mods (and drive what Fossabot shows).
Postgres is optional. Without a database it runs in memory (customapi still works; marks/current reset on restart). Add Postgres to make them persistent and shared.
- Go to railway.app and sign in with GitHub.
- New Project → Deploy from GitHub repo → pick
Tdotesko/ftgioo-su2026-api. (If Railway can't see it, click Configure GitHub App and grant access to the repo.) - Railway auto-detects Node, runs
npm install, thennpm start. - Open the service → Settings → Networking → Generate Domain. You'll get a URL like
https://ftgioo-su2026-api-production.up.railway.app. This is your API base URL. - Variables (service → Variables) → add:
MOD_KEY= any secret you make up (mods paste this into the board once). Required for writes.
- Visit your URL in a browser — you'll see a status page with the exact
$(customapi ...)strings to paste into Fossabot, plus test links.
- In the project: New → Database → Add PostgreSQL.
- Open the API service → Variables → New Variable → Add Reference →
select Postgres
DATABASE_URL. (This injectsDATABASE_URLinto the app.) - Redeploy. The status page will now show
Storage: postgres. (If you ever use an external/public Postgres URL, also setPGSSL=true.)
For each command, set the response to the matching line (replace BASE with your URL):
| Command | Response |
|---|---|
!current |
$(customapi BASE/fossabot/current) |
!professor |
$(customapi BASE/fossabot/professor) |
!next |
$(customapi BASE/fossabot/next) |
!today |
$(customapi BASE/fossabot/today) |
!classes |
$(customapi BASE/fossabot/classes) |
That's it — those commands now update themselves all weekend.
GET /fossabot/current|professor|next|today|classes→ plain text for Fossabot.GET /api/state→ JSON: current control, effective class, all marks, server CT.GET /api/schedule→ the full schedule JSON.POST /api/control{mode:"auto"|"manual", day, section, by, key}→ set the live class.POST /api/mark{day, section, by, at, key}→ toggle a class "done".
Writes require key to equal MOD_KEY. Reads are open (Fossabot needs them open).
To change any class text or time, edit schedule.js and redeploy.