Skip to content

BoziaO/AetherPulseMusic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AetherPulse|Music

A modern, responsive music player powered by YouTube Music. Features local playlists, favorites, real-time synchronized lyrics, and a fully customizable glassmorphism UI. Optimized for both desktop and mobile experiences.

Overview

AetherPulse|Music is a fullstack React + Node.js application that streams music via YouTube Music's Innertube API. It offers a complete music discovery and playback experience with local playlist management, synced lyrics, keyboard-driven controls, and a theme system supporting light, dark, and custom color presets.

Key Features

  • Advanced Search: Find tracks, playlists, albums, and artists directly from YouTube Music with filter tabs and search history.
  • Dynamic Player: Full-featured playback with queue management, seeking, volume control, shuffle, and repeat modes (none / one / all).
  • Synchronized Lyrics: Real-time lyric sync via LRCLIB and YouTube Music, featuring karaoke-style highlighting, auto-scroll, and click-to-seek.
  • Local Playlists: Create, edit, and manage personal playlists stored locally in JSON.
  • YT Import: Import any YouTube Music playlist into your local library for offline-style editing.
  • Favorites & History: Track favorites and recently played songs via browser localStorage.
  • Customizable Themes: 7+ visual presets (Classic Dark, Light, Cyberpunk, Tokyo Night, AMOLED, etc.) plus custom accent colors and background overrides.
  • Keyboard Shortcuts:
    • / β€” Focus search
    • Space or K β€” Toggle play/pause
    • ArrowLeft / ArrowRight β€” Seek Β±10s (Shift + Arrow to change track)
    • ArrowUp / ArrowDown β€” Volume Β±5%
    • M β€” Mute/unmute
    • L β€” Toggle lyrics modal
    • Q β€” Toggle queue modal
  • Responsive Design: Mobile-first layout with collapsible sidebar, bottom player, and glassmorphism effects.
  • Google OAuth: Optional authentication for accessing your personal YouTube Music library.

Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      HTTP / REST      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      HTTPS      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React Client  β”‚ ◄──────────────────► β”‚  Express Server  β”‚ ◄─────────────► β”‚ YouTube Music   β”‚
β”‚   (Port 5000)   β”‚                      β”‚   (Port 3001)    β”‚                 β”‚  (Innertube)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                                        β”‚
        β”‚ localStorage                           β”‚ local JSON
        β–Ό                                        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  User Prefs,    β”‚                      β”‚  localPlaylists  β”‚
β”‚  Favorites,     β”‚                      β”‚     .json        β”‚
β”‚  Recent Plays   β”‚                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Frontend Architecture

The frontend is a Single Page Application (SPA) built with React 19 and React Router 7.

App.js
β”œβ”€β”€ LanguageProvider (Context)
β”œβ”€β”€ ThemeProvider    (Context)
└── BrowserRouter
    └── AppShell
        β”œβ”€β”€ Sidebar          (Navigation)
        β”œβ”€β”€ Header           (Search, Notifications, Auth)
        β”œβ”€β”€ Outlet           (Route-specific screen)
        β”‚   β”œβ”€β”€ MusicPage        (Home, Discover, Playlists, Artists, Albums)
        β”‚   β”œβ”€β”€ ArtistDetailPage
        β”‚   β”œβ”€β”€ AlbumDetailPage
        β”‚   β”œβ”€β”€ InsightsPage
        β”‚   └── SettingsPage
        β”œβ”€β”€ Player           (Fixed bottom playback bar)
        β”œβ”€β”€ QueueModal
        └── LyricsModal

State Management

  • Global UI State: ThemeContext (theme, colors, glass effects) and LanguageContext (i18n: EN / PL).
  • Global App State: AppShell centralizes player state (now playing, queue, favorites, recent plays) via React useState / useRef and exposes it to child routes through Outlet context.
  • Server State: useAuthSession and usePageData custom hooks handle async data fetching with loading/error states.
  • Persistence: localStorage stores theme preferences, player volume, favorites, recent plays, and search history.

Media Playback

  • Audio playback uses the YouTube IFrame API with a hidden player div.
  • The player communicates state changes (PLAYING, PAUSED, ENDED) back to React via callbacks.
  • The Media Session API integrates with OS-level media controls (play/pause, prev/next, seek).

