Skip to content

ahmnouira/IoT_Platform_Flask

Repository files navigation

IoT Platform developped using flask

This is an IoT platform developped using flask where people can veiw the temperature, humidity and gaz state

Overview

Some photos about this project:

login

regsiter

cards_edit

card_data

card_data_error

Running this app

This app is designed to run in different ways:

  1. As a standalone app running on your machine
  2. As a Docker container running on your machine

As a standalone app

  1. install python
  2. git clone the project then cd into the directory
  3. run virtualenv -p /usr/bin/python3 venvor python -m venv venv to create a virtual environment
  4. activate it using source venv/bin/activate
  5. pip install -r requirements.txt to install the app libaries and it dependencies

setting up the databse

  1. you need to have mysql server installed in your machine, if you are working in linux just typr sudo apt-get update && apt-get install mysql-server
  2. type sudo mysql to enter to the database
  3. .....

run the app

After installing, run the server using flask run Access the running app in a browser at the URL written to the console (most likely http://localhost:5000)

As a Docker container running on your machine

  1. install Docker
  2. install Docker compose toolset
  3. run docker version to check if docker is installed
  4. run docker-compose --version to check if docker-compose is installed
  5. run docker-compose up -d --build to build the docker image of the flask app and mysql database
  6. docker images list the local avaible images
  7. go to http://localhost:8000 to start the container