A flexible Application that allows designing different kinds of experimental news websites for academic research. Feel free to use and adapt it to your needs.
The app runs on a Python backend and can fetch articles either from a local database or from an external API. The frontend is built on React and features several options for customisation. The default setting of the app includes a homepage where articles are shown as a list and a reading page where users can read individual articles. In addition, the app also features several alternative ways of displaying content (overall homepage and individual articles). See below for images.
- Clone the repository
git clone https://github.com/nickma101/NewsWebsite
- Create a virtual environment and activate it:
python3 -m venv venv
source venv/bin/activate
- Navigate to backend and install requirements with
cd backend
pip install -r requirements.txt
- Edit (if necessary) and initialise database (see [add link] for default database models)
flask db init
flask db migrate
flask db upgrade
- Fire up the backend
flask run
- Install necessary react packages
cd frontend
npm i
- Fire up the react frontend and python backend for local development
npm start
*Note for Mac-users: The backend runs on localhost:5000 by default. However, it may be that this port is blocked. If the app is not running you may want to deactivate AirPlay or change the API endpoint for the backend
Both the front- and backend can be freely adapted.
Available display options include a number of different article cards as well as either a news homepage or a one- or two-column grid (see above).
Depending on your setup you might want to change the source of the articles (e.g. access via API or from local database), the database model, or the recommendation logic. See here for a conceptual model of the app: [add link]. Changes to the different elements can be made in the respective python scripts (e.g. algorithms.py for the recommendation logic or routes.py for which data is being logged and when)