# ✅ DO THIS NOW - Step by Step

Follow these steps **in order**. Don't skip any!

---

## 📤 STEP 1: Upload server.js

1. **Find this file on your computer:**
   ```
   C:\Users\hp\Documents\rev1111111\server.js
   ```

2. **Log into Namecheap cPanel**

3. **Go to:** File Manager

4. **Navigate to:** `public_html` (your website root folder)

5. **Click:** Upload button (top menu)

6. **Select:** `server.js` from your computer

7. **Wait** for upload to complete

8. **Verify:** You see `server.js` in the file list next to `package.json`

✅ **Done?** Continue to Step 2

---

## ⚙️ STEP 2: Create Node.js App in cPanel

1. **In cPanel, find:** "Setup Node.js App" (search if needed)

2. **Click:** "Create Application"

3. **Fill in the form:**

   **Node.js version:** `18.x` (or highest available)
   
   **Application mode:** `Production`
   
   **Application root:** `/home/YOUR_USERNAME/public_html`
   - Replace `YOUR_USERNAME` with your cPanel username
   - Example: `/home/rebrand123/public_html`
   
   **Application URL:** `https://rebrandlyai.com`
   
   **Application startup file:** `server.js`

4. **Click:** "Create"

5. **Wait** for creation to complete

✅ **Done?** Continue to Step 3

---

## 💻 STEP 3: Install Dependencies

1. **In cPanel, find:** "Terminal" (or "SSH Access")

2. **Click** to open Terminal

3. **Copy the command** cPanel shows (looks like this):
   ```
   source /home/username/nodevenv/public_html/18/bin/activate
   ```

4. **Paste and run** that command in Terminal

5. **Then run these commands one by one:**

   ```bash
   cd /home/YOUR_USERNAME/public_html
   ```
   (Replace YOUR_USERNAME with your actual username)

   ```bash
   npm install
   ```
   **Wait 2-5 minutes** - you'll see packages being installed

   ```bash
   npm run build
   ```
   **Wait 1-3 minutes** - you'll see "Compiled successfully"

✅ **Done?** Continue to Step 4

---

## 🚀 STEP 4: Start the Application

1. **Go back to:** Setup Node.js App in cPanel

2. **Find your app** in the list (should show rebrandlyai.com)

3. **Click:** "Start App" button (or "Restart App" if already running)

4. **Wait** for status to change to **"Running"** with green indicator

✅ **Done?** Continue to Step 5

---

## 🌐 STEP 5: Test Your Website

1. **Open browser**

2. **Go to:** https://rebrandlyai.com

3. **You should see:** Your Rebrandly AI homepage

4. **Test sign up:**
   - Click "Sign Up"
   - Enter email and password
   - Check if verification email arrives

5. **Test login:**
   - Use your credentials
   - Check if dashboard loads

✅ **Working?** You're done! 🎉

---

## 🐛 If Something Goes Wrong

### **App won't start?**
- Check Terminal for errors
- Make sure `npm install` and `npm run build` completed
- Verify `server.js` is uploaded

### **Can't access website?**
- Wait 2-3 minutes for app to fully start
- Check app status is "Running" in cPanel
- Try clearing browser cache (Ctrl + F5)

### **Database errors?**
- Check `.env` file has correct database credentials
- Verify database exists in cPanel MySQL

### **Still stuck?**
- Go to Setup Node.js App → Click "Edit" on your app
- Scroll to "Log" section
- Read error messages
- Tell me what the error says

---

## 📋 Quick Checklist

- [ ] `server.js` uploaded to `public_html`
- [ ] Node.js app created in cPanel
- [ ] Terminal commands run successfully
- [ ] `npm install` completed (no errors)
- [ ] `npm run build` completed (shows "Compiled successfully")
- [ ] App started in cPanel (status = Running)
- [ ] Website loads at https://rebrandlyai.com
- [ ] Sign up and login work
- [ ] `/install` folder deleted (for security)

---

## 🎯 Current Status

**What you've done:**
✅ Database set up
✅ Web installer completed
✅ `.env` file configured

**What's left:**
1. Upload `server.js`
2. Configure Node.js app
3. Run install/build commands
4. Start the app
5. Test!

---

**Start with Step 1 now! Upload `server.js` to your website.**
