# SCMS Backend

Node.js + Express + MySQL backend for Supply Chain Management System.

## Endpoints
- `POST /api/auth/register`
- `POST /api/auth/login`
- Protected APIs (JWT required):
  - `POST /api/suppliers`, `GET /api/suppliers`, `GET /api/suppliers/:supplierCode`
  - `POST /api/shipments`, `GET /api/shipments`, `GET /api/shipments/:shipmentNumber`, `PUT /api/shipments/:shipmentNumber`, `DELETE /api/shipments/:shipmentNumber`
  - `POST /api/deliveries`, `GET /api/deliveries`, `GET /api/deliveries/:deliveryCode`, `PUT /api/deliveries/:deliveryCode`, `DELETE /api/deliveries/:deliveryCode`
  - Reports: `GET /api/reports/daily/:date`, `GET /api/reports/weekly/:weekStart`, `GET /api/reports/monthly/:year/:month`

## Run
1. Configure `.env`
2. `npm install`
3. `npm run dev`

MySQL schema is automatically created on first run.

