Skip to content

Tempoture/Tempoture-backend

Repository files navigation


Logo

Backend and Database for the Tempoture Project

Repositories for Tempoture
Frontend Repository · Backend and Database Repository · Testing Repository

Tempoture is an application designed to link users to a playlist based on the current weather in their area. The main goal is to be able to correlate user listening habits to the change in weather through the use of a machine learning model.

Table of Contents

Backend

About The Backend

An API specifies what kind of interactions a user can have with a software. The Tempoture backend will make use of three APIs:

  1. IP Geo Location

  2. OpenWeather

  3. Spotify - User Recently Played Songs

Backend Software

  • Flask - The Python framework used for its backend tools.
  • Python3 - The programming language of choice for the project.
  • scikit-learn - The Python library being used for machine learning.

Backend Installation Guide

Before installing the following softwares, have the latest version of Python installed. Also note that these install commands are specific for the Ubuntu bash terminal.

$sudo apt update - Ensures Ubuntu is up to date.
$pip3 install -r requirements.txt - Installs all requirements from the requirements text file. Make sure you've navigated to the correct folder!

Azure Cloud Design


Azure


Database

About The Database


Database


Above is a physical representation of the database that is used for the Tempoture project. The SQL to make this database can be found here. This database is used to store user data, Spotify music data, and local weather data.

The python script that is used to manipulate with the database (such as updating the weather data) can be found [here] (https://github.com/Tempoture/Tempoture-backend/tree/main/database/ml_database.py)

Database Software

  • Vertabelo - An application used for designing database schema.
  • PGAdmin - A software used for database maintenance and running queries.
  • Psycopg2 - A software used with python to establish connections with databases.
  • PostgreSQL - An open source object-relational database system that uses and extends the SQL language.
  • Python3 - The programming language of choice for the project.
  • SQLAlchemy - The software used in conjunction with Psycopg2 to query the database.
  • Flask - The Python framework used for its backend tools.

Database Installation Guide

Before installing the following softwares, have the latest version of Python installed. Also note that these install commands are specific for the Ubuntu bash terminal.

Flask

      $sudo apt update - Ensures Ubuntu is up to date.
      $sudo apt install python3-pip - Install package management system.
      $pip install Flask - Install for Flask.

Psycopg2

      $sudo apt update - Ensures Ubuntu is up to date.
      $sudo apt install python3-pip - Install package management system.
      $pip install psycopg2 - Install for psycopg2.

PostgreSQL

      $sudo apt update - Ensures Ubuntu is up to date.
      $sudo apt-get install postgresql postgresql-contrib

SQLAlchemy

      $sudo apt update - Ensures Ubuntu is up to date.
      $pip install SQLAlchemy - Install for SQL alchemy.

Useful Resources

Backend Resources

Database Resources

License

  • License - Distributed under the GPL License. Click for more information.