Ordify is a powerful web application built with Angular that allows you to meticulously organize your Spotify playlists. Connect your Spotify account, select a playlist, and apply multi-level sorting criteria to reorder your tracks exactly the way you want.
- Multi-Level Sorting: Organize tracks using a series of nested criteria, such as sorting by Artist, then Album, then Track Name.
- Flexible Criteria: Sort by Artist, Album, Track Name, Release Date, Date Added, Duration, or even Artist Genre.
- Customizable Order: Set ascending or descending direction for each sorting level.
- Live Preview: Instantly see how your playlist will be reordered before applying any permanent changes.
- Safe & Secure: Uses Spotify's official OAuth 2.0 PKCE flow for authentication. Your data is processed in your browser and is not stored on any server.
- Handles Large Playlists: Efficiently fetches and processes all tracks in your playlist, regardless of size, by handling API pagination automatically.
- Modern UI: A clean, responsive, and intuitive interface built with Angular and Angular Material.
Follow these instructions to set up and run the project locally.
- Node.js (version 18 or higher)
- A Spotify account
-
Create a Spotify Developer App
- Navigate to the Spotify Developer Dashboard and log in.
- Click "Create app".
- Give your app a name (e.g., "My Playlist Sorter") and a description.
- Set the Redirect URI to
http://127.0.0.1:4200/callback. This must match exactly. - Enable the Web API checkbox
- Agree to the terms and save the app.
- Go to your new app's Settings and copy the Client ID.
-
Configure the Application
- Clone this repository:
git clone https://github.com/xgreymx/ordify.git cd ordify - Open the file
src/environments/environment.ts. - Replace the placeholder
YOUR_SPOTIFY_CLIENT_IDwith the Client ID you copied from the Spotify Developer Dashboard.// src/environments/environment.ts export const environment = { production: false, spotify: { clientId: 'your-actual-client-id-here', // <-- PASTE YOUR ID HERE redirectUri: 'http://127.0.0.1:4200/callback', scopes: [ 'playlist-read-private', 'playlist-read-collaborative', 'playlist-modify-public', 'playlist-modify-private', 'user-library-read' ] } };
- Clone this repository:
-
Install Dependencies and Run
- Install the required npm packages:
npm install
- Start the development server:
npm start
- Open your browser and go to
http://127.0.0.1:4200.
- Install the required npm packages:
- Click "Login with Spotify" and authorize the application to access your account.
- You will be redirected to a list of your playlists. Click on any playlist you own to open the sorter.
- In the sorter view, configure your sorting criteria. You can add multiple levels for more granular control (e.g., Artist -> Album -> Track).
- Click "Preview Sort" to see the new order in the track table below.
- If you're happy with the preview, click "Apply to Spotify". The application will update the track order in your actual Spotify playlist.
Ordify interacts directly with the Spotify Web API from your browser.
- Authentication: It uses the secure OAuth 2.0 Authorization Code Flow with PKCE to obtain an access token from Spotify.
- Data Fetching: The app calls the Spotify API to fetch your playlists and the full track list for a selected playlist. To enable sorting by genre, it also fetches details for all unique artists in the playlist.
- Client-Side Sorting: All sorting logic is performed in your browser using the criteria you define. This means your data remains private and is processed quickly.
- Applying Changes: When you apply a sort, the app sends a request to Spotify's API to replace the tracks in your playlist with a new list of track URIs in the desired order.
- First criteria: Artist (Ascending)
- Second criteria: Album (Ascending)
- Third criteria: Track Name (Ascending)
This will organize your playlist by artist names alphabetically, then by album names within each artist, then by track names within each album.
- First criteria: Release Date (Descending)
- Second criteria: Artist (Ascending)
This will show newest releases first, then organize by artist within each time period.
- Make sure you've replaced
YOUR_SPOTIFY_CLIENT_IDinsrc/environments/environment.tswith your actual Client ID
- Verify that
http://127.0.0.1:4200/callbackis added to your Spotify app's Redirect URIs in the Spotify Developer Dashboard
- Clear your browser's local storage and try logging in again
- Make sure your Spotify app has the correct scopes enabled
- Framework: Angular
- UI Components: Angular Material
- State Management/Reactivity: RxJS
- API Interaction: Spotify Web API
This project is licensed under the Apache 2.0 License. See the LICENSE file for more information.
