purple-music-app

🎡 Ultimate Purple Music Web-App

A premium Progressive Web App music player with Royal Purple Glassmorphism aesthetic.

✨ Features

πŸš€ Quick Start

1. Install dependencies

npm install

2. Run development server

npm run dev

Open http://localhost:3000

3. Build for production

npm run build
npm start

πŸ”‘ YouTube API Key (Optional)

The app works with demo songs out of the box. To enable live YouTube search:

  1. Go to Google Cloud Console
  2. Create a project β†’ Enable YouTube Data API v3
  3. Create an API key (restrict to your domain for security)
  4. In the app: Settings β†’ YouTube API Key β†’ paste your key

πŸ“ Project Structure

purple-music-app/
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ _app.tsx          # App wrapper, Head meta
β”‚   β”œβ”€β”€ _document.tsx     # HTML document, fonts
β”‚   β”œβ”€β”€ index.tsx         # Home β€” trending songs
β”‚   β”œβ”€β”€ search.tsx        # Search with categories
β”‚   β”œβ”€β”€ library.tsx       # Liked, Recent, Playlists
β”‚   β”œβ”€β”€ settings.tsx      # All settings + EQ
β”‚   └── song/[id].tsx     # Shareable song page
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Layout.tsx        # App shell with sidebar
β”‚   β”œβ”€β”€ Sidebar.tsx       # Navigation sidebar
β”‚   β”œβ”€β”€ MiniPlayer.tsx    # Bottom player + fullscreen
β”‚   β”œβ”€β”€ SongCard.tsx      # Song card (grid + row)
β”‚   β”œβ”€β”€ GreetingModal.tsx # Welcome screen with voice
β”‚   └── Equalizer.tsx     # EQ UI component
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useYouTubeSearch.ts  # YouTube API + demo songs
β”‚   β”œβ”€β”€ useAudioEngine.ts    # Web Audio API + Media Session
β”‚   β”œβ”€β”€ useLyrics.ts         # LRC parser + sync
β”‚   └── useTranslation.ts    # i18n hook
β”œβ”€β”€ store/
β”‚   β”œβ”€β”€ musicStore.ts     # Zustand state (player, settings, library)
β”‚   └── translations.ts   # EN + ID translations
β”œβ”€β”€ styles/
β”‚   └── globals.css       # Tailwind + custom CSS
└── public/
    β”œβ”€β”€ manifest.json     # PWA manifest
    └── icons/            # App icons

🎧 Adding Songs with Lyrics

Songs use this JSON structure:

{
  "id": "unique-id",
  "title": "Song Title",
  "artist": "Artist Name",
  "youtubeId": "YouTube video ID",
  "thumbnail": "https://i.ytimg.com/vi/VIDEO_ID/mqdefault.jpg",
  "lyrics": "[00:00.00] First line\n[00:05.00] Second line\n..."
}

πŸ›  Tech Stack

Tool Purpose
Next.js 14 React framework + routing
Tailwind CSS Utility-first styling
Framer Motion Animations
Zustand State management
next-pwa PWA / Service Worker
Web Audio API Equalizer + audio processing
Media Session API Lock screen controls
YouTube Data API v3 Music search

🌐 PWA Installation

On Android: tap β€œAdd to Home Screen” in Chrome menu On Desktop: click the install icon in the address bar

πŸ“„ License

MIT