Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FTGIOO — Streamer University 2026 API

Backend that powers two things for FTGIOO's Streamer University weekend:

  1. Auto-updating Fossabot commands via $(customapi ...) — set each command once and it always returns the right class based on Central Time.
  2. Shared mod control boardmark as done and "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.


Deploy on Railway (about 5 minutes)

  1. Go to railway.app and sign in with GitHub.
  2. 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.)
  3. Railway auto-detects Node, runs npm install, then npm start.
  4. 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.
  5. Variables (service → Variables) → add:
    • MOD_KEY = any secret you make up (mods paste this into the board once). Required for writes.
  6. Visit your URL in a browser — you'll see a status page with the exact $(customapi ...) strings to paste into Fossabot, plus test links.

Add Postgres (for shared, persistent mark-as-done)

  1. In the project: New → Database → Add PostgreSQL.
  2. Open the API service → Variables → New Variable → Add Reference → select Postgres DATABASE_URL. (This injects DATABASE_URL into the app.)
  3. Redeploy. The status page will now show Storage: postgres. (If you ever use an external/public Postgres URL, also set PGSSL=true.)

Fossabot setup

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.


Endpoints

  • 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.

About

Fossabot customapi + shared mod control board backend for FTGIOO Streamer University 2026

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages