A mini data engineering pipeline that streams FX rates via Kafka, stores transactions in PostgreSQL, converts them to USD, and visualizes insights with Streamlit.
Script | Description |
---|---|
1_setup_postgres_transactions.py |
Generates and inserts transaction data into PostgreSQL using API FX rates |
2_fx_rate_producer.py |
Simulates FX rate streaming via Kafka |
3_fx_rate_consumer.py |
Listens to Kafka and saves FX rates to local JSON |
5_convert_fx_live.py |
Converts transaction amounts to USD using latest FX from JSON |
4_streamlit_dashboard.py |
Displays real-time revenue insights in Streamlit using transactions_converted table |
./run_all.sh
pip install -r requirements.txt
kafka-topics --list --bootstrap-server localhost:9092
python 1_setup_postgres_transactions.py
python 2_fx_rate_producer.py
# Another terminal !!
python 3_fx_rate_consumer.py
python 4_convert_fx_live.py
streamlit run 5_streamlit_dashboard.py
revenue_dashboard=# \dt
List of relations
Schema | Name | Type | Owner
--------+------------------------+-------+-----------------
public | transactions | table | kritsadakruapat
public | transactions_converted | table | kritsadakruapat