During quarantine, I started exploring tons of new music and listening. I wanted to share this music with my friends, and my friends wanted to share their music with me. However, my friends all used different streaming platforms, making it difficult to share links across platforms.
What it does
Musiquity makes it fast and easy to share music across platforms. Simply input a text query or a link into the text box and receive results instantly across many different services. Clicking on a search result copies a link to the target streaming service, making it easy to share music.
How I built it
First, my group made a detailed plan specifying our goal, requirements, tools, targets, and backup plan, breaking down hard problems into easier problems and establishing a concrete sequence. Then, I began work on the backend. The backend is a Python Flask app which uses queries external API's to get data about a query. In general, the process is:
- Receive a user query via a get request with a url parameter
- If the query is plain text, make it into a Query object. If the query is a link, validate it and send it to the data retrieval functions to get universal metadata to use for searching other api's. Then make this metadata into a Query object.
- The Query object is passed to search functions for each streaming service to find the item on other streaming platforms.
- The resulting Media object is cleaned. For example, if it came from youtube we use nltk to interpret the title because youtube's data is inherently less oriented towards musical data.
- The Media objects are structured into lists and dictionaries
- The resulting dictionary is converted to JSON and returned to the client
The backend is designed to be modular, so it's easy to support new streaming services later.
The backend is hosted on Heroku using the python build pack.
Challenges I ran into
We ran into many challenges:
- I had difficulty deploying the application to Heroku because of Heroku's unique procfile structure. I resolved this by reading through the documentation in depth and ended up learning a great deal about hosting with Heroku.
Accomplishments that I'm proud of
- I'm very proud of the structure of the backend. I like that the search components are modular.
- I am proud of the object-oriented design of the backend, which makes the code more readable and extensible.
- I am proud of the overall completeness of the backend with docstrings and descriptive exceptions.
- I am proud of the way in which the API credentials are stored in environment variables for security and portability ## What I learned
- We learned how to communicate specifications for functions effectively as a group
- We learned how to communicate between a frontend and a backend using JSON and http requests
- We learned how to search for information and effectively read documentation
- We learned how to use api keys
- I learned how to use object-oriented design with a web app ## What's next for Musiquity
- We plan to add more streaming services
- We plan to change the user interface to be more modern, responsive, and clean
- We plan to check for region availability when returning results