# ⚡ SMM Pro Panel — Laravel Edition
## Auto-Installer Setup Guide

## Requirements
- PHP 8.1+, MySQL 5.7+, Apache/Nginx with mod_rewrite
- Composer (for vendor autoload)

## Quick Install (3 Steps)

### 1. Upload & Set Permissions
```bash
upload all files to /public_html/ (or subdirectory)
chmod -R 755 storage/ bootstrap/cache/
chmod -R 644 .env.example
```

### 2. Install Composer Dependencies
```bash
composer install --no-dev --optimize-autoloader
```
*Or use pre-bundled vendor/ if included*

### 3. Open Browser → Auto Installer
```
https://yourdomain.com/install
```
The wizard will:
✅ Check server requirements
✅ Test DB connection & create database automatically
✅ Validate your Telegram bot token
✅ Run all migrations (create all tables)
✅ Create admin account
✅ Save all settings
✅ Register Telegram webhook
✅ Set up default payment methods

**That's it! No manual SQL, no config file edits.**

---

## After Installation

### Admin Panel
`https://yourdomain.com/admin`

### Mini App
`https://yourdomain.com/` (set this as your Bot's Mini App URL in BotFather)

### Telegram Bot Commands
| Command | Description |
|---------|-------------|
| `/start [ref_ID]` | Open panel + referral |
| `/balance` | Show balance |
| `/orders` | Recent orders |
| `/refer` | Referral link |
| `/help` | All commands |
| `/admin` | Admin stats (admin only) |

---

## Key Features

### ⚡ Live Order Status (No Cron!)
Orders update automatically when user:
- Taps "Refresh Status" on any order
- Every 15 seconds while Orders page is open (bulk polling)
- On order detail view open

### 🎁 Referral System
Link format: `https://t.me/YourBot?startapp=ref_{telegram_id}`
- User joins via link → referrer notified
- User's first deposit approved → bonus credited automatically

### 🎨 Theme Customization
Admin → App Theme → Change colors → Save
Users see changes instantly on next load.

### 💳 Custom Deposit Fields
Admin → Payment Methods → Edit → Custom Fields JSON
Add unlimited fields: text, tel, image types

---

## Nginx Config (if needed)
```nginx
server {
    listen 80;
    server_name yourdomain.com;
    root /var/www/html/public;
    index index.php;
    location / { try_files $uri $uri/ /index.php?$query_string; }
    location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; }
}
```

## Default Admin
- URL: /admin (after install)
- Username/Password: **set during installer**
