-
Notifications
You must be signed in to change notification settings - Fork 6
Technical overview
Typescript based server component. Has REST API endpoints for the client (logging in users, connecting to Twitch, adding song requests etc.), handles Twitch events (messages in chat etc.) and connections to other services (Streamlabs, Spotify etc.).
Typescript+React based UI for the bot. Allows normal users to view information like the song list and allows mods or the broadcaster to change settings, add/remove songs from the queue etc.
Caches sessions of logged in users, not too important during development.
/commands
Contains classes that represent commands that can be executed in chat using !commandname. Some commands need to check for the user’s permission.
Add commands to index.ts to integrate them into the bot. Override getAliases() to add command aliases.
/controllers
Classes for handling API requests. Routes to those are defined in /routes.
/database
Classes or retrieving/changing database records. Each class basically represents a database table. For the actual objects see /models
/errors
Classes for specific exceptions
/events
Classes that handle the logic of events (like games and auctions). Events are being orchestrated by /services/eventService.ts
/lang
Messages, mainly those used in events (for posting to chat)
/models
Classes that represent entities saved to the database or other specific objects. See /database for management classes.
/routes
Defines API endpoints that can be used by the client / UI
/services
Various services that handle the database, events, Twitch integration etc.
Notable:
- commandService.ts for handling commands
- eventService.ts for handling events
- databaseService.ts for setting up the database (add new tables and fields here). “Knex” is used as SQL query builder here.
- songService.ts for handling the song queue
/strategy
Authentication configuration for services like Twitch and Spotify
/components
React function components for various parts of the UI
- /twitch/TwitchCard.tsx: Currently main configuration area for connecting to Twitch and other services. To make the bot join a Twitch channel, click “connect to bot”, wait until connected (2 seconds or so, status will be shown in the server docker container log) then click the Twitch button.
- /songqueue/SongQueue.tsx: Displays and allows management of the song queue
- /songlist/songlist.tsx: Shows the song list (future replacement for the Google Docs document)
/hooks
Additional custom react hooks
/views
Top level react components for displaying the UI