Skip to content

SMOG-Devs/KST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KST - Kraków smog tracker

Table of contents

Project description

# TODO

Setup

BACKEND

1. Install python 3.10 and Docker

2. Create virtual environment

cd backend
# create virtual environment
python -m venv ./venv
# activate venv
# LINUX:
source venv/bin/activate
# WINDOWS:
./venv/Scripts/activate
# if you encounter "running scripts is disabled on this system" use this command and then ./venv/...
Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "RemoteSigned"

# install all requirements
pip install -r requirements.txt

3. Create docker container with MySQL database.

  1. Run the Docker
  2. Start the container
# from backend directory
docker-compose -p kst-mysql-db -f docker-compose.yml up -d

To run the app you need to create kst_db database inside the MySQL container:

# open terminal inside the container
docker exec -it kst-mysql-db bash
# enter the MySQL console
mysql -u root -p
[ENTER PASSWORD](see `MySQL local db config` below)

Now enter following SQL queries:

-- create database
CREATE
DATABASE kst_db;
-- Check if db created successfully
SHOW
DATABASES;

Database is set up. You can run the app now

4. Run the app:

cd backend
python run.py

5. When you're done stop the app and container

docker-compose -p kst-mysql-db -f docker-compose.yml stop
# WARNING! If you run `docker-compose ... down` it will remove all images, networks, volumes etc.
# For data persistence use `stop`.

MySQL local db config:

username:   root
password:   secret_password

FRONTEND

1. Install Node.js and npm

# UNIX: 
sudo apt install nodejs
sudo apt install npm
# Windows:
# https://nodejs.org/en/download/

2. Install React and dependencies

npm install -g create-react-app  
npm install

3. Run the frontend

npm start

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages