![banner](https://raw.githubusercontent.com/mylons/labs12-training-bot-2-BE/master/img/logo.png)
![standard-readme compliant](https://camo.githubusercontent.com/601311be92f293e1ccc0b1d2f54d573e13237b48c0b4e6079d22d7c625a54e3a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374616e646172642d2d726561646d652d4f4b2d677265656e2e7376673f7374796c653d666c61742d737175617265)
An Express + Node.js API for Training Bot
TODO: Write background section
This project has an app.json
file, which allows us to offer "one-click deployment" to Heroku. This will allow you to get your own version of Training Bot up and running both quickly and painlessly.
NOTE: Before clicking the button below you'll want to make sure you've completed the prerequisite setup steps in the complete documentation.
![Deploy](https://camo.githubusercontent.com/df5706ea91f4c49deb42ca31a753d025e2078d24e2490cf88ffc7ed84a38e48e/68747470733a2f2f7777772e6865726f6b7563646e2e636f6d2f6465706c6f792f627574746f6e2e737667)
Most routes require authentication, and Training Bot handles authentication by looking for a valid JWT's on the Authorization
header of a given request.
Valid JWTs are provided by the Auth0 integration with our React application. However -- for testing -- You can get a token programattically using the Auth0 Management API.
route |
methods |
description |
Docs |
api/auth/ |
POST |
Takes a valid JWT provided by Auth0 and logs the user in |
JS Docs |
route |
methods |
description |
Docs |
api/users/:id |
DELETE |
Deletes a specific user based on the ID parameter |
JS Doc |
route |
methods |
description |
Docs |
api/team-members/ |
GET, POST |
Get all Team Members associated with an authenticated User and/or Create a new Team Member associated with an authenticated User |
JS Doc |
api/team-members/:id |
GET, PUT, DELETE |
Read, Update, and Delete specific Team Members |
JS Doc |
api/team-members/:id/unassign/:ts_id |
DELETE |
Unassign a specified Team Member from a Training Series |
JS Doc |
route |
methods |
description |
Docs |
api/training-series/ |
GET, POST |
Get all the training series associated with an authenticated User and/or Create a new training series associated with an authenticated User |
JS Doc |
api/training-series/:id |
GET, POST, DELETE |
Read, Update, and Delete specific training series |
JS Doc |
api/training-series/:id/messages |
GET |
Get all the messages for a specific training series |
JS Doc |
api/training-series/:id/assignees |
GET |
Get the team members for the specific training series |
JS Doc |
route |
methods |
description |
Docs |
api/messages/ |
GET, POST |
Get all Messages associated with an authenticated User and/or Create a new Message associated with an authenticated User |
JS Doc |
api/messages/:id |
GET, PUT, DELETE |
Read, Update, and Delete specific Messages |
JS Doc |
route |
methods |
description |
Docs |
api/stripe/ |
POST |
allows user to update/change their stripe plan. |
JS Doc |
api/stripe/register |
POST |
register the user with stripe's API to get a stripe ID |
JS Doc |
api/stripe/unsubscribe |
POST |
allows user to unsubscribe from their current plan. |
JS Doc |
api/stripe/plans |
GET |
allows user to see available plans (basic, premium, pro) |
JS Doc |
api/stripe/subscriptions |
GET |
Allows the user to access the three subscription that go with the three plans |
JS Doc |
api/stripe/customer/plan |
GET |
Shows the user what their current plan is |
JS Doc |
api/stripe/paymentintent |
POST |
required by the stripe API to be able to collect credit card payments. |
JS Doc |
route |
methods |
description |
Docs |
api/slack/oauth |
POST |
Creates authenticated Slack Token in the database after oauth validation |
JS Doc |
api/slack/ |
GET |
Get all Slack users from the authenticated Slack workspace |
JS Doc |
api/slack/:id/history |
GET |
Get all messages in specific DM chat history with specified Team Member |
JS Doc |
api/slack/sendMessageNow |
POST |
Bypass Notification timer and immediately send specified Team Member a Slack Message, for testing purposes only |
JS Doc |
route |
methods |
description |
Docs |
api/notifications/ |
GET, POST |
Get all Notifications associated with an authenticated User and/or Create a new Notification associated with an authenticated User |
JS Doc |
api/notifications/:id |
GET |
Get specific Notifications |
JS Doc |
api/notifications/:id/response |
GET |
Get all Responses associated with an authenticated User for specific Notification |
JS Doc |
api/notifications/:id/delete |
DELETE |
Delete specific Notifications |
JS Doc |
route |
methods |
description |
Docs |
api/responses |
GET |
Get all Responses for authenticated User |
JS Doc |
api/responses/:id |
GET, DELETE |
Get or delete specific Response |
JS Doc |
api/responses/email |
POST |
Create a new email Response |
JS Doc |
api/responses/sms |
POST |
Create a new text Response |
JS Doc |
api/responses/slack |
POST |
Create a new Slack Response |
JS Doc |
MIT © 2019 Training Bot