GitHub - mdnaimislambd/GanerDhol-AI · GitHub
Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

GanerDhol AI — AI Song Generator Website

An aisong.io-style website: users describe a song or paste lyrics, and the site generates a full original song with vocals (via Google Lyria 3 Pro through OpenRouter).

Files

File What it is
index.html The whole site (hero, studio, showcase, how-it-works, FAQ)
styles.css Dark studio theme
app.js Frontend logic — calls the backend, plays/downloads MP3
config.js Set WORKER_URL here after deploying the backend
worker.js Cloudflare Worker backend — hides the OpenRouter API key
README.md This file

Deploy steps

0. OpenRouter credits (REQUIRED first step)

The API key alone is not enough — the account needs credits, otherwise every generation fails with 402 Payment Required.

  1. Go to https://openrouter.ai/settings/credits and add credits (a few dollars is plenty to start; each song ≈ $0.08).
  2. The same sk-or-v1-... key will then work for paid models.

1. Deploy the backend (Cloudflare Workers — free)

cd ai-song-site
npx wrangler login
npx wrangler secret put OPENROUTER_API_KEY   # paste the sk-or-v1-... key when asked
npx wrangler deploy worker.js --name ganerdhol-ai

Copy the worker URL, e.g. https://ganerdhol-ai.yourname.workers.dev.

Abuse protection (important): every song costs ~$0.08 of YOUR money. In the Cloudflare dashboard, add a Rate Limiting rule for https://<your-worker>/api/generate — e.g. max 10 requests / 10 minutes per IP. The worker also has a best-effort cap of 5 songs / IP / day.

2. Create the GitHub repo (you must create it — automation can't)

  1. On github.com create a public repo, e.g. GanerDhol-AI.
  2. Push these files to the main branch.
  3. Repo Settings → Pages → Source: Deploy from a branch, branch main, folder / (root).
  4. Site goes live at https://mdnaimislambd.github.io/GanerDhol-AI/.

3. Connect frontend → backend

Edit config.js and set:

WORKER_URL: "https://ganerdhol-ai.yourname.workers.dev"

Push the change. Done — the Generate button now makes real songs.

4. AdSense (optional)

Two ad slots are pre-wired with publisher ID ca-pub-8912117199500932. Create ad units in AdSense and replace REPLACE_WITH_AD_SLOT in index.html.

How a generation works

  1. User fills the form → frontend POSTs JSON to WORKER_URL/api/generate.
  2. Worker builds a Lyria prompt and calls OpenRouter (google/lyria-3-pro-preview, modalities: ["audio","text"], stream: true — audio output requires streaming).
  3. Worker assembles the base64 MP3 chunks from the SSE stream and returns audio/mpeg.
  4. Frontend plays it in the <audio> player, offers Download, and keeps a session history.

Costs (honest math)

  • Per song: ~$0.08 (OpenRouter → Lyria 3 Pro Preview).
  • 100 songs ≈ $8. Backend + frontend hosting: $0.
  • Do NOT offer unlimited free generations publicly unless you add user accounts + payments — anyone can drain the OpenRouter balance otherwise.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages