Connect voluntary blood donors with recipients. Chatbot built with Here, Telegram, Facebook messenger, Wit ai, and Sails JS
- Here Developers Account
- Wit AI Account.
- Facebook Messenger Account.
- Telegram Account.
- Mac OS (feel free to use any OS).
- Git.
- Node (NPM)
- Sails JS.
- Mongo DB.
- Ngrok or a cloud hosting service (DigitalOcean, AWS).
- Create a freemium account via Here.
- Create an API Key and store it in your OS environment variable by running:
export HERE_API_KEY=YOUR-API-KEY
- Create places data layer and store the space ID in your OS environment variable by running:
export HERE_SA_PLACE_SPACE_ID=YOUR-SPACE-ID
Note: We used South Africa data layer. Feel free to replace HERE_SA_PLACE_SPACE_ID with your preferred variable name and also update it in your code 4. Create an access token and store it in your OS environment variable by running:
export HERE_ACCESS_TOKEN=YOUR-ACCESS-TOKEN
- Create a new chatbot via BotFather.
- Store the newly created telegram bot access token in your OS environment variable by running:
export TELEGRAM_TOKEN=YOUR-ACCESS-TOKEN
- Follow the necessary steps to create a developer account and chatbot via Facebook Messenger Documentation.
- Store your Facebook token in your OS environment variable by running:
export FACEBOOK_TOKEN=YOUR-FACEBOOK-APP-TOKEN
- Store the wit.ai server access token in your OS environment variable by running:
export WIT_AI_TOKEN=YOUR-WITAI-ACCESS-TOKEN
Navigate to the project directory in your terminal and install the necessary packages
npm install
Start the project by running:
npm run start
npm run dev
Open a new terminal, Navigate to the project directory and start your Ngrok Server
ngrok http 1500
To set the webhook URL to your telegram chatbot, run this in your terminal. Note: Replace YOUR_NGROK_URL with your Ngrok server URL.
curl https://api.telegram.org/bot$TELEGRAM_TOKEN/setWebhook?url=https://YOUR_NGROK_URL/flow/callback/telegram
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.