# Quick Start Guide

Get your QR Generator System up and running in 5 minutes!

---

## Prerequisites

✅ PHP 8.3+ installed  
✅ MySQL 8+ running  
✅ Composer installed  
✅ Web server (Apache/Nginx)

---

## Installation (5 Steps)

### Step 1: Install Dependencies (1 min)

```bash
cd C:\xampp\htdocs\qqr
composer install
```

### Step 2: Configure Environment (1 min)

```bash
# Copy environment file
copy .env.example .env

# Edit .env (minimum required)
notepad .env
```

**Required settings:**
```env
APP_URL=http://localhost/qqr/public
DB_DATABASE=qr_generator
DB_USERNAME=root
DB_PASSWORD=
```

### Step 3: Create Database (1 min)

```bash
# Open MySQL
mysql -u root -p

# Create database
CREATE DATABASE qr_generator CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT;

# Import schema
mysql -u root -p qr_generator < database\schema.sql
```

### Step 4: Create Storage Folders (30 sec)

```bash
mkdir storage\qrcodes
mkdir storage\logs
mkdir storage\cache
```

### Step 5: Access System (30 sec)

Open browser: `http://localhost/qqr/public`

**Login:**
- Email: `admin@company.internal`
- Password: `Admin@123`

---

## First Steps

### 1. Change Admin Password

1. Click profile icon (top right)
2. Go to "Profile"
3. Enter current password: `Admin@123`
4. Enter new password (min 8 characters)
5. Click "Update Profile"

### 2. Create Your First QR Code

1. Click "QR Codes" in navigation
2. Click "Create New QR"
3. Select "Static QR"
4. Enter:
   - Name: "My First QR"
   - Content Type: "Website URL"
   - URL: "https://google.com"
5. Click "Generate QR Code"
6. Download and test!

### 3. Create a Staff User

1. Click "Users" (Admin only)
2. Click "Create New User"
3. Fill in details:
   - Name: "Staff Member"
   - Email: "staff@company.internal"
   - Password: "StaffPass123"
   - Role: "Staff"
4. Click "Create User"

### 4. Create a Campaign

1. Click "Campaigns"
2. Click "Create New Campaign"
3. Enter:
   - Name: "Summer 2024"
   - Description: "Summer promotion"
   - Status: "Active"
4. Click "Create Campaign"

### 5. View Analytics

1. Click "Analytics" in navigation
2. View dashboard statistics
3. Select date range
4. Explore device/browser stats

---

## Common Tasks

### Create Dynamic QR Code

```
1. QR Codes → Create New QR
2. Select "Dynamic QR"
3. Enter name and destination URL
4. Click "Generate QR Code"
5. QR code created with editable URL!
```

### Create Multi-Link Page

```
1. QR Codes → Create New QR
2. Select "Multi-Link"
3. Enter page title
4. Add links:
   - Title: "Facebook"
   - URL: "https://facebook.com/yourpage"
5. Click "Add Link" for more
6. Click "Generate QR Code"
7. Scan QR to see landing page!
```

### Download QR Code

```
1. Go to QR Codes
2. Click eye icon on any QR
3. Click "Download" button
4. QR code saved as PNG
```

### Update Dynamic QR Destination

```
1. Go to QR Codes
2. Click eye icon on dynamic QR
3. Click "Edit"
4. Change "Destination URL"
5. Click "Update"
6. QR code now redirects to new URL!
```

### View QR Analytics

```
1. Go to QR Codes
2. Click eye icon on any QR
3. Scroll to "Analytics" section
4. View scans, devices, browsers
```

---

## Troubleshooting

### "Database connection failed"

**Fix:**
```bash
# Check MySQL is running
# Verify .env credentials match MySQL
# Test connection:
mysql -u root -p
```

### "Class not found" errors

**Fix:**
```bash
composer install
composer dump-autoload
```

### QR codes not generating

**Fix:**
```bash
# Check storage folder exists
mkdir storage\qrcodes

# Check GD extension
php -m | grep gd
```

### Can't access login page

**Fix:**
```bash
# Check Apache is running
# Verify URL: http://localhost/qqr/public
# Check .htaccess exists in public folder
```

### Blank page after login

**Fix:**
```env
# Enable debug mode in .env
APP_DEBUG=true

# Check error logs
tail -f storage/logs/error.log
```

---

## Next Steps

### Customize Branding

Edit `.env`:
```env
COMPANY_NAME="Your Company Name"
COMPANY_LOGO_URL=/assets/logo.png
```

Place logo: `public/assets/logo.png`

### Enable HTTPS (Production)

1. Get SSL certificate
2. Configure web server for HTTPS
3. Update `.env`:
```env
APP_URL=https://qr.company.com
SESSION_SECURE=true
```

### Setup Backups

**Database backup:**
```bash
mysqldump -u root -p qr_generator > backup.sql
```

**File backup:**
```bash
tar -czf qr-backup.tar.gz storage/qrcodes .env
```

### Configure IP Restrictions

Edit `.env`:
```env
ALLOWED_IPS=192.168.1.100,192.168.1.101
```

### Enable Audit Logging

Already enabled by default!

View logs:
```
Dashboard → Users → Audit Logs (Admin only)
```

---

## Tips & Tricks

### Keyboard Shortcuts

- `Ctrl + K` - Quick search (planned)
- `Ctrl + N` - New QR code (planned)
- `Ctrl + /` - Help menu (planned)

### Best Practices

1. **Use Dynamic QR for campaigns** - Can change destination
2. **Use Multi-Link for social media** - One QR, many links
3. **Use Static QR for permanent info** - Business cards, signs
4. **Add to campaigns** - Better organization
5. **Check analytics regularly** - Optimize performance

### URL Shortening

Dynamic QR codes automatically get short URLs:
```
Original: https://company.com/very/long/url/to/page
Short: https://qr.company.com/r/campaign-name
```

### QR Code Design Tips

- **High contrast** - Black on white works best
- **Adequate size** - Minimum 2cm x 2cm for print
- **Test before printing** - Always scan test prints
- **Error correction** - Use 'H' for logos, 'M' for plain
- **Quiet zone** - Keep margin at least 10px

---

## Video Tutorials (Coming Soon)

- [ ] System overview
- [ ] Creating QR codes
- [ ] Managing campaigns
- [ ] Analytics walkthrough
- [ ] User management

---

## Support

**Need help?**
- 📧 Email: support@company.internal
- 📞 Phone: +1-XXX-XXX-XXXX
- 📚 Docs: Full README.md
- 🔧 IT: it@company.internal

---

## Resources

- **Full Documentation:** README.md
- **API Guide:** API_DOCUMENTATION.md
- **Security:** SECURITY.md
- **Deployment:** DEPLOYMENT.md
- **Features:** FEATURES.md

---

**You're all set! Start creating QR codes! 🎉**
