This repository contains the code for a realtime election voting system. The system is built using Python, Kafka, Spark Streaming, Postgres, Streamlit, and Docker Compose for orchestration.
- Description: Main Python script responsible for:
- Creating required tables on Postgres (candidates, voters, and votes).
- Creating the Kafka topic.
- Copying the votes table to the Kafka topic.
- Producing data to the
voter_topics
on Kafka.
- Description: Python script containing logic for:
- Consuming votes from the Kafka topic (
voter_topics
). - Generating voting data.
- Producing data to the
vote_topics
on Kafka.
- Consuming votes from the Kafka topic (
- Description: Python script containing logic for:
- Consuming votes from the Kafka topic (
vote_topics
). - Enriching data from Postgres.
- Aggregating the votes.
- Producing data to the (
votes_per_candidate
,turnout_by_location
) on Kafka.
- Consuming votes from the Kafka topic (
- Description: Python script containing logic for:
- Consuming aggregated voting data from the Kafka topic.
- Displaying the voting data in real-time using Streamlit.
- Python: The primary programming language for scripting.
- Kafka: Messaging system for data streaming.
- Spark Streaming: Framework for real-time data processing.
- Postgres: Relational database for storing candidates, voters, and votes data.
- Streamlit: Web app framework for displaying real-time voting data.
- Docker Compose: Orchestration tool for containerized applications.