This backend API is specifically built for Sunoh Music App, available at www.sunoh.online.
Sunoh is a music streaming platform that provides access to songs from multiple music sources with comprehensive search and streaming capabilities.
Note: This repository is tailored for Sunoh's specific requirements. While the code is open source, major modifications or feature requests will only be considered if they align with Sunoh Music's roadmap and needs.
- 🎼 Multi-source Music API: Integration with various music streaming services
- 🎤 Lyrics Support: Comprehensive lyrics search and fetch capabilities
- 🔴 Live Music: WebSocket support for real-time music streaming
- 🖼️ Image Proxy: Optimized image serving
- ⚡ Fast Performance: Built with Fastify for high performance
- 🚀 Serverless Ready: Optimized for Vercel deployment
/music/*
- Music streaming API endpoints/lyrics/*
- Lyrics search and retrieval
/play
- Music playback endpoints/proxy
- Image proxy service/live/*
- WebSocket live music features
- Node.js >= 18.12
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/afkcodes/sunoh-api.git cd sunoh-api
-
Install dependencies
npm install
-
Environment Configuration
Create environment files for different stages:
# Development environment cp .env.development.example .env.development # Production environment cp .env.production.example .env.production
Configure the following environment variables:
# Music Service Integration LYRICS_TOKEN=your_music_service_bearer_token MEDIA_USER_TOKEN=your_music_service_media_user_token # Optional: Redis/Valkey for caching VALKEY_URL=redis://localhost:6379
# Run development server with auto-reload
npm run dev
# Run with Vercel CLI for serverless testing
npm run start:vercel
The API will be available at http://localhost:3000
# Build for production
npm run build:release
# Start production server
npm start
# Deploy to development/staging
npm run deploy:dev
# Deploy to production
npm run deploy:prod
# Lint code
npm run lint
# Format code
npm run format
# Clean build artifacts
npm run clean
# Search for a song and get lyrics
GET /lyrics/Shape%20of%20You
# With optional parameters
GET /lyrics/Despacito?storefront=us&format=lrc&language=en-IN
GET /music/search?query=Popular%20hits
GET /music/song/songId
- Framework: Fastify
- Language: TypeScript
- Deployment: Vercel Serverless
- Code Quality: Biome (linting & formatting)
- Process Management: Nodemon (development)
This project is primarily maintained for Sunoh Music App. If you have suggestions or improvements that would benefit Sunoh Music specifically, please:
- Open an issue describing the enhancement
- Ensure it aligns with Sunoh's music goals
- Submit a pull request with clear documentation
MIT License - See LICENSE file for details.
For Sunoh Music App related queries, visit www.sunoh.online
For technical issues with this API, please open a GitHub issue.
Built with ❤️ for Sunoh Music 🎵