Skip to content

🎡 A simple wrapper for the JioSaavn API powered by Hono.js πŸ”₯.

License

Notifications You must be signed in to change notification settings

rajput-hemant/jiosaavn-api-ts

Repository files navigation

🎡 Jio Saavn API

A simple wrapper for the Jio Saavn API powered by Hono.js πŸ”₯.

πŸ“š Documentation (in progress)

✨ Features

  • πŸš€ Ultrafast - Powered by Hono.js.The router RegExpRouter is really fast.
  • πŸͺΆ Lightweight - Has minimal dependencies.
  • 🌍 Multi-runtime - Works on Bun, Node.js, Vercel or Cloudflare Workers. The same code runs on all platforms.
  • πŸ”₯ Download High Quality Songs, w/ lyrics for supported songs.
  • 🎡 Get Songs, Albums, Playlists, Artists, Radio Stations, Podcasts Lyrics, Recommendations, and more.
  • ❀️ Open Source

πŸ› οΈ Building from source

  • Clone the repository
git clone https://github.com/rajput-hemant/jiosaavn-api-ts
cd jiosaavn-api-ts
  • Install dependencies
bun i || pnpm i || npm i || yarn

Bun

Warning You need to have Bun.js installed on your machine to run the project with bun.

bun run dev || pnpm dev || npm run dev || yarn dev

Node.js

bun run dev:node || pnpm dev:node || npm run dev:node || yarn dev:node

Vercel Dev Server

bun run dev:vercel || pnpm dev:vercel || npm run dev:vercel || yarn dev:vercel

Cloudflare Workers

Warning Make sure to remove Node API code from src/index.ts & config.ts before deploying or running the project with Cloudflare Workers.

src/index.ts

...

-  port: +(process.env.PORT ?? 3000),
+ port: 3000, # update accordingly

...

src/lib/config.ts

...

-  enableRateLimit: process.env.ENABLE_RATE_LIMIT === "true" ?? false,
+  enableRateLimit: false, # update accordingly
...
bun run dev:vercel || pnpm dev:cf || npm run dev:cf || yarn dev:cf

🌐 Deploying your own instance

You can easily deploy your own hosted version of the JioSaavn API by clicking on one of the links below, which will set up a ready-to-go version for you:

Deploy with Vercel

Deploy with Cloudflare Workers

OR

Deploying using CLI

Vercel

  • It utilizes Edge Functions and can automatically execute in the region nearest to the user who triggers them.
  • It's worth noting that Mumbai, India (South) - bom1 is the recommended region for this project deployment.
bun run deploy:vercel || pnpm deploy:vercel || npm run deploy:vercel || yarn deploy:vercel

Note We are using community based 🐰 Bun runtime for β–² Vercel Serverless Functions by default, You can also use β–² Vercel Serverless Functions w/ Node Runtime or β–² Vercel Edge Functions to deploy the project. To use Node Runtime or Edge Functions rename the _api folder to api and remove 'buildCommand' from vercel.json file.

Cloudfare Workers

bun run deploy:cf || pnpm deploy:cf || npm run deploy:cf || yarn deploy:cf

Build and Run Docker Image

Docker Compose (Recommended)

  • Start the container
docker-compose up -d # detached mode
  • Stop the container
docker-compose stop # stops the container
docker-compose down # stops and removes the container

Docker

  • Start Docker daemon (Skip if already running)
sudo dockerd
  • Build the image
docker build -t jiosaavn .
  • Run the image
docker run -p 80:3000 jiosaavn
docker ps
docker stop <container-id>

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

🦾 Contributors: