-
Required
Python Version
is3.9
-
Create .env file in the root folder. That contain multiple env variables need to be configured:
CONSUMER_KEY=<Twitter API key> CONSUMER_SECRET=<Twitter API secret key> TWEETS_NUMBER=10 FRONTEND_URL=http://localhost:3000 MONGO_HOST=localhost MONGO_PORT=27017 MONGO_DB=<Database Name> AUTH_PRIVATE_KEY=super_private_secret RESULT_MAX_AGE=3
-
Install MongoDB: https://docs.mongodb.com/manual/administration/install-community/
-
Install all required packages
pip install -r requirements.txt
- Run FastAPI on localhost and check the result on localhost:8000
python -m app.main
- Build the image
sudo docker build -t thesis-backend .
- Run docker container and check the result on localhost:8000
sudo docker run -p 8000:8000 thesis-backend
Run the tests with:
pytest
Example user: https://twitter.com/JohnCena
-
API call: http://localhost:8000/api/check?url=https://twitter.com/JohnCena
-
Use doc for more information http://localhost:8000/docs
-
Execute on FastAPI docs