git clone https://github.com/Ganthepro/iot-infrastructure.git- Prerequisite
-
PostgreSQL
-
RabbitMQ
-
-
Install dependency, run this following command
pip install -r requirements.txt
-
Set up the
.envfile using.env.exampleas a referenceDB_USERNAME=postgres DB_PASSWORD=P@ssw0rd! DB_HOST=localhost DB_DATABASE=postgres RABBITMQ_HOST=localhost -
Run
main.pyfrom thedata_loggerfoldercd data_logger python main.py -
Run
main.pyfrom theiaq_sensorfoldercd iaq_sensor python main.py -
Navigate to the
apifolder, run this following commandcd api fastapi dev
-
Prerequisite: Docker Engine
-
Set up the
.envfile using.env.exampleas a referenceDB_USERNAME=postgres DB_PASSWORD=P@ssw0rd! DB_HOST=postgres DB_DATABASE=postgres RABBITMQ_HOST=rabbitmq -
Run Docker Compose script, using this following command
docker compose up -d --build
Open the API Swagger documentation in your browser by navigating to http://127.0.0.1:8000/docs or http://localhost:8000/docs
Use the API Swagger documentation to query sensor data from the database and delete all data.