Melodix is a full-stack music streaming and playlist management application built for discovering tracks, organizing personal libraries, and playing music through a custom backend streaming pipeline.
The project combines a React frontend with an Express and MongoDB backend, supports account-based access, integrates YouTube and YouTube Music discovery flows, and streams audio through a server-side conversion pipeline using yt-dlp, ytdl-core, and ffmpeg.
Melodix is designed as a personal streaming experience with a modern dashboard-style interface and a playlist-first workflow. Users can authenticate, create playlists manually or from YouTube playlist links, search for songs, add tracks to custom playlists, and play music directly inside the app.
On the backend, Melodix handles authentication, playlist persistence, track metadata, YouTube-powered search, and on-demand audio streaming. On the frontend, it provides a responsive music player, playlist library, search views, protected routes, and playback controls similar to a polished streaming product.
- Secure user authentication with JWT-based sessions
- Protected dashboard experience for signed-in users
- Personal playlist creation and management
- Import playlists from public YouTube playlist URLs
- Song search powered by YouTube Data API
- Extended discovery for playlists, albums, and artists via YouTube Music
- On-demand server-side audio streaming pipeline
- Queue controls, seek, shuffle, repeat, and volume management
- Responsive music player UI built for desktop and mobile
- MongoDB persistence for users and playlists
- React 18
- Vite
- React Router
- Tailwind CSS
- Lucide React
- Node.js
- Express 5
- MongoDB with Mongoose
- JWT authentication
- Axios
youtubei.js@distube/ytdl-coreyt-dlpffmpeg/ffmpeg-static
The repository is split into two main applications:
frontend/contains the React client, routes, pages, contexts, services, and player UIbackend/contains the API, controllers, models, middleware, YouTube integrations, and streaming pipeline
High-level flow:
- Users authenticate through the backend API.
- The frontend stores auth state and protects dashboard access.
- Users search for tracks or import playlists from YouTube.
- Playlist and song data are stored in MongoDB.
- Audio is streamed from the backend through a YouTube-to-MP3 pipeline.
Melodix/
|-- backend/
| |-- config/
| |-- controllers/
| |-- middleware/
| |-- models/
| |-- routes/
| |-- utils/
| `-- index.js
|-- frontend/
| |-- public/
| |-- src/
| | |-- assets/
| | |-- components/
| | |-- context/
| | |-- pages/
| | |-- services/
| | |-- styles/
| | `-- utils/
| `-- vite.config.js
|-- package.json
`-- README.md
The backend currently exposes routes for:
authfor registration and loginplaylistsfor playlist and song managementyoutubefor search and discoverystreamfor audio streamingtestfor testing utilities
Make sure the following are installed before running the project locally:
- Node.js 18 or newer
- npm
- MongoDB database
ffmpegyt-dlp
git clone https://github.com/Sanjeeb-J/Melodix.git
cd Melodixcd backend
npm installcd ../frontend
npm installCreate backend/.env and configure the values your server needs:
PORT=8080
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
YOUTUBE_API_KEY=your_youtube_data_api_key
YOUTUBE_COOKIE=optional_cookie_value
FFMPEG_PATH=optional_custom_ffmpeg_pathNotes:
MONGO_URIis required for database connectivityJWT_SECRETis required for authenticationYOUTUBE_API_KEYis required for YouTube search and playlist importYOUTUBE_COOKIEcan help with streaming reliability for some YouTube requestsFFMPEG_PATHis optional ifffmpegis already available on your machine
Create frontend/.env and point the app to your backend API:
VITE_API_URL=http://localhost:8080/apiStart the backend:
cd backend
npm startStart the frontend in a separate terminal:
cd frontend
npm run devBy default, the frontend will run on Vite's local development server and connect to the backend through VITE_API_URL.
npm startStarts the backend from the repository root.
npm run dev
npm run build
npm run preview
npm run lintnpm start- The frontend includes Vercel configuration and is suitable for deployment as a static React app
- The backend is structured as a standalone Node.js API service
- The backend repository includes deployment-related files such as
leapcell.yamlandnixpacks.toml - Production streaming requires
ffmpegand reliable access toyt-dlpor the fallback streaming flow
Melodix is more than a simple playlist CRUD app. It combines discovery, import, playback, and streaming infrastructure into one product-oriented codebase. That makes it a strong full-stack project for demonstrating frontend experience design, backend API development, third-party integration, media handling, and authenticated user flows.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Created by Sanjeeb J