# LiveClip AI — Deploy Guide (DEPLOY.md) — v2 (FLAT zip)

> Website: **https://liveclipai.lowpricepanel.store**
> Hosting: Aryanispe Host — Shared Hosting, "CPanel Starter" plan (manage.aryanispehost.in)
> Main domain: lowpricepanel.store · LiveClip AI lives on the subdomain **liveclipai**

---

## Step 0 — Shotti kotha age (honest limits, please read first)

Shared cPanel hosting-e **shob kichu cholbe na**. Eta lukano hoy nai:

| Feature | cPanel-e cholbe? | Keno |
|---|---|---|
| Website UI (Home, Clips, Plans, Profile, Player) | ✅ Yes | Static files — cPanel-ei cholbe |
| Clip detect kora (chat spike) | ✅ Yes | Browser-e cholbe (labelled simulation) |
| Real MP4 render + Download | ❌ No — VPS lagbe | YouTube theke video ana + FFmpeg diye kata — cPanel-e ei software cholbe na |
| Real Google Sign-In (verified) | ⚠️ Half — VPS lagbe | Button dekhabe, kintu token verify korte render server lagbe |
| Push notification jokhon app bondho | ❌ No | Eta shudhu browser notification — app khola thakle |
| Offline UI | ✅ Yes | Service worker shudhu app-er design-ta cache kore |

**Mane:** cPanel-e website khulbe, shob page dekhabe, clip detect korbe — kintu **Download button-e ashol MP4 pete hole chhoto ekta VPS server lagbe** (Step 3). VPS na thakle clip card-e shotti kotha dekhabe: "Rendering is unavailable — the render server is not set up yet." Kono fake Download thakbe na.

---

## Step 1 — Subdomain banao (cPanel)

1. Aryanispe Host-e login koro: **manage.aryanispehost.in**
2. cPanel kholo → **Subdomains**-e jao
3. Notun subdomain banao:
   - **Subdomain:** `liveclipai`
   - **Domain:** `lowpricepanel.store` (select koro)
   - **Document Root:** `public_html/liveclipai` (cPanel nijei eta debe)
4. Create-e click koro.

Ebar site-er thikana holo: **https://liveclipai.lowpricepanel.store**

> SSL: cPanel → **SSL/TLS Status** → `liveclipai.lowpricepanel.store`-er jonno **AutoSSL** run koro, jate `https://` kaaj kore. Google Sign-In-er jonno HTTPS **must**.

---

## Step 2 — Website upload koro (cPanel File Manager) — EKDOM SHOJA

**Notun v2 zip-ta FLAT banano — ar kono folder move korte hobe na.**

1. cPanel → **File Manager** → `public_html/liveclipai` folder-e jao (tomar subdomain-er folder).
2. `liveclip-website-v2.zip` file-ta ekhane **upload** koro.
3. Zip file-ta select kore **Extract**-e click koro → **Extract File(s)**.
4. Bas — shob file (`index.html`, `styles.css`, `app.js`, `config.js`, `.htaccess`, `icons/`...) ekhon **directly ei folder-e** chole ashbe. `website/` bole kono folder ar thakbe na, kichu move korte hobe na.
5. Browser-e kholo: **https://liveclipai.lowpricepanel.store** — Home page dekhte pabe.

> ⚠️ Purano v1 zip theke jodi `website/` folder-ta ekhono folder-e thake, ota **delete** kore dio — nahole confusion hobe. Zip file-ta extract korar por chaile delete kore dite paro.
> `config.js` age thekei thik kora ache: `SITE_URL = https://liveclipai.lowpricepanel.store`. Kichu bodlate hobe na — shudhu Step 3-er por `API_BASE_URL` ar Google Client ID bosate hobe.

---

## Step 3 — Render server (VPS) — real MP4 Download-er jonno

Eta **shudhu** real MP4 download-er jonno lagbe. Chhoto ekta VPS-e (jemon $5/month Ubuntu server) koro:

```bash
# 1. Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

# 2. FFmpeg + Python
sudo apt-get install -y ffmpeg python3 python3-pip

# 3. yt-dlp (latest)
sudo pip3 install -U yt-dlp

# 4. Server folder copy koro, e.g. /opt/liveclip-server
cd /opt/liveclip-server
cp .env.example .env
nano .env        # PORT ar GOOGLE_CLIENT_ID bosao

# 5. Start koro
npm install
npm start
```

