# Cargo Management System

A professional cargo management system built with Laravel featuring beautiful UI/UX with Tailwind CSS.

## Features

✅ **Customer Management** - Store contact details, multiple addresses, and customer-specific notes
✅ **Rate Management** - Define rates by KG, CBM, or per carton with special negotiated rates
✅ **Booking Entry** - Capture shipment data (CNTR NO, dates, customer, delivery place) and cargo specifics
✅ **Shipment Status & Tracking** - Real-time location and progress tracking with status history
✅ **Invoice/PDF Report** - Generate professional PDF invoices with detailed charges
✅ **Operational Analytics** - Reports on CBM/KG shipped and shipment volume by delivery place

## Installation Steps

### 1. Install Dependencies
```bash
composer install
npm install
```

### 2. Environment Setup
```bash
copy .env.example .env
php artisan key:generate
```

### 3. Configure Database
Edit `.env` file and set your database credentials:
```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=cargo_management
DB_USERNAME=root
DB_PASSWORD=
```

### 4. Run Migrations
```bash
php artisan migrate
```

### 5. Install PDF Library
```bash
composer require barryvdh/laravel-dompdf
```

### 6. Publish PDF Config (Optional)
```bash
php artisan vendor:publish --provider="Barryvdh\DomPDF\ServiceProvider"
```

### 7. Build Assets
```bash
npm run build
```

### 8. Start Development Server
```bash
php artisan serve
```

Visit: http://localhost:8000

## Usage

### Dashboard
- View total bookings, customers, active shipments, and delivered shipments
- See shipment status distribution chart
- View recent bookings

### Customer Management
- Add new customers with complete contact information
- Edit and manage customer records
- Store multiple addresses and notes

### Rate Management
- Create general or customer-specific rates
- Define rates by KG, CBM, or Per Carton
- Set special negotiated rates
- Manage rate validity periods

### Booking Management
- Create new bookings with CNTR numbers
- Track pickup and delivery dates
- Record cargo details (weight, volume, carton count)
- Update shipment status
- Download PDF invoices

### Shipment Tracking
- Track shipments by CNTR number
- View complete tracking history
- See current location and status

## Technology Stack

- **Backend**: Laravel 11
- **Frontend**: Tailwind CSS, Alpine.js
- **Database**: MySQL
- **PDF Generation**: DomPDF
- **Charts**: Chart.js
- **Icons**: Font Awesome

## Default Routes

- `/` - Dashboard
- `/customers` - Customer Management
- `/rates` - Rate Management
- `/bookings` - Booking Management
- `/track` - Shipment Tracking

## Security

- CSRF Protection enabled
- Input validation on all forms
- SQL injection prevention via Eloquent ORM

## Support

For issues or questions, please contact the development team.

---

Built with ❤️ using Laravel & Tailwind CSS
