A comprehensive AI-powered automotive maintenance system with user authentication, vehicle management, predictive analytics, and service tracking.
- Secure JWT-based login/registration
- User profile management
- Session persistence with token verification
- Car number registration and management
- Complete vehicle details (brand, model, year, odometer)
- Vehicle search and filtering
- CRUD operations for vehicle management
- Enhanced RandomForest ML model with feature engineering
- Issue classification (engine, transmission, brake, electrical, etc.)
- Severity assessment (low, medium, high, critical)
- Cost estimation for different issues
- Risk scoring with confidence levels
- Complete service history tracking
- Service analytics (cost, frequency, next service due)
- Feedback system with 1-5 star ratings
- Issue tracking and resolution documentation
- Service types: routine, emergency, predictive
- Real-time vehicle health status
- AI-generated maintenance recommendations
- Service cost analysis and frequency tracking
- Feedback analytics with issue patterns
- FastAPI - Modern Python web framework
- SQLAlchemy - Database ORM with relationships
- JWT Authentication - Secure token-based auth
- Scikit-learn - Machine learning models
- Pandas & NumPy - Data processing
- SQLite - Database (easily upgradeable to PostgreSQL)
- React - Modern UI framework
- React Router - Client-side routing
- Tailwind CSS - Utility-first styling
- Lucide React - Beautiful icons
- Axios - HTTP client with interceptors
- RandomForest Classifier - Failure prediction
- Issue Classification - Multi-class problem solving
- Feature Engineering - Derived features for better accuracy
- Cross-validation - Model validation and performance metrics
-
Run the complete setup script:
python setup_complete.py
-
Start the application:
# Option 1: Start both servers run_app.bat # Option 2: Start separately run_backend.bat run_frontend.bat
- Python 3.8+
- Node.js 16+
- npm (comes with Node.js)
-
Navigate to backend directory:
cd automotive-maintenance/backend -
Create virtual environment:
python -m venv venv
-
Activate virtual environment:
# Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Initialize database:
python init_data.py
-
Run the backend:
python main.py
-
Navigate to frontend directory:
cd automotive-maintenance/frontend -
Install dependencies:
npm install
-
Start development server:
npm run dev
Once both servers are running:
- Frontend Application:
http://localhost:3000 - Backend API:
http://127.0.0.1:8000 - API Documentation:
http://127.0.0.1:8000/docs
- Username:
demo_user - Password:
demo123
automotive-maintenance/
βββ backend/
β βββ ai/
β β βββ train_model.py # Enhanced ML training
β β βββ predict_model.py # AI prediction engine
β βββ routers/
β β βββ auth.py # Authentication endpoints
β β βββ vehicles.py # Vehicle management
β β βββ service_records.py # Service & feedback
β β βββ prediction.py # AI predictions
β β βββ feedback.py # Legacy feedback
β β βββ schedule.py # Service booking
β βββ database.py # Database models & setup
β βββ schemas.py # Pydantic schemas
β βββ auth.py # Authentication utilities
β βββ init_data.py # Database initialization
β βββ main.py # FastAPI application
β βββ requirements.txt # Python dependencies
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ AuthModal.jsx # Login/Register modal
β β β βββ VehicleManagement.jsx # Vehicle CRUD
β β β βββ ServiceRecords.jsx # Service tracking
β β β βββ Navbar.jsx # Navigation
β β β βββ Footer.jsx # Footer
β β β βββ Loader.jsx # Loading component
β β βββ pages/
β β β βββ Dashboard.jsx # Main dashboard
β β β βββ Feedback.jsx # Feedback page
β β β βββ Schedule.jsx # Service booking
β β βββ services/
β β β βββ api.js # API client
β β βββ App.jsx # Main app component
β β βββ main.jsx # React entry point
β βββ package.json # Node dependencies
βββ README.md # This file
POST /auth/register- User registrationPOST /auth/login- User loginGET /auth/me- Get current userGET /auth/verify-token- Verify token validity
GET /vehicles/- Get user's vehiclesPOST /vehicles/- Add new vehicleGET /vehicles/{vehicle_id}- Get specific vehiclePUT /vehicles/{vehicle_id}- Update vehicleDELETE /vehicles/{vehicle_id}- Delete vehicleGET /vehicles/search/{query}- Search vehicles
POST /predict/vehicle- Get vehicle predictionsGET /predict/health- System health check
GET /service-records/vehicle/{vehicle_id}- Get vehicle service recordsPOST /service-records/- Create service recordGET /service-records/analytics/vehicle/{vehicle_id}- Get service analyticsPOST /service-records/feedback- Create feedbackGET /service-records/feedback/vehicle/{vehicle_id}- Get vehicle feedback
- Service Frequency: Services per year calculation
- Cost Per Service: Average cost analysis
- Mileage Per Year: Usage pattern analysis
- High Mileage Flag: Binary feature for high usage
- Old Vehicle Flag: Age-based categorization
- Cross-validation: 5-fold CV for robust evaluation
- Feature Importance: Identifies most predictive features
- Confusion Matrix: Detailed performance analysis
- Classification Report: Precision, recall, F1-score
- Multi-class Problem: 8 different issue types
- Severity Levels: 4 severity categories
- Cost Estimation: Realistic cost ranges
- Action Recommendations: Specific repair suggestions
- users: User authentication and profile data
- vehicles: Vehicle information and ownership
- service_records: Complete service history
- feedback: Service feedback and ratings
- service_bookings: Service appointment scheduling
- issue_classifications: AI-generated issue patterns
- Users β Vehicles (One-to-Many)
- Vehicles β Service Records (One-to-Many)
- Vehicles β Feedback (One-to-Many)
- Service Records β Feedback (One-to-Many)
- JWT Authentication: Secure token-based auth
- Password Hashing: bcrypt for password security
- CORS Protection: Configured for frontend domains
- Input Validation: Pydantic schemas for data validation
- SQL Injection Protection: SQLAlchemy ORM protection
- Responsive Design: Mobile-first approach
- Modern Interface: Clean, professional design
- Real-time Updates: Live data refresh
- Loading States: User-friendly loading indicators
- Error Handling: Comprehensive error management
- Accessibility: WCAG compliant components
-
Backend won't start:
# Check Python version python --version # Reinstall dependencies pip install -r requirements.txt --force-reinstall
-
Frontend won't start:
# Clear npm cache npm cache clean --force # Delete node_modules and reinstall rm -rf node_modules npm install
-
Database errors:
# Delete database and reinitialize rm automotive_maintenance.db python init_data.py -
Authentication issues:
- Clear browser localStorage
- Check if backend is running on port 8000
- Verify CORS settings
If ports 3000 or 8000 are in use:
Backend (change port 8000):
uvicorn main:app --reload --host 0.0.0.0 --port 8001Frontend (change port 3000):
npm run dev -- --port 3001- Real-time Notifications: Push notifications for service reminders
- Mobile App: React Native mobile application
- Advanced Analytics: Machine learning insights dashboard
- Integration APIs: Third-party service center integration
- Multi-language Support: Internationalization
- Cloud Deployment: AWS/Azure deployment options
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the troubleshooting section above
- Review the API documentation at
/docs
Built with β€οΈ for automotive maintenance professionals
- Install Python 3.8+ and Node.js 16+
- Run
python setup_complete.pyfor automated setup - Start backend:
run_backend.batorpython main.py - Start frontend:
run_frontend.batornpm run dev - Open
http://localhost:3000in browser - Login with
demo_user/demo123 - Add your first vehicle
- Explore AI predictions and features
π You're all set! Enjoy the automotive maintenance system!