Spotistics is a modern React application that allows users to analyze their Spotify music taste, view their profile, and discover insights into their listening habits. It features a secure, premium user interface and adheres to the latest Spotify security standards.
- Secure Authentication: Implements Authorization Code Flow with PKCE (Proof Key for Code Exchange), replacing the deprecated Implicit Grant flow.
- Compliance: Fully compliant with Spotify's 2025 security requirements (No
localhostredirect URIs, secure token exchange). - User Profile: Displays detailed user information including profile picture, followers, plan type (Premium/Free), and country.
- Premium UI: Uses a glassmorphism-inspired design with responsive layouts using Bootstrap.
- Auto-Redirect: Smart routing that automatically redirects logged-in users to their dashboard.
- Error Handling: Robust error handling for network issues, missing configuration, and authentication failures.
- Node.js (v14 or higher)
- A Spotify Developer Account
-
Clone the repository
git clone https://github.com/yourusername/spotistics.git cd spotistics -
Install Dependencies
npm install
-
Configure Environment Variables Create a
.envfile in the root directory based on.env.example:cp .env.example .env
Update
.envwith your Spotify Client ID:REACT_APP_CLIENT_ID=your_spotify_client_id_here REACT_APP_REDIRECT_URI=http://127.0.0.1:3000
-
Spotify Dashboard Setup
- Go to your Spotify Developer Dashboard.
- Create an App or select an existing one.
- Go to Settings -> Edit.
- Add
http://127.0.0.1:3000to the Redirect URIs whitelist. - Click Save.
Start the development server:
npm startOpen http://127.0.0.1:3000 in your browser.
Note: Do not use
localhost:3000as the Redirect URI in your browser, as Spotify specifically requires the explicit loopback IP127.0.0.1for security.
- Frontend: React.js (Create React App), React Router v6
- Styling: Bootstrap 5, CSS3 Custom Properties
- Authentication: OAuth 2.0 with PKCE via
spotifyAuth.jshelper module. - State Management: React Hooks (
useState,useEffect,useCallback)
- 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
Distributed under the MIT License. See LICENSE for more information.