Build your own Spotify: Killer Programming Project Idea in React Native and FastAPI
Build a killer music player in React Native, with a FastAPI backend

Search for a command to run...
Build a killer music player in React Native, with a FastAPI backend

No comments yet. Be the first to comment.
When âsharedâ components stop being shared

How Understanding Whatâs Under the Hood Makes You a Better Engineer
As developers, weâre often taught to write reusable, maintainable code. However, in our enthusiasm to âdo the right thing,â we sometimes over-engineer solutions, introducing abstractions too early or where theyâre not needed at all. This can lead to ...
Looking to craft a personalized dashboard that perfectly suits your data needs? You're in the right place! In this blog post, I'll guide you through the process of building a customizable dashboard using tremor and react-grid-layout. To initiate our ...

Insights and strategies for unlocking your tech career potential

This article will walk you through a programming project idea - a mobile music player based on React Native, with a FastAPI / SQLModel backend.
As a reference, I will use one of my own project, a music player that I built using the guidelines that will be detailed below: MonoBox.

Also, check out my other article, where I share the process of building such an application from scratch, my thoughts, struggles and how I solved the issues that arose along the way: Introducing MonoBox
Make sure to check out the MonoBox's GitHub repo above, and don't forget to drop a star đ

The purpose of this task is to create a self-hosted music player similar to Spotify - users will be able to run their own servers with their own songs. You will implement the server itself in Python, and then a mobile application using React Native.

Before we continue, big shoutout to Om Arya, for a beautiful design.
There are a lot of long videos here, itâs really okay to just watch some of them, get the general idea, and dive deeper when you need it. Donât get stuck in this phase!
Letâs get started!
If youâre not sure about library / tech in one of the milestones - come back to this section any time đ
Create an empty React Native application with TypeScript + ESLint + Prettier.
See this tutorial to get started: ESLint + Prettier + Typescript and React in 2022
NOTE: We are going to have both backend and app in the same repo. So the react native app should be in a mobile/ directory for example.
Next steps:
Design the following screen in React Native:

Notes:
Mock JSON data:
{
"songs": [
{
"name": "Believer",
"author": "Imagine Dragons",
"image": "https://upload.wikimedia.org/wikipedia/he/5/5c/Imagine-Dragons-Believer-art.jpg"
},
{
"name": "Shortwave",
"author": "Ryan Grigdry",
"image": "https://m.media-amazon.com/images/M/MV5BZWUxOWIzOTYtMjBhYy00MWFiLWEzYTgtMzRiOTExOTA1ZWQ4XkEyXkFqcGdeQXVyNjI2ODA4MDU@._V1_.jpg"
},
...
]
}
Now that you have a good sense of how to build React Native screens, let's create a plan of all your React components (both full pages and small components).
Donât forget:
You can easily plan & draw your design with excalidraw
After deciding on the components plan, build all screens from Figma in React Native. All screens should use mock data.
In this milestone, add a URL to an audio file in the JSON above, and make sure the âPlayâ button works. Also make sure to run the app in your phone to verify itâs smooth and looks good.

In the same GitHub repository, create the backend inside the backend/ directory, using the following tools:
Create a single resource called Song (with name, author, image, url) and make sure you can access http://localhost:1234/docs and create / read / update / list / delete songs.
The API Server should be a RESTful API (e.g GET /songs to get all songs).
Design all the API endpoints your app needs, for each one make sure you have:
Implement all the API endpoints and use them in the React Native app.
The server should have a songs/ directory that contains all the songs of the user. See the eye3d library (+ example) on how to get the song name, artist, image etc from a audio file.
The server should also expose a /songs//download endpoint that will actually stream the audio file - this can be used in the React Native app to play this audio. See StreamingResponse in FastAPI docs.
The entire application should be very easy to use. It should be very easy to spin up your own music server and it should be clear how to do this from the readme. For example:
pip install mymusicserver
mymusicserver run my-songs/
This should run the FastAPI server and then the app in the browser, using something like react-native-web.
That's all, you guys! All that's left for you is to publish your project wherever you'd like!
Here's a little advice from me: give your project a catchy name and use it for publication.
I would love to know what you think and what you have to say, so don't hesitate to leave a comment (and of course star MonoBox on GitHub).
