Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 Lyricalize

A full-stack music and lyrics web application β€” search songs, view synchronized lyrics, and stream audio, all in one place.

Deploy to Cloudflare Live Demo TypeScript License: MIT


🌟 What is Lyricalize?

Lyricalize is a modern music player web app that lets you search for songs, read lyrics, and listen to tracks β€” all from a clean, responsive interface. It fetches real-time music data and lyrics via API, plays audio at the best available quality (up to 320kbps), and presents everything in a polished editor-style UI with dark mode support.


✨ Features

  • Song Search β€” Find tracks instantly with a fast, real-time search experience
  • Lyrics Viewer β€” Read synced lyrics for any searched track in the built-in editor panel
  • Audio Playback β€” Stream songs at the highest available quality (12kbps β†’ 320kbps with auto best-quality selection)
  • Music Panel UI β€” Sidebar-style music panel with track info, player controls, and queue management
  • Dark Mode β€” Full dark/light theme support powered by Tailwind CSS
  • Serverless Backend β€” API routes handled by a Cloudflare Worker, keeping the backend fast and scalable
  • Responsive Design β€” Works seamlessly across desktop and mobile browsers

πŸ› οΈ Tech Stack

Frontend

Technology Role
React 18 + TypeScript Core UI framework
Vite Build tool & dev server
React Router v6 Client-side routing
TanStack React Query Data fetching & caching
Tailwind CSS Styling & theming
shadcn/ui + Radix UI Accessible component primitives
Zustand Global audio/track state management

Backend & Infrastructure

Technology Role
Cloudflare Workers Serverless API compute
Hono Lightweight API routing framework
Wrangler CLI Local dev & deployment tooling

Developer Tools

  • Bun β€” Fast package manager & runtime
  • ESLint β€” TypeScript-aware linting
  • PostCSS + Autoprefixer β€” CSS processing

πŸš€ Getting Started

Prerequisites

Installation

git clone https://github.com/SKS-WEBDEV/lyricalize.git
cd lyricalize
bun install

Development

Start the local development server (React frontend + Cloudflare Worker API):

bun run dev

The app will be available at http://localhost:3000 with hot module replacement enabled.

Production Build

# Build for production
bun run build

# Preview production build locally
bun run preview

πŸ“ Project Structure

lyricalize/
β”œβ”€β”€ src/                          # React frontend
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── editor/
β”‚   β”‚       └── MusicPanel.tsx    # Music player UI panel
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── useAudioEngine.ts     # Audio playback engine
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   └── api.ts                # API client & data fetching
β”‚   β”œβ”€β”€ pages/                    # Route-level page components
β”‚   └── main.tsx                  # App entry & routing
β”œβ”€β”€ worker/
β”‚   β”œβ”€β”€ index.ts                  # Cloudflare Worker entry point
β”‚   └── userRoutes.ts             # Custom API route definitions
β”œβ”€β”€ public/                       # Static assets
β”œβ”€β”€ prompts/                      # AI prompt files
β”œβ”€β”€ wrangler.jsonc                 # Cloudflare Worker configuration
β”œβ”€β”€ vite.config.ts                # Vite build configuration
└── tailwind.config.js            # Tailwind theme & design system

🎧 How Audio Playback Works

  1. Search β€” User searches for a song; the API returns tracks with validated download URL arrays
  2. Select β€” Clicking a track stores it in Zustand global state
  3. URL Selection β€” The audio engine picks the best available quality:
    • πŸ₯‡ Highest bitrate (preferred)
    • πŸ₯ˆ 320kbps
    • πŸ₯‰ 160kbps
    • πŸ” Fallback to lowest available
  4. Playback β€” The audio element (mounted in the DOM for full browser compatibility) loads and plays the track
  5. Events β€” Browser fires loadstart β†’ loadeddata β†’ canplay β†’ playing in sequence

Download URL Structure (from API)

{
  "downloadUrl": [
    { "quality": "12kbps",  "url": "https://..." },
    { "quality": "48kbps",  "url": "https://..." },
    { "quality": "96kbps",  "url": "https://..." },
    { "quality": "160kbps", "url": "https://..." },
    { "quality": "320kbps", "url": "https://..." }
  ]
}

🌐 API Routes

All API endpoints are defined in worker/userRoutes.ts and mounted under /api/*.

// Example custom route
app.get('/api/hello', (c) => c.json({ message: 'Hello from Workers!' }));

Built-in routes include health checks and client error reporting.


☁️ Deployment

One-Click Deploy to Cloudflare

Deploy to Cloudflare

Manual Deployment

# Authenticate with Cloudflare (first time only)
bunx wrangler login

# Build and deploy
bun run deploy

Update wrangler.jsonc with your Worker name, routes, and any environment variables before deploying.


πŸ”§ Customization

What to change Where
UI Components src/components/ or add new shadcn/ui components
Theme & Colors tailwind.config.js and src/index.css
Frontend Routes src/main.tsx
API Routes worker/userRoutes.ts
App Sidebar src/components/app-sidebar.tsx

πŸ› Debugging Audio

Open DevTools (F12) and check the console for these logs:

[AudioEngine] πŸ”§ Audio element created. crossOrigin=anonymous
[AudioEngine] πŸ“ Audio element added to DOM
[AudioEngine] 🎡 Track Change
[AudioEngine] πŸ“₯ Setting audio src and calling load()...
[AudioEngine] πŸ”— audio.src confirmed: https://...
[MusicPanel] Track selected: {...}

If audio doesn't play, verify:

  • The browser console for errors
  • Network tab to confirm audio URLs are being fetched
  • Browser audio permissions are enabled
  • Audio file format compatibility (MP4 is broadly supported)

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

For major changes, please open an issue first to discuss what you'd like to change.


⚠️ Legal Disclaimer

Please read carefully before using, deploying, or contributing to this project.

Educational & Personal Use Only

Lyricalize is an open-source project intended strictly for educational and personal, non-commercial use. It was built to demonstrate the integration of modern web technologies including React, Cloudflare Workers, and third-party music APIs.

Music & Lyrics Content

  • Lyricalize does not host, store, distribute, or own any music, audio files, or lyrics content.
  • All audio streams and lyrics data are fetched in real-time from third-party public APIs. The availability and legality of such content is governed entirely by those third-party services.
  • Song titles, album artwork, artist names, and lyrics are the intellectual property of their respective rights holders β€” including but not limited to record labels, music publishers, and artists.
  • Streaming or downloading copyrighted music without the explicit authorization of the rights holder may violate copyright law in your jurisdiction, including but not limited to the DMCA (USA), the EU Copyright Directive, and equivalent legislation worldwide.

No Affiliation

This project is not affiliated with, endorsed by, or connected to any music streaming service, record label, publisher, or any third-party API provider it may consume.

Third-Party APIs

Users and contributors who deploy this application are solely responsible for ensuring their usage of any third-party APIs complies with those services' Terms of Service. The project maintainers accept no liability for misuse of upstream APIs.

No Warranty

This software is provided "as is", without warranty of any kind, express or implied. The authors and contributors shall not be held liable for any claim, damages, or other liability arising from the use of this software or any content accessed through it.

Takedown / DMCA Notices

If you are a rights holder and believe your content is being accessed or surfaced inappropriately through this application, please open a GitHub issue or contact the repository owner directly. We will respond promptly.


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ”— Links

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages