Skip to content

๐ŸŒ ๐Ÿ”—An IoT data pipeline using MQTT, Kafka, TimescaleDB for real-time sensor analytics.

Notifications You must be signed in to change notification settings

karthik2603-theBrogrammer/casa-digital

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Casa Digital ๐Ÿ–ฅ๏ธ๐Ÿก

Screenshot 2023-12-25 at 1 12 58โ€ฏAM

Casa Digital is a real-time IoT data monitoring system designed for smart home purposes. It seamlessly connects MQTT sensors, streams data to Kafka, and queues into TimescaleDB for analysis. The system is implemented using Node.js for integration.

Tech Stack โ˜Ž๏ธ

  • MQTT: Message Queuing Telemetry Transport for sensor data communication.
  • Kafka: Distributed streaming platform for real-time data processing and queuing to timescaleDB.
  • TimescaleDB: Time-series database for efficient storage and retrieval of sensor data.
  • Node.js: Runtime environment for executing JavaScript code on the server-side.

How to run the project ? ๐Ÿƒโ€โ™€๏ธ

  1. Clone the Repository:
git clone https://github.com/karthik2603-theBrogrammer/casa-digital.git
  1. Modify the config.json file in the root, as per your needs.
{
  "topics": [
    "gas_sensor_data", // Enter your desired topics here.
    "temperature_data",

  ],
  "kafka": {  
    "bootstrap_servers": "localhost:9092" // Local host and port of kafka.
  },
"mqttBroker": {
    "bootstrap_servers": "mqtt://broker.hivemq.com" // Default Broker, configured in docker-compose file.
  },
  "docker": {
    "timescale_config": {
      "user": "postgres",
      "password": "password", // IMP: password here has to match docker-compose file !
      "host": "localhost",
      "port": "5432",
      "database": "postgres"
    }
  }
}
  1. Run the docker-compose File.
  • Maintain the same password for timescale !
docker-compose up -d
Screenshot 2023-12-25 at 1 35 04โ€ฏAM
  1. Configure Your IOT devices to their respective ports. NOTE: For more device connectivity use serial communication between 2 microcontrollers. (Ex: Arduino and ESP8266)
  • Once the device codes have been loaded with the same topics proceed.
  1. Run the Kafka Consumer.
cd sink
node index.js
  1. Run the MQTT-Kafka pair.
  • MQTT will listen to the network of IOT devices and sensors.
  • Then kafka will feed the data into the brokers in its respective topics.
cd mqtt-kafka
node index.js
  1. Watch the streaming of data into timescaleDB with an interactive CLI.
cd cli
pip3 install -r requirements.txt
python3 index.py
  1. To interact with timescale directly,
docker exec -it timescaledb psql -U postgres
Screenshot 2023-12-25 at 1 46 07โ€ฏAM

Contributing

  • I have learnt a lot developing this project of mine, it may not be the best but i gave it my all nevertheless :)
  • Feel free to contribute to this project. Fork the repository, make your changes, and submit a pull request.

๐Ÿš€

Screenshot 2023-12-25 at 1 12 58โ€ฏAM

About

๐ŸŒ ๐Ÿ”—An IoT data pipeline using MQTT, Kafka, TimescaleDB for real-time sensor analytics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published