Send a report to slack channel or user with the latest status updates about COVID-19 on each country
COVID19-status-reporter requires Node.js version 9 or above
-
Run
yarn install
to download the dependencies. -
Create a
.env
file with the environment variables that are needed for the service. You can copy/paste the.env.example
file and change the values:- SLACK_API_TOKEN: The slack token that you can get once you create a slack application under the OAuth & Permissions menu.
- CRON_PATTERN: Cron expression, for example, this pattern
*/5 * * * *
is gonna send a message every 5 seconds. You can learn more about cron here - PORT: The port where the application is gonna run
- TIMEZONE: To let the cronjob knows which timezone is gonna use. You can get the timezone values from here
-
Create a
slack_config.json
, we are gonna use this config file to know what type of data are we gonna send for each channel or user added in the json file. You can check theslack_config.example.json
file to know what is the structure to follow. -
Run
yarn build
so that to create the production bundle inside the build folder. -
Start up the server, I recommend PM2 (
pm2 start build/index.js
) but you can use your favourite one ;)
Its gonna send to the channel or user the top 10 countries sorted by TotalConfirmed
Its gonna send the list of countries includes in the countries
property. the values of this array of countries should be the SLUG of the country. You can find the countries supported here
- Support multiple users/channels with different type of data
- Add unit tests (yes, I know! I have should done it before!...shame on me...)
- Dockerize the application
- Add Telegram service
- Add log file system
MIT. See LICENSE for more details.