Check koro: browser-e `http://TOMAR-SERVER-IP:3000/api/health` kholo — `"ffmpeg": true` ar `"ytDlp": true` dekhte hobe.

**Chalu rakhar jonno (pm2):**

```bash
sudo npm install -g pm2
pm2 start index.js --name liveclip
pm2 save
pm2 startup
```

**Domain diye chalate chaile (nginx, optional):** `api.lowpricepanel.store` subdomain-ta VPS-er IP-te point koro, tarpor nginx-e proxy koro (puro example `server/README.md`-e ache), ar Certbot diye HTTPS nao. Tarpor `config.js`-e bosao:

```js
API_BASE_URL: "https://api.lowpricepanel.store",
```

Server chara website cholbe, kintu Download kaj korbe na — eta age thekei bola ache.

---

## Step 4 — Google Sign-In (Google Cloud Console)

1. [Google Cloud Console](https://console.cloud.google.com/) → tomar project → **APIs & Services → Credentials**.
2. Tomar **OAuth 2.0 Client ID** kholo (Web application).
3. Ei 2-ta **exactly** bosao:
   - **Authorized JavaScript origin:**
     `https://liveclipai.lowpricepanel.store`
   - **Authorized redirect URI:**
     `https://liveclipai.lowpricepanel.store`
4. Save koro.
5. Client ID-ta `config.js`-e bosao:

```js
GOOGLE_CLIENT_ID: "TOMAR-CLIENT-ID.apps.googleusercontent.com",
```

6. Client Secret-ta **kokhono** website-er file-e diba na — shudhu VPS-er `server/.env` file-e:

```
GOOGLE_CLIENT_ID=TOMAR-CLIENT-ID.apps.googleusercontent.com
```

> ⚠️ Age-r `https://muse.ai` origin/redirect ekhane ar cholbe na — notun subdomain-er jonno upore-r value-gulo-i dite hobe. `.local` address Google ney na.

---

## Step 5 — Test koro

1. Kholo: **https://liveclipai.lowpricepanel.store**
2. Test stream paste koro: `https://www.youtube.com/live/qSyo5d-dVzA`
3. **Start Watching** tap koro → monitoring cholbe, spike detect hole clip banabe.
4. Clip card-e **"Ready to download"** dekhle **Download** tap koro — ashol MP4 phone-e nambe.
5. Jodi render server na thake, card-e dekhabe "Rendering is unavailable" — eta-i shotti obostha, fake Download na.
6. Profile → **Sign in with Google** tap kore nijer account diye test koro.

---

## Kichu dorkari kotha

- **Plan limits:** Free — 3 clips/day, max 30s, 1 stream. Pro — $30/month, 20 clips/day, max 60s, 3 streams. Max — $150/month, unlimited. Checkout ekhon demo — kono payment neya hoy na.
- **Resolution:** Clip shob shomoy original source resolution-e thake. Kono "4K" ba "upscale" label nai.
- **Live chat:** YouTube Data API key na dile chat feed-ta **labelled simulation** — app-ei lekha thakbe. Asli chat chaile API key `server/.env`-e `YOUTUBE_API_KEY` hishebe bosate hobe.
- **YouTube bot-check:** Majhe majhe YouTube lookup block kore (LOGIN_REQUIRED). Eta YouTube-er dik theke — koyek minute por abar try korle ba onno network-e gele thik hoye jay.
- **File-gulo:** Root-er file-gulo (`index.html`, `styles.css`, `app.js`, `config.js`, `.htaccess`, `icons/`) = cPanel-e upload korar frontend. `server/` = VPS-er Node server (cPanel-e lagbe na — VPS-e chalabe). `DEPLOY.md` = ei guide.

## Tomar ja ja ekhono dite hobe

1. ✅ Domain deya hoyeche: `liveclipai.lowpricepanel.store` — config-e bosano ache.
2. ⏳ **Render server (VPS)** — na thakle Download kaj korbe na. VPS nile tar IP/domain amake janale `API_BASE_URL` bosiye dibo.
3. ⏳ **Google Client ID** — notun subdomain-er jonno Google Cloud Console-e upore-r origin/redirect bosiye, Client ID-ta dile `config.js`-e bosiye dibo.
