SplashFleet is a complete multi-tenant SaaS platform for fleet and vehicle management built with pure PHP and MySQL. It provides comprehensive tools for managing vehicles, drivers, trips, fuel consumption, maintenance, spare parts, and generating insightful reports.
- Multi-Tenant Architecture: Single database, complete tenant isolation
- Vehicle Management: Track vehicles, documents, registration, insurance
- Driver Management: Manage drivers, licenses, documents, incidents
- Trip Tracking: Log trips, calculate distances, track usage
- Fuel Management: Record fuel entries, analyze consumption, detect anomalies
- Maintenance System: Schedule preventive maintenance, manage work orders, track costs
- Spare Parts Inventory: Track parts, movements, low stock alerts
- Alert System: Automated alerts for expiring documents, overdue maintenance
- Reporting: Vehicle utilization, fuel consumption, maintenance costs, CSV export
- Subscription Management: Multiple plans with usage quotas
- Billing: Invoice and payment tracking
- REST API: External integration for mobile apps and GPS systems
- PHP 7.0+ Compatible: Works on PHP 7.x through 8.x
- Custom Lightweight MVC: No framework dependencies
- Role-Based Access Control: 8 different user roles
- CSRF Protection: Secure forms and API endpoints
- Session Management: Secure authentication
- File Upload: Document management with validation
- Pagination: Efficient data browsing
- Activity Logging: Comprehensive audit trail
- Multi-Currency Support: Configurable per tenant
- PHP 7.0 or higher
- MySQL 5.7+ or MariaDB 10.2+
- Apache or Nginx web server
- PHP Extensions: pdo_mysql, mbstring, openssl, json, fileinfo
-
Clone the repository
git clone <repository-url> cd SplashFleet
-
Configure environment
cp .env.example .env
Edit
.envand configure your database:DB_HOST=localhost DB_NAME=splashfleet DB_USER=root DB_PASS=your_password BASE_URL=http://localhost -
Create database and import schema
mysql -u root -p
CREATE DATABASE splashfleet CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; exit;
mysql -u root -p splashfleet < database.sql -
Set file permissions
chmod -R 755 storage/uploads chmod -R 755 storage/logs
-
Configure web server
Apache (.htaccess already included):
<VirtualHost *:80> DocumentRoot "/path/to/SplashFleet/public" ServerName splashfleet.local <Directory "/path/to/SplashFleet/public"> AllowOverride All Require all granted </Directory> </VirtualHost>
Nginx:
server { listen 80; server_name splashfleet.local; root /path/to/SplashFleet/public; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
-
Access the application
- Navigate to:
http://localhostorhttp://splashfleet.local - Login with demo credentials:
- Platform Admin: admin@splashfleet.com / admin123
- Tenant Admin (Acme): john@acmelogistics.com / password123
- Tenant Admin (Swift): jane@swifttransport.com / password123
- Navigate to:
The system uses the following main tables:
tenants- Company/organization accountsusers- System users with role-based accessplans- Subscription planstenant_subscriptions- Active subscriptionstenant_api_keys- API authentication keys
vehicles- Vehicle information and statusvehicle_documents- Registration, insurance, inspection docsdrivers- Driver information and licensesdriver_documents- License, ID, certificationstrips- Trip logs with odometer readingsfuel_entries- Fuel refill recordsfuel_cards- Fuel card assignments
service_types- Maintenance service definitionsservice_schedules- Scheduled maintenance plansmaintenance_orders- Work ordersmaintenance_order_items- Labor and parts usedspare_parts- Parts inventoryspare_part_movements- Stock movements
alerts- System alerts and notificationsnotifications- Email notification queueinvoices- Billing invoicespayments- Payment recordsactivity_logs- Audit trail
| Role | Description | Key Permissions |
|---|---|---|
platform_admin |
SaaS platform owner | Manage all tenants, view system-wide metrics |
tenant_admin |
Fleet administrator | Full control within tenant, manage users |
fleet_manager |
Fleet operations | Manage vehicles, drivers, trips, alerts |
maintenance_manager |
Maintenance operations | Manage maintenance, schedules, spare parts |
fuel_manager |
Fuel operations | Manage fuel entries, analyze consumption |
driver_manager |
Driver operations | Manage drivers, documents, assignments |
accountant |
Financial reporting | View costs, reports, invoices |
viewer |
Read-only access | View data, no modifications |
All API requests require an API key in the X-API-KEY header.
curl -H "X-API-KEY: your_api_key_here" http://localhost/api/vehicles/listGET /api/vehicles/list
Query Parameters:
status(optional): Filter by statuscategory(optional): Filter by category
Response:
{
"status": "success",
"data": [
{
"id": 1,
"plate_number": "ABC-1234",
"make": "Ford",
"model": "Transit",
"year": 2022,
"status": "active",
"current_odometer": 15000.00,
"fuel_type": "diesel"
}
]
}POST /api/trips/create
Request Body:
{
"vehicle_plate_number": "ABC-1234",
"driver_identifier": "DRV001",
"trip_type": "delivery",
"start_datetime": "2025-01-15 08:00:00",
"end_datetime": "2025-01-15 12:00:00",
"start_odometer": 15000.00,
"end_odometer": 15080.00,
"start_location": "Warehouse A",
"end_location": "Client Site B",
"purpose": "Package delivery"
}Response:
{
"status": "success",
"trip_id": 123,
"distance_travelled": 80.00
}POST /api/fuel/add
Request Body:
{
"vehicle_plate_number": "ABC-1234",
"driver_identifier": "DRV001",
"fuel_type": "diesel",
"quantity": 45.50,
"quantity_unit": "liters",
"price_per_unit": 1.75,
"total_cost": 79.63,
"vendor_name": "Shell Station",
"odometer_reading": 15050.00,
"date": "2025-01-15"
}Response:
{
"status": "success",
"fuel_entry_id": 456
}Execute the test suite:
# Database connection test
php tests/DatabaseTest.php
# Model CRUD tests
php tests/ModelTest.phpAdd these to your crontab for automated tasks:
# Generate alerts daily at 6 AM
0 6 * * * cd /path/to/SplashFleet && php -r "require 'app/core/Database.php'; require 'app/core/Model.php'; require 'app/models/Alert.php'; \$alert = new Alert(); \$alert->generateExpiryAlerts(1, 30); \$alert->generateMaintenanceAlerts(1);"
# Process pending notifications every hour
0 * * * * cd /path/to/SplashFleet && php cron/process_notifications.php
# Clean old logs weekly
0 0 * * 0 find /path/to/SplashFleet/storage/logs -name "*.log" -mtime +30 -delete-
Set environment to production in
.env:APP_ENV=production APP_DEBUG=false -
Enable HTTPS: Use Let's Encrypt or SSL certificate
-
Secure file permissions:
chown -R www-data:www-data storage/ chmod -R 755 storage/
-
Database optimization:
- Enable query caching
- Add indexes for frequently queried columns
- Regular backups
-
PHP optimization:
- Enable OPcache
- Increase memory_limit if needed
- Set appropriate upload_max_filesize
-
Security:
- Change default passwords
- Restrict database access
- Enable firewall rules
- Regular security updates
SplashFleet/
├── app/
│ ├── controllers/ # Request handlers
│ ├── models/ # Data layer
│ ├── views/ # Templates
│ ├── core/ # Framework core
│ └── helpers/ # Utility classes
├── config/ # Configuration
├── public/ # Web root
│ ├── index.php # Entry point
│ └── assets/ # CSS, JS, images
├── storage/ # Uploads and logs
├── tests/ # Test suite
└── database.sql # Database schema
- Singleton: Database, Auth, Session
- Factory: Model instantiation
- MVC: Clean separation of concerns
- Repository: Data access abstraction
- Starter: 10 vehicles, 5 users, 500 trips/month
- Professional: 50 vehicles, 20 users, 2000 trips/month
- Enterprise: Unlimited resources
The system automatically checks quotas before:
- Creating new vehicles
- Adding users
- Recording trips
- Creating maintenance orders
Users are notified when approaching or exceeding limits.
- Password Hashing: bcrypt (password_hash/password_verify)
- CSRF Protection: Token validation on all forms
- SQL Injection Prevention: Prepared statements only
- XSS Protection: Output escaping (htmlspecialchars)
- Session Security: Regeneration on login
- File Upload Validation: MIME type and extension checks
- Tenant Isolation: All queries scoped by tenant_id
- Activity Logging: Comprehensive audit trail
- Issues: Report bugs and feature requests via GitHub Issues
- Documentation: Full documentation in
/docsfolder - License: MIT License
- GPS Integration: Real-time vehicle tracking
- Mobile App: iOS and Android applications
- Telematics: Integration with vehicle telematics systems
- Advanced Analytics: Machine learning for predictive maintenance
- Multi-language: i18n support
- Email Notifications: SMTP integration
- Payment Gateway: Stripe/PayPal integration
- Document OCR: Automatic data extraction from receipts
SplashFleet - Professional Fleet Management Made Simple
For questions and support, please open an issue on GitHub.