# 🌐 Web Installation Wizard

## 📋 How to Use

### **Method 1: Via Browser (Easiest)**

1. **Upload the entire project** to your web hosting
2. **Navigate to** `https://yourdomain.com/install/`
3. **Follow the wizard** - it will guide you through:
   - Database configuration
   - Schema import
   - Email setup
   - Application configuration
4. **Delete the `/install` folder** after completion

---

### **Method 2: Via cPanel File Manager**

1. **Upload project** via cPanel File Manager
2. **Extract files** if uploaded as ZIP
3. **Open browser** and go to: `https://yourdomain.com/install/`
4. **Complete the wizard**
5. **Delete `/install` folder** when done

---

## ✅ What the Wizard Does

- ✓ Tests database connection
- ✓ Imports database schema automatically
- ✓ Creates `.env` configuration file
- ✓ Generates secure session secret
- ✓ Configures email (SMTP)
- ✓ Sets up Groq API for AI features
- ✓ Optional Stripe configuration

---

## 🔐 Security

**IMPORTANT:** After installation is complete:

1. **Delete the `/install` folder**
2. **Never commit `.env` to Git**
3. **Use strong database passwords**
4. **Enable HTTPS/SSL**

---

## 🐛 Troubleshooting

### **"Database connection failed"**
- Check MySQL credentials
- Verify database exists
- Ensure user has ALL PRIVILEGES

### **"Schema import failed"**
- Check database user permissions
- Verify `database/schema.sql` exists
- Try importing manually via phpMyAdmin

### **"Cannot create .env file"**
- Check folder permissions (755 for folders, 644 for files)
- Ensure web server can write to project root

---

## 📞 Manual Installation

If the web wizard doesn't work, you can:

1. **Use command-line installer:**
   - Windows: Double-click `install.bat`
   - Linux/Mac: Run `./install.sh`

2. **Manual setup:**
   - Copy `.env.example` to `.env`
   - Fill in all values
   - Import `database/schema.sql` via phpMyAdmin
   - Run `npm install && npm run build`

---

## 🎯 After Installation

Once the wizard completes:

```bash
# Install dependencies
npm install

# Build the application
npm run build

# Start the application
npm start
```

Access your app at the URL you configured!

---

**Need help?** Check `INSTALLATION_GUIDE.md` in the project root.
