# SaleZone Multi-Vendor Ecommerce - Installation Guide

## Quick Start Guide

### Prerequisites
✅ XAMPP/WAMP installed with PHP 8.1+  
✅ MySQL database server running  
✅ Composer installed globally  

### Step-by-Step Installation

#### 1. Import Database
Open phpMyAdmin (http://localhost/phpmyadmin)
- Username: `salezone_pos2user`
- Password: `20r448sci1hrgxd6`
- Import: `database/salezone_pos2db.sql`

#### 2. Install Dependencies
```bash
cd b:\xampp\htdocs\salezone
composer install
```

#### 3. Generate Application Key
```bash
php artisan key:generate
```

#### 4. Create Storage Link
```bash
php artisan storage:link
```

#### 5. Clear Cache
```bash
php artisan config:clear
php artisan cache:clear
php artisan route:clear
php artisan view:clear
```

#### 6. Start Server
```bash
php artisan serve
```

Or access via XAMPP: `http://localhost/salezone/public`

### Default Login Credentials

**Admin Login:**
- URL: http://localhost:8000/login
- Email: customercare@salezone.in
- Password: (Check database `users` table, ID: 1)

### Testing the Application

1. **Frontend:** http://localhost:8000
2. **Admin Panel:** http://localhost:8000/admin/dashboard
3. **API:** http://localhost:8000/api/v1/products

### File Permissions (Linux/Mac)

```bash
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache
```

### Troubleshooting

**Issue: 500 Internal Server Error**
```bash
php artisan config:clear
php artisan cache:clear
```

**Issue: Database Connection Failed**
- Check MySQL is running
- Verify credentials in `.env` file
- Ensure database exists

**Issue: Class not found**
```bash
composer dump-autoload
```

**Issue: Storage permission denied**
```bash
# Windows: Run as Administrator
# Linux/Mac:
chmod -R 775 storage bootstrap/cache
```

### Project URLs

| Panel | URL |
|-------|-----|
| Home | http://localhost:8000 |
| Shop | http://localhost:8000/shop |
| Reels | http://localhost:8000/reels |
| Login | http://localhost:8000/login |
| Register | http://localhost:8000/register |
| Admin | http://localhost:8000/admin/dashboard |
| Seller | http://localhost:8000/seller/dashboard |
| Customer | http://localhost:8000/customer/dashboard |

### API Testing

**Get Products:**
```bash
curl http://localhost:8000/api/v1/products
```

**Get Categories:**
```bash
curl http://localhost:8000/api/v1/categories
```

**Get Reels:**
```bash
curl http://localhost:8000/api/v1/reels
```

### Features Implemented

✅ **Authentication System**
- Multi-role login (Admin, Seller, Customer, Delivery Boy)
- Registration with role selection
- Role-based access control

✅ **Admin Panel**
- Dashboard with analytics
- Vendor management
- Product approval system
- Order management
- Reel management

✅ **Seller Panel**
- Product management
- Order tracking
- Dashboard analytics

✅ **Customer Panel**
- Order history
- Wallet management
- Loyalty points

✅ **Frontend**
- Homepage with categories
- Product listing and detail pages
- Shopping cart
- Reels page
- Search functionality

✅ **REST API**
- Product endpoints
- Category endpoints
- Reel endpoints
- Search functionality

### Database Tables Used

- users
- contacts (vendors/customers)
- products
- transactions (orders)
- online_store_reels
- online_store_coupons
- online_store_banners
- categories
- brands
- variations
- And 50+ more existing tables

### Next Steps

1. **Configure Email:** Set up SMTP in `.env` for email notifications
2. **Payment Gateway:** Integrate Razorpay/PayPal
3. **Storage:** Configure file storage for production
4. **SMS Gateway:** Set up OTP verification
5. **Deploy:** Deploy to production server

### Support

For issues or questions:
- Check the main README.md
- Review Laravel documentation
- Check error logs: `storage/logs/laravel.log`

---

**Installation Complete! 🎉**

You now have a fully functional multi-vendor ecommerce platform with:
- 18 Models
- 15 Controllers  
- 4 Middleware
- 6 View Templates
- Complete routing system
- REST API endpoints

Happy coding!
