A comprehensive Flask-based web application for managing vehicle fleets, maintenance logs, and document tracking in logistics operations.
- Vehicle Registration: Add new vehicles with detailed information (make, model, year, VIN, color, category, plate number)
- Vehicle Details: View comprehensive vehicle information including images
- Vehicle Updates: Edit vehicle information and details
- Vehicle Deletion: Remove vehicles from the fleet
- Fuel Tracking: Monitor fuel levels and last fueled dates
- Maintenance Logs: Record and track maintenance activities
- Maintenance History: View complete maintenance history for each vehicle
- Maintenance Alerts: Automatic alerts for overdue maintenance (2+ weeks)
- Document Upload: Store vehicle-related documents (insurance, registration, etc.)
- Document Tracking: Monitor document expiry dates
- Document Updates: Edit document information and expiry dates
- Document Deletion: Remove outdated documents
- Low Fuel Alerts: Automatic notifications for vehicles with low fuel
- Maintenance Reminders: Alerts for vehicles requiring maintenance
- Document Expiry Warnings: Notifications for expiring documents
- Backend: Flask (Python)
- Database: PostgreSQL
- Frontend: HTML, CSS, JavaScript
- Database Adapter: psycopg2
Before running this application, make sure you have:
- Python 3.7 or higher
- PostgreSQL database server
- pip (Python package installer)
-
Clone the repository
git clone <your-repository-url> cd LOGISTICS
-
Install Python dependencies
pip install -r requirements.txt
-
Set up PostgreSQL Database
- Create a new PostgreSQL database named
logistics_db - Update the database connection string in
app.py:DATABASE_URL = "postgresql://username:password@localhost:5432/logistics_db"
- Create a new PostgreSQL database named
-
Run the application
python app.py
-
Access the application
- Open your web browser and navigate to
http://localhost:5000
- Open your web browser and navigate to
LOGISTICS/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── README.md # Project documentation
├── static/ # Static assets
│ ├── style/ # CSS files
│ └── script/ # JavaScript files
├── templates/ # HTML templates
│ ├── index.html # Main vehicle registration page
│ └── vehicle_details.html # Vehicle details page
└── .git/ # Git repository
GET /- Main vehicle registration pageGET /vehicle_details/<vehicle_id>- Vehicle details pageGET /api/cars- Get all vehicles with alertsGET /api/vehicles/<vehicle_id>/details- Get detailed vehicle informationPOST /api/register_vehicle- Register a new vehiclePUT /api/vehicles/<vehicle_id>- Update vehicle informationDELETE /api/vehicles/<vehicle_id>- Delete a vehicle
POST /api/vehicles/<vehicle_id>/maintenance- Add maintenance logDELETE /api/maintenance_logs/<log_id>- Delete maintenance log
POST /api/vehicles/<vehicle_id>/documents- Upload documentPUT /api/documents/<document_id>- Update documentDELETE /api/documents/<document_id>- Delete document
id- Primary keymodel,year,make- Vehicle specificationsvin- Vehicle Identification Number (unique)color,category,plate_number- Additional detailsmain_image_base64- Vehicle image (base64 encoded)last_fueled_date,fuel_level- Fuel trackingcreated_at,updated_at- Timestamps
id- Primary keyvehicle_id- Foreign key to vehicleslog_type,log_date,notes- Maintenance detailscreated_at- Timestamp
id- Primary keyvehicle_id- Foreign key to vehiclesdocument_name,file_content_base64- Document detailsfile_mime_type,expiry_date- Document metadatauploaded_at- Timestamp
Update the DATABASE_URL in app.py with your PostgreSQL credentials:
DATABASE_URL = "postgresql://username:password@localhost:5432/logistics_db"For production deployment, consider using environment variables:
export DATABASE_URL="postgresql://username:password@localhost:5432/logistics_db"
export FLASK_ENV="production"python app.pyFor production deployment, consider using:
- Gunicorn or uWSGI as WSGI server
- Nginx as reverse proxy
- Environment variables for configuration
- SSL certificates for HTTPS
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the existing issues in the repository
- Create a new issue with detailed information
- Contact the development team
- v1.0.0 - Initial release with basic vehicle management
- v1.1.0 - Added maintenance tracking and alerts
- v1.2.0 - Added document management system
- v1.3.0 - Enhanced alert system and UI improvements
Built with ❤️ for efficient logistics management