This is an app publishing Slack messages about new badminton tournaments available in France.
This app aims to notify players when a new badminton tournament is approved by the French Badminton Federation (FFBad) near them.
Every published tournaments includes all the useful information:
- Tournament dates span
- Location and distance relative to the specified club
- Opened events (MS, WS, ...)
- Allowed rankings
- Entry prices
- Withdrawal deadline
- Tournament-specific rules
It can be fully customized to search new tournaments:
- Around club location within said radius
- Within said players ranking
- For any age categories
Here is an example of what a message looks like
Here are the steps needed to run the app for your club.
Download the app from the Releases page
- AWS Lambda: The app is designed to be an AWS Lambda application
- AWS DynamoDB: The app stores already published tournaments inside an AWS DynamoDB database
- Slack: Obviously a Slack workspace is required in order to publish messages
NB: This app uses very few AWS resources, it should never go over the AWS Free-Tier program
The following instructions should help you deploy the app:
-
Create a new Slack App with any name you want and add it to your Slack workspace.
Inside
Settings > Basic Information
: Configure the features "Bots" and "Permissions".In "Permissions" the app only need the scope (Bot Token Scopes)
chat:write
In this section, you can also find your Bot User OAuth Token (`xoxb-XXX), it will be needed later
-
The FFBad API requires 2 header tokens: see MyFFBad tokens on how to retrieve both of them
-
Create a new DynamoDB database with a table named
PublishedTournament
-
Create a new IAM User for the previously created database, with RW authorizations on it
-
Set up a new AWS Lambda function and set it to run on a
Java 17
environment andx86_64
architecture -
Upload the
.jar
file you want to run -
In the Runtime settings section, set the handler to
org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
-
Provide the following environment variable to the Lambda function (from the configuration panel):
// DynamoDB AWS_DYNAMODB_ENDPOINT: dynamodb.XXX.amazonaws.com DYNAMO_ACCESS_KEY: <dynamodb_user_access_key> DYNAMO_SECRET_KEY: <dynamodb_user_secret_key> // MyFFBad header tokens SEARCH_VERIFY_TOKEN: <myffbad_header_search_verify_token> DETAILS_VERIFY_TOKEN: <myffbad_header_details_verify_token> // Slack SLACK_CHANNEL: #my-tournaments-channel SLACK_TOKEN: xoxb-XXX
-
Optional: You may want to automatically and regularly trigger the function. AWS EventBridge (CloudWatch Events) can be a good option.
Just set up the function to be triggered using a CRON-based event. Tournaments are not published that often, triggering the function once (or twice) a day is more than enough.
To perform a search, the app expects a json
input containing the search parameters.
The parameters must be provided when triggering the lambda.
Here is an example of the expected json
input
{
"queries" : [
{
"zipCode": "92240", // French zip code of location to search from
"distance": 12, // Radius in km to search around zip code
"subLevels": ["R6","D7","D8", "D9"], // Players rankings to include for the search.
// It will search for any subset of specified rankings.
// Values are from FFBad official ranking names (From N1 to NC)
"categories": ["SENIOR", "VETERAN"] // Age categories to search tournaments for.
// It will search for any subset of specified categories.
// Values are from FFBad official age categories names (From MINIBAD to VETERAN)
}
]
}
NB: If your using a CloudWatch Event to trigger the function, this input can be set as the payload of the event.
If you have any suggestion on how to improve the app, feel free to open an issue. I'll be happy to consider it !