TLreaDR is a React + Flask application which allows users to share and interact with summarized news articles about current affairs. TLreaDR can be visted at: http://www.tlreadr.com/
To install the boilerplate dependencies, you can run:
git clone https://github.com/YaleDHLab/flask-react-boilerplate
cd flask-react-boilerplate
npm install --no-optional
pip install -r requirements.txt
Additionally, you need a .env file to store the private credentials used to connect to the database.
To do this follow these steps:
- Create a .env file in the root project directory
- Generate a SECRET_KEY using the python shell
>>> import os
>>> os.urandom(24)
'\xfd{H\xe5<\x95\xf9\xe3\x96.5\xd1\x01O<!\xd5\xa2\xa0\x9fR"\xa1\xa8'
- Add the following lines into the .env file
SECRET_KEY='the secret key you generated in step 2'
SQLALCHEMY_DATABASE_URI='postgresql://{username}:{password}@{JDBC_URL}/postgres
- Copy paste the .env file into each of the microservices directories so that they can have access to the database.
- Download docker for your platform and check if it is correctly installed using:
docker --version
- Build docker containers
docker-compose up --build
To run both the server and client, you can run the following command:
npm run dev
This will run the the client on 7081 and the server's microservices will run on:
- Server service: 7082
- User service: 7083
- Post service: 7084
- Comment service: 7085
- Command service: 7086
To run all services including the front-end as a docker container uncomment the front-end service from the docker-compose.yml and run the following
docker-compose up --build