Backend server for the live music streaming application Buskit
- Install MongoDB and start server (
$ mongod
) - Install NodeJS (with npm)
- Install yarn (
$ npm i -g yarn
) - Clone the repo and
$ cd
into it $ yarn
to install dependencies
$ yarn start
to start the web server onhttp://localhost:3000/
Buskit secures protected endpoints with JWTs (read the section Include the JWT in requests). A user can retrieve their JWT by authenticating with Twith. Currently only the OAuth Authorization Code Flow is supported which requires a client to send an Authorization Code to the auth endpoint on the Buskit server. Upon receiving an auth code, the server will verify the code with Twitch, find or create a user in the Buskit database, and finally respond with relevant user info (including a JWT).
Verify twitch auth code and return JWT for Buskit user. After authentication, all Twitch WebHook subscriptions will be created/renewed.
Query | Description |
---|---|
code | Authorization code issued to be verified with Twitch |
Response | Description |
---|---|
user | the user object or null if not found |
token | JWT for further protected route access |
Retrieve a user from the database
Query | Description |
---|---|
id | id of the user to retreive |
Response | Description |
---|---|
user | the user object or null if not found |
Get all streams
Response | Description |
---|---|
streams | array of stream objects |
Twitch Stream Changed subscription verification
Response | Description |
---|---|
hub.challenge query from request |
Twitch Stream Changed subscription notification
Get all tags
Response | Description |
---|---|
tags | array of tag objects |
Save tags into database. Tags are unique in the database, therefore any posted tags that already exist will be ignored. The API will attempt to save all the tags into the database which will then only insert new tags and return an error object with write information.
Response | Description |
---|---|
tags | array of tag objects inserted or already found in database |
error | any error that may have occured |
Save tags into database. Tags are unique in the database, therefore any posted tags that already exist will be ignored. The API will attempt to save all the tags into the database which will then only insert new tags and return an error object with write information.
Response | Description |
---|---|
tags | array of tag objects inserted or already found in database |
error | any error that may have occured |
🍕