This tutorial series demonstrates how to build a chat app with sentiment analysis using Pusher Channels, Flask and Vue.js. You can read the tutorial on how it was built here:
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
This application uses the following:
- Python 3.6+
- Node.js version 8.9 or above
- Vue cli
First, clone this repository to your local machine:
$ git clone https://github.com/dongido001/pusher-chat-sentiment-analysis.git
Next, update the following keys in the api/.env
file with your correct Pusher keys:
PUSHER_APP_ID=app_id
PUSHER_KEY=key
PUSHER_SECRET=secret
PUSHER_CLUSTER=cluster
Then, update the .env
file in the project’s root folder with your correct Pusher App key:
VUE_APP_PUSHER_KEY=<PUSHER_APP_KEY>
VUE_APP_PUSHER_CLUSTER=<PUSHER_APP_CLUSTER>
- Using your terminal, navigate into the Flask folder -
api
:
$ cd api
- Create a virtual environment:
python3 -m venv env
- Activate the virtual environment:
source env/bin/activate
On windows? Activate it with the below:
source env/Scripts/activate
- Install the dependencies:
pip install -r requirements.txt
- Download NLTK corpora:
$ python -m textblob.download_corpora lite
- Finally run the app:
flask run
Check the URL where Flask is running - http://localhost:5000. You will get a text "Pong!".
Open a new terminal window, then navigate into the projects root folder - one-to-one chat
:
Install dependencies:
npm install
Then run the app:
$ npm run serve