# PMMS Laravel Setup

This project is configured for XAMPP on `D:\xampp` and the MariaDB database `pmms_testing`.

## Start XAMPP

1. Open XAMPP Control Panel.
2. Start Apache and MySQL.

## Database

The database has already been created and seeded locally:

```powershell
D:\xampp\mysql\bin\mysql.exe -uroot -e "CREATE DATABASE IF NOT EXISTS pmms_testing CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
D:\xampp\php\php.exe artisan migrate:fresh --seed --force
```

You can also run `database_setup.sql` in phpMyAdmin, then run the migration command above.

## Run The App

Double-click `start-pmms.bat`, or run:

```powershell
D:\xampp\php\php.exe artisan serve --host=127.0.0.1 --port=8010
```

Open:

```text
http://127.0.0.1:8010
```

Port `8000` is already being used by another local PHP app on this machine, so PMMS uses port `8010`.

## Seeded Demo Data

- Admin user: `admin@pmms.test`
- Password: `password`
- Materials, products, BOMs, vendors, one purchase order, one work order, one customer, and one sales order are seeded for testing.
- The app now requires login and includes a Users & Permissions module for adding multiple factory users.

## Main Modules

- Dashboard
- Raw materials and stock movements
- Products, BOM, costing, and suggested pricing
- MRP shortage planning
- Procurement and PO receiving
- Production work orders
- QC checkpoints and inspection logs
- Sales orders with automatic work-order trigger for shortfalls
- Reports and CSV stock export
- Users and module-level permissions
