Code Monkey home page Code Monkey logo

realtime-voting-pipeline's Introduction

Real-Time Voting Data Pipeline

A real-time voting system that uses Apache Kafka, PostgreSQL, Apache Spark, Apache Zookeeper and Streamlit.

Architecture

image

Instructions

Prerequisites:

  • Docker and Docker Compose installed on your machine (Preferably through Docker Desktop).
  • Make sure that the following ports are free:
    • 8501
    • 2181
    • 9092
    • 9101
    • 5432
    • 8080
    • 7077

Steps to Run:

  1. Clone the Github repo on your machine:
git clone https://github.com/ilyasben26/Realtime-Voting-Pipeline
  1. Run docker compose
docker-compose -up -d
  1. Wait for for docker to pull the images and run the containers.
  2. Generate voters and candidates data:
 docker exec -d pyspark python generate_data.py
  1. Inititate the voting procedure:
 docker exec -d pyspark python simulate_voting.py
  1. Run Spark to aggregrate the voting data in real-time:
 docker exec -d pyspark python spark_streaming.py
  1. Visit http://localhost:8501 to see the Streamlit dashboard get updated in real-time with the results of the election.

What I learned from this project:

  • Using Docker and Docker Compose to containerize data pipelines.
  • Basics of Apache Spark.
  • Working with Kafka topics, consumers and producers.
  • Using Streamlit to create interactive data dashboards.

Screenshot of the Dashboard

image

realtime-voting-pipeline's People

Contributors

ilyasben26 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.