# Suno Music Generator
This is an unofficial music generation website developed based on NextJS for [suno.ai](https://www.suno.ai). It can generate the desired song within approximately one minute based on the prompt entered by the user.
The project utilizes JavaScript reverse engineering to analyze the API used by suno.ai to generate songs. Payments are processed through Lemon Squeezy. Additionally, the project incorporates token renewal and maintenance functionality to eliminate the need for concerns about token expiration.
## Quick Start
1. obtain the cookie of your app.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.
2. download the project
3. install dependencies
```shell
cd suno-music-generator
pnpm install
```
4. init database
create your database use [local postgres](https://wiki.postgresql.org/wiki/Homebrew) or [vercel-postgres](https://vercel.com/docs/storage/vercel-postgres)
create tables from sql at `data/install.sql`
5. set environmental values
put `.env.local` under `suno-music-generator` root dir with values list below
```
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=""
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
SUNO_COOKIE=""
LEMON_SQUEEZY_HOST=https://api.lemonsqueezy.com/v1
LEMON_SQUEEZY_API_KEY=
LEMON_SQUEEZY_STORE_ID=
LEMON_SQUEEZY_PRODUCT_ID=
LEMON_SQUEEZY_MEMBERSHIP_MONTHLY_VARIANT_ID=
LEMON_SQUEEZY_MEMBERSHIP_SINGLE_TIME_VARIANT_ID=
LEMONS_SQUEEZY_SIGNATURE_SECRET=
POSTGRES_URL=
```
SUNO_COOKIE is the cookie value you obtained in the first step
6. local development
```shell
pnpm dev
```
open `http://localhost:3000` for preview