FoosBot is a HipChat bot that tracks Table Football (foosball) match results and player stats, ranking players by TrueSkill
Here are some basic notes to get this bot built, deployed and integrated into your HipChat room.
It will create a full API pipeline in AWS, with seperate test and stable endpoints, each with their own datastore in DynamoDB.
- AWS account with access to IAM, API Gateway, Lambda and DynamoDB
- Node.js 6.10
- NPM
- Yarn
- Caludia JS - https://claudiajs.com/tutorials/installing.html
Ensure you setup an AWS key and secret for Claudia to use
- Navigate to the
/apifolder - Run
yarn --ignore-engines install
--ignore-enginesis required asjstrueskillis incorrectly pinning to only support a specific node and npm version - Now you can
yarn buildwhich will lint, test and compile your code
- In
/databaserunyarn installfollowed byyarn start:testandstart.
This will use the javascript AWS api to create the following tables in DynamoDB:foosbot-test-installationsfoosbot-test-match-historyfoosbot-installationsfoosbot-match-history
- In
/apirunyarn createaws.
This will use Caludia JS to create a new AWS API Gateway pointing to a new Lambda function calledfoosbot-interactive.
- Use
yarn deployto package the NodeJS project and deploy it to your Lambda with thetest-env.jsonenvironment parameters. This will be available at the/latestendpoint on your API Gateway, the full URL for which will be included in the log output from Claudia JS. - Use
yarn promoteto take the latest version deployed to Lambda, apply thestable-env.jsonenvironment parameters and tag this deployment as stable, making it available via the/stableendpoint on your API Gateway.
When you yarn deploy or yarn promote Claudia JS will return the URL to access the latest or stable version of your FoosBot API. Copy this url and add /descriptor to the end. Now navigate to the HipChat room, select 'Integrations' on the menu option and follow steps below:
- Click 'Install new integration' (must be room admin)
- 'Build your own Integration'
- 'Install an integration from a descriptor URL'
- Paste in the URL for either the latest or stable endpoint with
/descriptoron the end.
Happy Foosballing.