Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thundergolfer/source-rank
:hash:FBHack Melbourne 2018 - An open approach to news and media content quality evaluation
https://github.com/thundergolfer/source-rank
chrome-extension facebook facebook-messenger-bot fake-news messenger-bot news-media news-quality
Last synced: 15 days ago
JSON representation
:hash:FBHack Melbourne 2018 - An open approach to news and media content quality evaluation
- Host: GitHub
- URL: https://github.com/thundergolfer/source-rank
- Owner: thundergolfer
- Created: 2018-05-05T02:37:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T07:46:11.000Z (about 2 years ago)
- Last Synced: 2024-12-12T20:52:36.457Z (22 days ago)
- Topics: chrome-extension, facebook, facebook-messenger-bot, fake-news, messenger-bot, news-media, news-quality
- Language: JavaScript
- Homepage: http://www.sourcerank.org/
- Size: 5.93 MB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Source Rank - Facebook Hackathon 2018 - [![Build Status](https://travis-ci.com/thundergolfer/source-rank.svg?token=yHGWQ42iK2BPk1FjaUMc&branch=master)](https://travis-ci.com/thundergolfer/source-rank) [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/27e1e3bab7bc89016073)
---------
---------
**Newcomers**, see [the intro doc](docs/project_intro.md) to get an idea of what this project is about.
----------
## USEFUL STUFF
* **Google Drive Assets** - https://drive.google.com/open?id=1ZpnoNeRRa7MEpIqcvVNDGo1WPLLD7oBR
----------
## Overview
This project:
* has a [React JS](https://reactjs.org/) web app front-end,
* uses [Flask](http://flask.pocoo.org/) and [`flask_restful`](https://flask-restful.readthedocs.io/en/latest/) for the backend APIs,
* uses [PostGreSQL](https://www.postgresql.org/) for data persistence
* [Heroku](https://dashboard.heroku.com/) as the app cloud platform
* and various Python packages for the background workers## Installation
#### Frontend
1. `cd frontend`
2. Install the front-end dependencies by running `npm install`.
3. Run the project with:
- `npm start` - Runs a development server with hot reloading
- `npm run build` - Creates a `/dist` folder containing a minified bundle (`bundle.js`) and `index.html`
- `npm run serve` - Serves the `/dist` folder on an express server#### Backend
1. Back-end Python dependencies are managed by [`pipenv`](https://github.com/pypa/pipenv). Do `pipenv install --dev` to install everything.
2. [Install PostGreSQL](https://www.postgresql.org/download/) for local development.
3. You need to run `export DATABASE_URL=postgresql://localhost/$(whoami) && export FLASK_APP=./app.py` (for Windows use `set` not `export`)
4. ~~Run `flask db init`~~ (probably don't want to do this)#### Messenger Bot
1. `cd messenger-bot`
2. Install with [`yarn`](https://yarnpkg.com/lang/en/) by running `yarn`.#### Chrome Extension
`coming soon`
## Deployment
#### Web Application
To deploy the web app, you'll need Heroku set up.
1. Get the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) if you don't already have it.
2. You will need to [get added as a collaborator](https://devcenter.heroku.com/articles/collaborating) to the app.**The web application is deployed automatically on push to `master`**
#### Messenger Bot
1. `cd messenger-bot`
2. (FIRST TIME ONLY) `now switch source-rank`
3. `yarn run deploy`
4. Check `sourcerank-fb-messenger-bot.now.sh` (latest deployment)#### Chrome Extension
`coming soon`
#### Review Apps
For our Heroku provided ['review apps'](https://devcenter.heroku.com/articles/github-integration-review-apps) the DB isn't automatically created. A command of this form can be manually run after the review app is create to copy over data
`heroku pg:copy facebook-hack-2018::DATABASE_URL DATABASE_URL --app facebook-hack-2018-pr-1384 --confirm facebook-hack-2018-pr-1384`
## Development
#### Running The app
##### Back-End
`python app.py`
##### Front-end
1. `cd frontend/`
2. `yarn run start`
##### Messenger bot
1. `yarn run start`
##### Chrome Extension
`coming soon`
#### Migrations
Database schema migrations are performed by editing the *FlaskSQLAlchemy* models in `backend/models.py` and then using *Flask-Migrate* to migrate with the command `flask db migrate`.
After running that command, check the created migration file in `migrations/`. If it looks good, run `flask db upgrade` to apply the migration and then commit the new migration file to the repo.