Fleets is a modern web application designed to help companies efficiently track fleet inspections, issues, and maintenance.
The motivation came from seeing traditional paper-based inspections at my company—making it tedious to track vehicle maintenance and usage.
This app was inspired by the CS50 Week 9 "finance" project and is built with Flask.
- User-friendly web interface for inspection and maintenance tracking
- Roles and permissions: Owner, Admin, and User with distinct access levels
- Vehicle management: Add, edit, or scan vehicle VINs (barcode scanning support)
- Inspection tracking: Digital checklists with automatic prompts for issues
- Maintenance projections: Upcoming maintenance alerts and visual graphs
- Responsive design: Usable on desktop and mobile devices
- Basic automated tests for main workflows
- Python 3.x
- Flask
- Flask-Session
Install requirements:
pip install flask flask-session-
Install the app as a module:
pip install -e .(Run this in your project’s root folder.)
-
Run with Flask CLI:
export FLASK_APP="fleets" flask run
Or run the app instance directly:
cd fleets python3 myapp.py -
Deploying on a WSGI Server: Add this to your server config:
import sys path = 'path/to/project/folder/fleets/' if path not in sys.path: sys.path.append(path) from myapp import app as application
Basic tests are included for authentication, users, vehicles, inspections, and database operations.
Install test requirements:
pip install pytest coverageRun tests:
pytestSample output:
================================== test session starts ==================================
platform linux -- Python 3.6.9, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/angel/repos/fleet-inspections, configfile: setup.cfg, testpaths: tests
collected 128 items
tests/test_auth.py .............. [ 10%]
tests/test_db.py .. [ 12%]
tests/test_factory.py .. [ 14%]
tests/test_inspec.py ................... [ 28%]
tests/test_pass.py ..................... [ 45%]
tests/test_users.py .............................. [ 68%]
tests/test_vehicles.py ........................................ [100%]
================================= 128 passed in 26.29s ==================================
The app is live (for demo) at: angelelz.pythonanywhere.com
- Company owner registers an account with company name, username, email, and password.
- Both client-side and server-side validation for all inputs.
- Errors are displayed as alerts and user input is preserved during correction.
- Owners log in with their credentials.
- The dashboard displays users and vehicles in the company.
- Tables are responsive and adapt to mobile screens.
- VIN data can be random for demo purposes.
- Owner: One per company (created at registration)
- Admin: Has same permissions as owner
- User: Cannot add/edit users or see vehicles tracking/inspection data
Owners/Admins can add/edit users via the navigation dropdown:
- Add/edit vehicles via the navigation menu
- All fields required except the tag
- Optionally scan VIN barcode using QuaggaJS with your phone camera
- Single checklist template, based on real inspection sheet
- All fields required
- Extra notes appear when an item is marked "not ok"
- Owners/Admins can view all vehicles, latest inspection dates, mileage, and next oil change projection
- Overdue vehicles are highlighted in red
- Interactive graph shows last 8 inspections and oil change projections for each vehicle, powered by Chart.js
- Click any vehicle row to view details and the latest 8 inspections (with issues)
- Graph updates to show only the selected vehicle
Feel free to open issues or pull requests for suggestions, improvements, or bugfixes.
If you find this project helpful, a star ⭐️ is appreciated!