This is a Flask app visualizing statistics and sentiment for tweets about Andrew Yang, the 2020 presidential candidate.
There is a streaming job that streams live tweets about Andrew Yang, Yang Gang and the Freedom Dividend to an AWS RDS Postgres database.
This Flask app consumes data in that database.
- Create a virtualenv folder
virtualenv -p python3.6 venv
- Activate
source venv/bin/activate
- Install the requirements
pip install -r requirements.txt
- Run Flask app
FLASK_ENV=development python application.py
Note that the env variables are in .env
and should be kept out of git securely.
Sometimes there are issues which only can be found on the server side, such as timezone problems. Staging is a great
place to test it. With the Procfile
and automatic deployment from Github setup, we can deploy to Heroku by simply
git push -u origin master
.
Heroku app url: https://andrewyangtrend.herokuapp.com/
Refer to EB CLI instruction about how to setup and initialize an EB project properly.
I'm using AWS Route 53 domain name and setting name servers in AWS Route 53 as well. GoDaddy is not the best experience, go with AWS Route 53 for domain names.
After proper setup, to make update to the app, simply commit the code and run
eb deploy
The change will be live on http://www.andrewyangtrend.com after a couple of minutes.
- Twitter API Tweet Object
- AWS Elastic Beanstalk CLI
- AWS RDS Database Monitoring and Performance Check
- Alembic Database Autogenerate Migration
- Statsmodels Linear Regression Coefficients and P-values
- Wordcloud
- Add HTTPS to your website
- Add Google Analytics to your website
- AWS Kinesis Firehose
- AWS Elasticsearch