Backend Architecture

The backend is a modular Express 5 application using factory-pattern routers.

server/index.js
β”œβ”€β”€ CORS & Session Middleware
β”œβ”€β”€ Content-Security-Policy Headers
β”œβ”€β”€ Router Mounting
β”‚   β”œβ”€β”€ /api/auth          β†’ createAuthRouter       (Google OAuth, sessions)
β”‚   β”œβ”€β”€ /api/ytmusic       β†’ createYtmusicRouter    (Search, artists, albums, playlists)
β”‚   β”œβ”€β”€ /api/local/        β†’ createLocalPlaylistsRouter (JSON-based local playlists)
β”‚   β”œβ”€β”€ /api/lyrics        β†’ createLyricsRouter     (LRCLIB + YTM lyrics aggregation)
β”‚   └── /api/page          β†’ createPagesRouter      (Screen data aggregation)
└── Static File Serving (production)

Design Patterns

  • Factory Routers: Each route module exports a factory function that receives dependencies (e.g., yt client, oauth2Client) and returns a fresh express.Router() instance. This avoids shared mutable state between router instances.
  • Async Wrapper: utils/helpers.js provides a wrap(fn) utility that catches async errors and returns standardized 500 JSON responses, eliminating repetitive try/catch blocks.
  • Shared Utilities: helpers.js centralizes common logic like thumbnail resolution (pickThumbnailUrl), media normalization (toMediaItem), queue enrichment (toQueueItem), and local playlist persistence (loadLocalPlaylists, saveLocalPlaylists).

YouTube Music Integration

  • server/ytmusic.js implements a custom Innertube API client using Node.js https.
  • It sends authenticated POST requests to music.youtube.com/youtubei/v1/ with a WEB_REMIX client context.
  • Responses are parsed via deep-safe navigation utilities (nav, getText, getThumbnails) to handle YouTube's deeply nested JSON structure.

Data Flow

  1. Search: User types in AppShell β†’ debounced API call to /api/ytmusic/search β†’ backend calls Innertube β†’ parsed results returned β†’ React renders search dropdown.
  2. Playback: User clicks a track β†’ AppShell.play() loads videoId into hidden YT player β†’ YT IFrame API events update React state (time, duration, play/pause) β†’ UI re-renders progress bar and controls.
  3. Lyrics: LyricsModal mounts β†’ fetches /api/lyrics?q=... β†’ backend tries LRCLIB first, falls back to YTM β†’ lyrics are parsed into timed lines β†’ currentTime state drives active line highlighting and auto-scroll.
  4. Page Data: Route mounts (e.g., /playlists) β†’ usePageData calls /api/page/playlists β†’ backend aggregates YTM library + local playlists into a single screen payload β†’ MusicPage renders sections.

Tech Stack

Layer Technology
Frontend React 19.2, React Router DOM 7.14, Tailwind CSS 3.4
State React Context API, useState, useRef, useCallback
Backend Node.js, Express 5.2, Express Session 1.19
Auth Google OAuth 2.0 (googleapis 165.0.0)
Music API YouTube Music Innertube (server/ytmusic.js)
Lyrics API LRCLIB.net + YouTube Music
Storage Browser localStorage, local JSON file
Tooling react-scripts 5.0, concurrently 9.2, cross-env

Project Structure

