Skip to content

Need2Watch/N2W_Back

Repository files navigation

Stargazers Issues GPL3 License

Need2Watch Backend API

Introduction

Need2Watch is a web application where you can keep a track of the Tv Series and Movies that you are following and watching

The backend of this application consist in an API REST.

Usage

Dependencies

  • Docker
  • Docker-Compose
  • MySQL
  • Virtualenv
  • Python 3.8

Steps

  1. Create a Python 3.8 Virtual environment
  2. Inside the environment run pip install -r requirements

    If you get any errors in this step, check that all the dependencies are installed on your system.

  3. Run docker-compose up -d

    If you get an error saying that the port for the container is already been used, you may stop the mysql service. In most Linux distributions you can do it with sudo systemctl stop mysql.service.

  4. Create an .env file from env.dist file and set the environment variables. You should get MOVIE_API_KEY from TMDB
  5. Run python init_dbs.py
  6. Check everything is ok running the test with pytest.
  7. Run flask run
  8. Access to http://127.0.0.1:5000 and you will see the Swagger UI with all the API methods and you can test them.

Specific steps for Ubuntu and similar

  1. Install Docker
  2. Install Docker-Compose
  3. Install all the dependencies running sudo apt install python3.8 python3.8-dev virtualenv build-essential mysql-server mysql-client libmysqlclient-dev libsqlclient-dev libssl-dev -y
  4. Create the virtual environment with virtualenv -p python3.8 venv
  5. Activate it running source venv/bin/activate
  6. Follow the steps specified above