# AutoParts Marketplace - Laravel Multivendor Platform

A full-featured multivendor auto parts e-commerce platform built with Laravel 11, Tailwind CSS, and MySQL.

## Features

- **Multi-Role Authentication**: Separate dashboards for Admins, Vendors, and Customers.
- **Vendor Management**: Vendors can register, manage their own products, process orders, and track earnings.
- **Admin Control Panel**: Admins can approve vendors, manage categories/brands, set commission rates, and oversee all orders.
- **Advanced Product Filtering**: Customers can filter parts by Car Make, Model, and Year, as well as by category, brand, and price.
- **Shopping Cart & Checkout**: Full cart functionality with Stripe payment integration.
- **Order Tracking & Reviews**: Customers can track their orders and leave reviews for purchased products.
- **Coupons & Discounts**: Support for percentage and fixed-amount discount codes.

## Tech Stack

- **Framework**: Laravel 11 (PHP 8.2+)
- **Frontend**: Blade Templates + Tailwind CSS + Alpine.js
- **Database**: MySQL / SQLite
- **Authentication**: Laravel Breeze + Spatie Permission
- **Payments**: Stripe PHP SDK

## Installation Instructions

1. **Clone the repository**
   ```bash
   git clone <repository-url>
   cd autoparts-multivendor
   ```

2. **Install PHP Dependencies**
   ```bash
   composer install
   ```

3. **Install NPM Dependencies**
   ```bash
   npm install
   npm run build
   ```

4. **Environment Setup**
   ```bash
   cp .env.example .env
   php artisan key:generate
   ```

5. **Configure Database**
   Update your `.env` file with your database credentials:
   ```env
   DB_CONNECTION=mysql
   DB_HOST=127.0.0.1
   DB_PORT=3306
   DB_DATABASE=autoparts
   DB_USERNAME=root
   DB_PASSWORD=
   ```

6. **Configure Stripe (Optional)**
   Add your Stripe API keys to `.env` to enable payments:
   ```env
   STRIPE_KEY=pk_test_your_key
   STRIPE_SECRET=sk_test_your_secret
   ```

7. **Run Migrations and Seeders**
   This will create the database tables and populate them with demo data (admin, vendors, products, categories, etc.):
   ```bash
   php artisan migrate:fresh --seed
   ```

8. **Link Storage**
   ```bash
   php artisan storage:link
   ```

9. **Start the Development Server**
   ```bash
   php artisan serve
   ```

## Demo Accounts

The database seeder creates the following demo accounts (password for all is `password`):

- **Admin**: `admin@autoparts.com`
- **Vendor**: `vendor1@autoparts.com`
- **Customer**: `customer@autoparts.com`

## Directory Structure Highlights

- `app/Http/Controllers/Admin/`: Admin panel controllers
- `app/Http/Controllers/Vendor/`: Vendor dashboard controllers
- `app/Http/Controllers/Shop/`: Customer storefront controllers
- `resources/views/admin/`: Admin panel Blade templates
- `resources/views/vendor/`: Vendor dashboard Blade templates
- `resources/views/shop/`: Customer storefront Blade templates
- `database/migrations/`: Database schema definitions
- `database/seeders/`: Demo data generators

## License

This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
MIT).
