Overview • Architecture • Features Deep-Dive • Tech Stack • Installation • License
A premium, feature-rich music streaming web application built with Django and Tailwind CSS.
SoulPlayer is a modern, high-performance web-based music streaming platform designed with a focus on premium aesthetics and intelligent features. Developed primarily with the Django framework and styled rapidly using Tailwind CSS, SoulPlayer brings desktop-class media streaming experiences to the browser.
Beyond standard playback functionality, the platform differentiates itself with advanced features like Natural Language Voice Search (NLP) and Dynamic Background Play Tracking.
SoulPlayer follows a classic Model-View-Template (MVT) architecture utilized by Django, augmented with vanilla JavaScript for asynchronous frontend operations (AJAX) to maintain a seamless, single-page-application feel during media playback.
Click to expand Architectural Flow
- Client Layer (The Browser): Renders the UI using HTML rendered by Django Templates and Tailwind CSS for styling. Global event listeners capture media playback actions.
- Asynchronous Handlers (Vanilla JS
fetchAPIs): When a user plays a song, the globalaudioelement begins streaming the buffer. Simultaneously, an invisible/record_play/<id>/POST request is fired to the backend, complete with explicit CSRF token verification, to track user listening history. - Routing Layer (
music/urls.py): Django’s URL dispatcher routes incoming REST-like endpoints and standard GET requests to the appropriate controller views. - Controller Layer (
music/views.py): Handles the core business logic.- Queries the database via the Django ORM.
- Processes Natural Language queries through the
spaCyNLP engine. - Makes external calls to the Google/YouTube Data API for podcast ingestion.
- Data Layer (
models.py& SQLite Database): Stores the relational mapping of Users, UserProfiles (1-to-1 User mapping), Artists, Songs, and Playlists (Many-to-Many relationships mapping songs to playlists and users).
Instead of forcing users to explicitly filter by artist or genre, SoulPlayer integrates spaCy, an industry-level Natural Language Processing library.
- How it works: When a user searches "play some romantic arijit singh songs", the NLP pipeline intercepts the query. It categorizes grammatical tokens, actively stripping out stop words ("some", "songs", "play") to isolate target keywords. It then routes the request intelligently—if it finds an exact song match, it auto-plays it. If it finds an artist match, it redirects to the Artist Portfolio.
The project features a sleek, global bottom-bar player and a dedicated Full-Screen View (/play_song/<id>).
- Design: Utilizes modern "Glassmorphism" paradigms (blur backdrops, semi-transparent gradients, glowing accents).
- DOM APIs: Interacts deeply with the HTML5
<audio>API to calculate track duration, current timestamp precision, and smooth slider tracking.
We utilize Django Signals (post_save) to automatically attach an extended UserProfile model to every new user registration.
- History Tracking: JavaScript asynchronous
fetchrequests bypass the need for full page reloads. As users listen to tracks, theirplayed_songsMany-To-Many relationship is updated silently in the background. - Dashboard: Users have a dedicated customizable Profile page to view their listening history and favorite artist collections.
SoulPlayer isn't just limited to local database music. It uses the requests library to interface with the YouTube Data API v3. It dynamically queries YouTube for high-quality music podcasts, parses the incoming JSON, and renders fully playable media cards directly within the SoulPlayer UI.
- Framework: Django 5.x (Python)
- Database: SQLite (Development & Free Tier Production ready)
- NLP Engine: spaCy (
en_core_web_sm) - API Interactions: Python
requestsmodule
- Templating: Django Template Engine
- Styling: Tailwind CSS (via CDN)
- Interactivity: Vanilla JS (ES6)
- Icons: FontAwesome 6
To run SoulPlayer locally on your machine, follow these steps:
git clone https://github.com/rudra00434/SoulPlayer.git
cd SoulPlayer
cd SPOTIFYpython -m venv venv
# For Windows:
venv\Scripts\activate
# For macOS/Linux:
source venv/bin/activatepip install -r requirements.txtpython -m spacy download en_core_web_smCreate a file named .env in the same directory as manage.py.
# Required for Podcast fetching module:
YOUTUBE_API_KEY=your_google_api_key_herepython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverOpen your browser and navigate to http://127.0.0.1:8000/. You can log into the admin panel at http://127.0.0.1:8000/admin/ to add Artists, Songs, and Categories manually.
SoulPlayer utilizes a custom deployment flow designed specifically for PaaS providers like Render.com.
The application uses an automated build.sh script to handle production environments. Instead of manually SSHing into the server to install dependencies, the script:
- Installs Python packages via
pip. - Downloads the heavy
spaCyNLP model binaries to the production server. - Automatically maps static assets via
collectstaticfor theWhitenoisemiddleware to serve. - Executes zero-downtime Django database migrations via
migrate.
Infrastructure Details:
- WSGI Server: Gunicorn
- Static File Serving: Whitenoise (Configured in
settings.py)
⚠️ Limitation Warning: If utilizing ephemeral free-tier instances (like Render Free Web Services), local media assets (User uploaded MP3s and JPGs located in/media/) will be purged upon container sleep. A permanent production scale-up requires migrating theDEFAULT_FILE_STORAGEto an AWS S3 bucket or Cloudinary.
Contributions, issues, and feature requests are highly encouraged! If you have suggestions for improving the UI, optimizing database queries, or adding new APIs, feel free to check the issues page or submit a Pull Request.
This project is open-source and available under the MIT License.
