Skip to content

Spotify clone built with Next.js, TypeScript, and Tailwind CSS. Uses the Spotify API to fetch data and Spotify Web Playback SDK for playback.

Notifications You must be signed in to change notification settings

annawng/almost-spotify

Repository files navigation

Almost Spotify

Almost Spotify is a responsive Spotify clone built with Next.js, TypeScript, and Tailwind CSS. It uses NextAuth for authentication, the Spotify API to fetch data about tracks, albums, playlists, and the currrent user, and the Spotify Web Playback SDK to control playback in the application. Users are required to log in with a Spotify Premium account.

Supported features:

  • Browsing liked songs, recently played, saved albums, and playlists (each limited to 50)
  • Searching for tracks, playlists, and albums
  • Playing tracks from albums, playlists, or search results
  • Controlling playback (play/pause, skip forward/back, toggle shuffle/loop, adjust volume)

Not supported:

  • Liking tracks
  • Saving albums
  • Creating or saving playlists
  • Searching for users or artists
  • Viewing user or artist profiles
  • Displaying queue (API endpoint doesn't return the correct queue)
  • Anything relating to podcasts

Because this application is in development mode and would require all users to be added to an allowlist, it is not deployed publicly.

Setup

Installation

# Clone the repository
git clone https://github.com/annawng/almost-spotify.git

# Install dependencies
npm install

Environment Variables

  1. Log into the Spotify Developer Dashboard using your Spotify account.
  2. Create an app and locate the Client ID and Client Secret.
  3. At the root of the project, create a file named .env.local.
  4. Add the two values to the file as shown below.
CLIENT_ID=<your-client-id>
CLIENT_SECRET=<your-client-secret>
  1. Generate a secure random string with the following command. This will be your NextAuth.js secret.
openssl rand -base64 32
  1. Add this value to .env.local as shown below.
NEXTAUTH_SECRET=<your-random-string>

Usage

# Start the development server
npm run dev

Demo

Login

almost-spotify-login

Home

almost-spotify-home

Search & Playback Controls

almost-spotify-search

Library

almost-spotify-library

Playlists

almost-spotify-playlists

Responsive Design

almost-spotify-responsive

About

Spotify clone built with Next.js, TypeScript, and Tailwind CSS. Uses the Spotify API to fetch data and Spotify Web Playback SDK for playback.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages