<h1 align="center"">
This is an ai music website developed based on Next.js. It uses Suno AI to generate music.
We have deployed an example website on Vercel, so you can see how it runs: ai-song.vercel.app
The example site may not be able to generate music, the reason may be that the cookie is out of date, you can deploy and update the SUNO_COOKIE environment variable by yourself. If the suno api is still abnormal after updating the cookie, you can refer to suno-api to fix it first.
obtain the cookie of your Suno AI account
Locate the request that contains the keyword "client?_clerk_js_version". Navigate to the Cookie section, hover your mouse over it, and copy the value of the Cookie.
clone project
git clone https://github.com/Sprheany/ai-song.git
install dependencies
cd ai-song
npm install
init database
create your database and run npm run db:push
to create tables, then run npm run db:seed
to crawl data from Suno API
Suno API is crawled through the official website, it may not work in the future.
set env variables
put .env
under ai-song
root dir with values list below
SUNO_COOKIE=
POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
NEXT_PUBLIC_URL=
LEMONSQUEEZY_API_KEY=
LEMONSQUEEZY_STORE_ID=
LEMONSQUEEZY_PRODUCT_ID=
LEMONSQUEEZY_WEBHOOK_SECRET=
SUNO_COOKIE is the cookie value you obtained in the first step
run
npm run dev
Open http://localhost:3000 with your browser to see the result.