Dean brings easy access to information to every Filipino. Using Free Facebook Mobile Data, we bring Google Search to all at no cost. Dean is a Facebook chatbot the can search Google!
- Fork the repository
- Create your virtual environment and install all dependencies.
- Make a .env file (We will add necessary tokens in this later)
- Use ngrok to make your app accessible online (for testing and development)
- Download ngrok here: https://ngrok.com/download.
- Ngrok connects your localhost to an accessible domain.
- Test it out on your Facebook Page!
- Create a Facebook Developer account and project, and follow these docs https://developers.facebook.com/docs/messenger-platform/getting-started.
- Ensure that you have admin rights to the page that you will use.
- Python
- Ngrok
- Flask
- Other dependencies can be installed using the command:
pip install -r requirements.txt
Step by step installation guide
-
If downloaded through website:
-
If using Conda
conda update python
- Can be downloaded through this website
- Make sure your virtual environment is activated (We advice you to install these in your virtual environment) ex:
<virtuelenv>/scripts/activate
- By using pip install, all dependencies in the requirements.txt file can be installed automatically.
pip install -r requirements.txt
Step by step process of how to create the Development environment
- Create a Facebook Developer account (https://developers.facebook.com/)
- Create your app
- Navigate to Add Products in the Dashboard screen and set up the Messenger product to the project
- Click settings under the Messenger Product and link your page to the app. Make sure to get the Access Token that was generated when linking the page.
- Paste the Page Access Token in the .env folder:
PAGE_ACCESS_TOKEN=<Your Page Access Token>
- Add a Verify Token to the .env file
- You create your own Verify Token
VERIFY_TOKEN=<Your Verify Token>
- Go back to the Messenger Product settings and link your Webhook by inputting your Webhook URL (See Local Machine steps to get your webhook URL) and the Verify Token you created.
- Click on "messages" and "messaging_postbacks" for the subscriptions fields of the webhook.
- Start your server by running main.py
python main.py
- Open your ngrok terminal. By default it should be in the .ngrok directory
C:/Users/<username>/.ngrok
- Open the ngrok shell and type in this command:
ngrok http 5000
- The https link will be the WEBHOOK URL of your app
Congratulations! You have set up your Development environment. Try sending a message to your chatbot to see if it works!
Step by step process of how to reactivate your Development Environment.
- Run the server
python main.py
- Activate Ngrok
ngrok http 5000
- Get the https link. That will be your Webhook URL
- Ngrok creates new URLS every time it is activated. Make sure to update your webhook URL in your Facebook Developer app
Heroku was used in Deploying the Chatbot.
- In the dashboard, navigate to app review, open it and click permissions and features
- You will need to request for Advanced Access to pages_messaging, public_profile, and email in order to get your chatbot up and running for production.
- Requirements
- 1024 x 1024 App icon
- Privacy Policy URL
- Screen recording of the App being used
- Requirements
- Once your app is approved, deploy the code on Heroku and update your webhook URL
- Create a Heroku account and create your project.
- Under the Deployment field, link your github account and repository.
- Make sure all the changes have been pushed.
- You can set up any of your branches for Automatic deploys or Manual deploys, any will work.
- Once the repository is deployed, copy the URL. This will be your new webhook.
Congratulations! You have deployed your chatbot to Heroku
- Flask - Web Framework
- Heroku - Deployment
- Beautiful Soap - Web Scraping
- Alec Wang
- Francis Guevara
- Franz Taborlupa
- Gio Divino