How I Built My Project ‘Rythmize’
By: Malek Salem
Tags: Heroku, Backend, Software Engineering, Flask, Web Development

Introduction

Rymthize is a web based application that we chose to build as an end-of-foundations project after being students for 1 year at Holberton School. So for this project we decided to solve an issues that have always faced me and my team and probably faced you.

When it comes to switching from a music streaming platform to another one, there is a very hard and frustrating operation you likely end up doing every time, which is transferring your music data and your favorite songs/playlists especially when you have a lot of songs and that can get quite tedious. So that’s what our application solves, with a friendly simple to use interface you can move your tracks and playlist to any streaming platform you want.

Before getting further into the project, let me introduce myself and my team!

We were a team of three, Seif Jelidi responsible for front-end engineering , Mohamed Dali Souissi responsible for project management, and there was me in charge of back-end engineering and API integration.

Accomplishments

Infrastructure

Data flow diagram:

Data model diagram:

Technologies

For the Front-end we chose to use HTML, CSS and JavaScript along with AngularJS as framework. we designed our pages using Figma, essentially because it’s free and online .

For the server-side we used Python as our programming language along with Flask as a web framework and PostgreSQL as a database .

Why Flask over Django ?. Flask is relatively lightweight, 2.5x smaller than Django in terms of amount of code and we have more control over our application.

Features Implemented

Feature: Authentication to our application

Feature: user can connect to his spotify account

Feature: a refresh token system that keeps the user connected to his Spotify account

Feature: user can see his playlist

Feature: user can see tracks that are inside playlist

Feature: user can move playlist or tracks to another playlist

Feature: user can create new playlist

Things took longer than expected, that’s why we didn’t complete all the feature. For now our app supports only Spotify .

Future Features

Transfer songs from youtube to spotify

Transfer songs from Spotify to Youtube

Downloading music from Spotify

Creating Release radar / Discover weekly playlists before they disappear

Converting YouTube Music to MP3

Technical challenges

First and hardest challenge was thinking about the idea itself, especially from back-end perspective. I had to figure out a way to interact with the third party api like spotify and at the same time keep the user updated, by that i mean token and refresh token,So i ended up building a spotify client that checks for tokens and if token expires then it will request a new one and update the user in database also if user have no token i will generate an authorization link, here is a code snippet.

Also building the REST-API and authentication system was a little bit of pain, i ended up learning a lot of new things and concepts like flask factory and how properly structure a project. Also in order to secure our application we used extensions like flask-praetorian, password hashing, cryptography, email validation which requires a lot of documentations reading in a very short time. Setting up GitHub Actions for continuous integration also was a little bit confusing.

Linking back-end and front-end also was challenging especially when we have only 10 hours left before the presentation, we faced a lot of bugs both in back-end and front-end, we had to fix them really quick in order to complete the project. Also deadline and time management are the big two non-technical challenges, it’s a very stressful experience when you have short deadlines and a lot of tasks but also a lot of things to learn first in order to complete those tasks, stress management and time management were the helper functions for us :) .

Things learned

In summary, I would say this project was a really great learning experience. During the development of this project, i ended up researching and learning about object oriented design (OOD) and design patterns.

For example:

In Factory pattern, we create object without exposing the creation logic to the client and refer to newly created object using a common interface mainly by calling a factory method instead of calling a constructor.

In Strategy pattern allows grouping related algorithms under an abstraction, which allows switching out one algorithm or policy for another without modifying the client.

My time and working hours wasn’t well managed, So if there were some things i could’ve done differently… it would’ve been trying to manage my time and put a clearer plan.

As an engineer I’ve learned how powerful and capable i am and i think my future engineering path will be in web-stack especially back-end stuff.

I found out that flask is a strong and capable framework, i always loved Django over flask but after this project i think i changed my mind.

Me ?

20 yo software engineering student, Self-motivated and hardworking seeking for an opportunity to work in a challenging environment to prove my skills and utilize my knowledge.