AetherPulseMusic-main/
β”œβ”€β”€ public/                     # Static assets, PWA manifest
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ index.js                # Express app entry point
β”‚   β”œβ”€β”€ ytmusic.js              # YouTube Music Innertube client & parsers
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.js             # Google OAuth & session routes
β”‚   β”‚   β”œβ”€β”€ ytmusic.js          # YTM data routes (search, artists, albums...)
β”‚   β”‚   β”œβ”€β”€ localPlaylists.js   # Local JSON playlist CRUD
β”‚   β”‚   β”œβ”€β”€ lyrics.js           # Lyrics aggregation (LRCLIB + YTM)
β”‚   β”‚   └── pages.js            # Screen data aggregation
β”‚   └── utils/
β”‚       └── helpers.js          # Async wrapper, media mappers, playlist I/O
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.js                  # Root component with providers & routing
β”‚   β”œβ”€β”€ index.css               # Global styles & CSS variables
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ AppShell.js         # Main layout, player state, search
β”‚   β”‚   β”œβ”€β”€ Player.js           # Bottom playback controls
β”‚   β”‚   β”œβ”€β”€ Sidebar.js          # Navigation sidebar
β”‚   β”‚   β”œβ”€β”€ QueueModal.js       # Queue management modal
β”‚   β”‚   β”œβ”€β”€ LyricsModal.js      # Synced lyrics display
β”‚   β”‚   β”œβ”€β”€ Toast.js            # Notification system
β”‚   β”‚   β”œβ”€β”€ ThemeSettings.js    # Theme customization modal
β”‚   β”‚   β”œβ”€β”€ music/              # Music-specific UI (MediaCard, QueueTable...)
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ MusicPage.js        # Generic page renderer (home, playlists, etc.)
β”‚   β”‚   β”œβ”€β”€ ArtistDetailPage.js
β”‚   β”‚   β”œβ”€β”€ AlbumDetailPage.js
β”‚   β”‚   β”œβ”€β”€ InsightsPage.js
β”‚   β”‚   └── SettingsPage.js
β”‚   β”œβ”€β”€ contexts/
β”‚   β”‚   β”œβ”€β”€ ThemeContext.js     # Theme, colors, glass effects
β”‚   β”‚   └── LanguageContext.js  # i18n (EN / PL)
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useAuthSession.js   # Auth state & session refresh
β”‚   β”‚   └── usePageData.js      # Screen data fetching
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ api.js              # HTTP client helpers
β”‚   β”‚   └── energy.js           # Track energy estimation
β”‚   └── data/
β”‚       └── musicData.js        # Static navigation config
β”œβ”€β”€ .env.example
β”œβ”€β”€ package.json
└── tailwind.config.js

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Clone the repository
git clone <repo-url>
cd AetherPulseMusic-main

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env and fill in your Google OAuth credentials (optional)

Development

# Start both frontend and backend
npm run dev
  • Frontend: http://localhost:5000
  • Backend API: http://localhost:3001

You can also run them separately:

npm run client        # React dev server only
npm run server:dev    # Express backend with auto-reload (Node --watch)

Production Build

npm run build         # Create optimized React build
npm run server        # Start production Express server

Environment Variables

Variable Description Required
BACKEND_PORT Backend development port (default: 3001) No
BACKEND_URL Backend URL for proxying (default: http://localhost:3001) No
FRONTEND_URL Frontend URL for OAuth redirects (default: http://localhost:5000) No
SESSION_SECRET Express session secret Yes (production)
GOOGLE_CLIENT_ID Google OAuth Client ID No
GOOGLE_CLIENT_SECRET Google OAuth Client Secret No
GOOGLE_CALLBACK_URL OAuth callback URL (default: http://localhost:3001/api/auth/google/callback) No
REACT_APP_API_BASE_URL Frontend API base URL No

Note: Google OAuth is optional. Without it, the app works in anonymous mode with local playlists and favorites.


API Overview

Endpoint Description
GET /api/auth/session Get current auth status
GET /api/auth/google Initiate Google OAuth flow
POST /api/auth/logout Destroy session
GET /api/ytmusic/search?q=...&filter=... Search YTM
GET /api/ytmusic/artist/:id Artist details
GET /api/ytmusic/album/:id Album details
GET /api/ytmusic/playlist/:id Playlist tracks
GET /api/lyrics?q=...&videoId=... Fetch lyrics (LRCLIB + YTM)
GET /api/local/playlists List local playlists
POST /api/local/playlists Create local playlist
GET /api/page/:key Get aggregated screen data

Available Scripts

Script Description
npm run dev Start frontend + backend concurrently
npm run client Start React dev server (localhost:5000)
npm run server Start production backend
npm run server:dev Start backend with Node --watch
npm run build Build optimized production bundle
npm test Run React test suite

Contributing

Contributions are welcome! Please check CONTRIBUTING.md for guidelines.

Before submitting a PR, ensure the application starts correctly:

npm run dev

License

This project is licensed under the MIT License.

About

🎡 **Modern music player** integrated with YouTube Music. The application offers search, playlists and albums from YouTube, Google login, responsive Dark Mode interface with Tailwind CSS, and Express backend. React 19 frontend + Node.js backend.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors