Robust Fantasy Premier League Application built on Flask w/ Python Server & React Frontend.
Jump directly to the deployed application here: fantasy-eleven.
- Fork and clone this repo from Github to your local environment
- Navigate into your local directory and open the contents in your preferred code editor
- Run
pipenv install
to install dependencies - Run
pipenv shell
to create virtual environment - From the main project directory, run
cd server
to enter the server directory
- Create
.env
file in the server directory withtouch .env
- Add a line for
SECRET_KEY=
- In your terminal, run
python -c 'import secrets; print(secrets.token_hex())
to generate your own key - Copy the result into the
.env
file as the value for the secret key - Make sure
.env
is added to your.gitignore
- Add a line for
DATABASE_URI=
- Copy the link to the external database you would like to connect. If you are using Render, start the link with
postgresql://
-- not justpostgres://
. You can find full instructions here.
export FLASK_APP=app.py
flask db init
flask db upgrade head
- Run
python seed.py
to seed the database
- In another terminal,
cd
into the client directory - Run
npm install
to install dependencies - Run
npm start
to open the app in the browser
- Once you've installed all client and server dependencies, you can also run the app in one terminal from the main directory:
gunicorn --chdir server app:app
MIT License Copyright (c) 2023
API-Football
RapidAPI-sports
Securing your session key
Create a Flask application with Google Login