Inspiration
In a fast-paced world where days blend into weeks and mental well-being is increasingly vital, we all crave moments of relaxation. Sometimes we just need to sit back and reminisce on our most cherished moments, and RetroTune can make that happen! It uses your Instagram feed to create personalized playlists for distinct periods of your life. Utilizing music's natural ability to boost mood, RetroTune provides a simple yet powerful way for anyone to reconnect with their cherished memories.
What it does
Our web application determines different "eras" in your life using your Instagram feed and creates playlists based off the vibe.
How we built it
Our project uses your Instagram handle as an input and grabs posts from different "eras" of your life (based on the date the images were posted). We use Google Gemini API to analyze these posts and read their vibes, and based on that we use Spotify API create playlists for you!
Our app is built entirely in Python, using Reflex to link the frontend and backend.
The backend uses the instaloader library to access the Instagram API and grab images from each user. The posts are processed based on the date they were posted in order to categorize them into different eras from each users life. After downloading the images, our program uploads them to the Google Gemini API in order to analyze the vibes of each image and retrieve songs that match those vibes (it is outputted to a JSON file). We use a structured prompt and delete the images from Gemini right after. We then used Spotify API to query Spotify for the songs listed by Google Gemini and build the playlists. We had to manage Spotify tokens and create Spotify Developer accounts.
The frontend entirely uses Reflex. We used the Reflex components to build up all the UI.
Challenges we ran into
Most of the technologies we used while creating this project were entirely new to us. Because of that, there was a steep learning curve as we started developing.
On the backend, there was an issue with venv because pip had been installed in the wrong folder. This meant that spotipy didn't run on one of our computers, and was a very frustrating issue until we were able to debug it. It was also challenging to parse and organize image files from carousel posts (posts with multiple slides) to make sure we weren't over-downloading.
The frontend was also challenging as no one our team had experience in frontend and we used an unfamiliar technology (Reflex). We ran into issues getting the playlist page to properly update—fixing it required reorganizing variables into the State class and annotating our data structures. We had to learn how to build and deploy a frontend in Reflex and we had a hard time organizing our components, putting them in the right place, and making them look how we wanted.
Accomplishments that we're proud of
The process of grabbing images from Instagram's API, sending those images to Gemini and getting a response, and then using that response to create a playlist with Spotify's API is streamlined and works very smoothly. Scraping data from the web and using APIs is always intimidating, so we are proud that this part works well.
We are also very proud of the frontend. It was difficult to figure out how to align components, make them look how we wanted, and make sure pages were updating properly. We are backend engineers using a completely new technology, and the frontend is functional and visually appealing.
What we learned
We learned how to use Reflex which was super useful because we didn't have to worry about how to create a web app and link a frontend and backend (especially with our limited javascript skills). We also got a lot better at reading through documentation. Reflex, Gemini, and instaloader were all new technologies to us and in order to code effectively—especially in a limited timeframe—we had to be able to effectively use the docs. We also learned to ask for help. The Reflex table was full of super helpful people and they helped us debug our program multiple times.
What's next for RetroTune
RetroTune is just getting started. We have a bunch of ideas for things to add that we weren't quite able to add in this timeframe. First: using the Facebook developer API to streamline the image downloading process and allow private users to authenticate RetroTune and create playlists based off their images. Using the login system we already have, it would be cool to gameify the playlist system, awarding badges for the amount of playlists generated or listened to. There could also be a social aspect, allowing users to connect with each other or match based on similar playlist vibes. With RetroTune, the world is our oyster!
Log in or sign up for Devpost to join the conversation.