The Rhythm Flow app (Demo) is a music analytics platform that integrates the Spotify API with Snowflake, Airflow, Kafka, PySpark, Streamlit, and Tableau. It collects and processes user data in real-time, leveraging Kafka for streaming and Airflow for orchestration. Data is stored and analyzed using Snowflake, and the results are visualized in a Streamlit web interface. This app provides insights into user listening habits, playlists, and top tracks, offering a seamless experience to explore and analyze music data dynamically.
- Chart Surge: Get real-time top 10 global songs by popularity.
- TuneMender: Get recommendation of 5 songs based on your favorite songs.
- AI Harmonizer: AI-generated personalized playlists using Phi-3.5-Instruct model.
- LyricScope: Generate summary of song from on its lyrics.
- Music Insights: A Tableau Dashboard for visalizing the trends of albums, artists, and tracks.
.Spotify/
|-- .streamlit/
| |-- config.toml # Streamlit configuration file
|
|-- airflow/
| |-- config/
| | | airflow.cfg # Airflow configuration file
| |-- dags/
| | | spotify_dag.py # Airflow DAG file
| | | spotify_kafka_producer.py # Kafka Producer File
| | | spotify_kafka_consumer.py # Kafka Consumer File
| |-- logs/ # Airflow logs folder
| |-- plugins/ # Airflow plugins folder
| |-- .env # Airflow environment variable file
| |-- docker-compose.yaml # Airflow docker-compose file
| |-- Dockerfile # Airflow DockerFile
|
|-- app.py # Main application code
|-- requirements.txt # Python dependencies
|-- .env # Environment variables (not pushed to GitHub)
|-- .gitignore # Files and folders to exclude from version control
|-- README.md # Project documentation (this file)
|-- LICENSE # Project's MIT License
-
Clone this repository:
git clone <repository_url> cd final
-
Build the Docker Image:
docker-compose -d --build
-
Set up your environment variables:
- Create a
.envfile in the root directory. - Add the following keys:
SNOWFLAKE_USER={user_id} SNOWFLAKE_PASSWORD={user_password} SNOWFLAKE_ACCOUNT={account_id} SNOWFLAKE_DATABASE={database_name} SNOWFLAKE_SCHEMA={table_name} HF_KEY= {your_huggingface_api_key} SPOTIFY_CLIENT_ID={your_spotify_client_id} SPOTIFY_CLIENT_SECRET={your_spotify_client_secret}
- Create a
- Run the Docker container.
- Open the app in your browser at http://localhost:8080.
- Click on the DAGs in Airflow UI, and trigger the DAGs.
- Once the data pipeline is executed and the data is refreshed, run the
streamlitapplication.
This project uses the following APIs:
-
Spotify API: To fetch tracks, artists, and albums details.
-
Hugging Face API: For text generation using AI models.
Make sure to obtain API keys for all three services and configure them in your.envfile.
All dependencies are listed in the requirements.txt file.
streamlit: For building the web apprequests: For making API callsopenai: For AI model integrationspython-dotenv: For managing environment variablesapache-airflow-providers-apache-kafka: Provider for Airflow to use Kafkaapache-airflow-providers-snowflake: Provider for Airflow to use Snowflake
- Add more tables
- Create production ready tables - RAW tables, WIP tables, PUB tables on AWS or Azure to load the data as it is and tranform it prior to pushing to Final tables in Snowflake.
- Use Spark to perform data transformation.
- Create another table for reporting.
- Enhance UI with dynamic visualizations.
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to contribute by submitting issues or pull requests!

