git clone https://github.com/Suwi-inc/LBS-server.git
cd LBS-server
There are 2 entites that the product consists of: python web API and postgreSQL DBMS. There are also 3 options to set the environment up:
The env file:
# for all cases
DATABASE_USER={the user of the db}
DATABASE_PASSWORD={the user's password}
DATABASE_LBS_NAME={main database name}
DATABASE_LOGGER_NAME={logger database name}
SECRET_KEY={secret key}
# for the 1-st case
DATABASE_HOST_LOCAL_DOCKER={the name of the postgres container}
DATABASE_PORT_LOCAL_DOCKER={the inner port of the postgres container}
# for the 2-nd case
DATABASE_HOST_REMOTE={the ip of the remote server}
DATABASE_PORT_REMOTE={its port}
# for the 3-rd case
DATABASE_HOST_LOCAL_NATIVE={the name of the postgres installed locally (no docker)}
DATABASE_PORT_LOCAL_NATIVE={its port}
DB_URI=postgresql+psycopg2://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST_LOCAL_NATIVE}:${DATABASE_PORT_LOCAL_NATIVE}/${DATABASE_LBS_NAME}
LOGS_DB=postgresql+psycopg2://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST_LOCAL_NATIVE}:${DATABASE_PORT_LOCAL_NATIVE}/${DATABASE_LOGGER_NAME}
docker compose up --build -d
cd LBS
poetry run flask --app app run --host=0.0.0.0