Skip to content

arush-07/Team-Bitwise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— Automotive Predictive Maintenance System

A comprehensive AI-powered automotive maintenance system with user authentication, vehicle management, predictive analytics, and service tracking.

✨ Features

πŸ” User Authentication

  • Secure JWT-based login/registration
  • User profile management
  • Session persistence with token verification

πŸš— Vehicle Management

  • Car number registration and management
  • Complete vehicle details (brand, model, year, odometer)
  • Vehicle search and filtering
  • CRUD operations for vehicle management

πŸ€– AI-Powered Predictions

  • 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

πŸ“‹ Service Records & Feedback

  • 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

πŸ“Š Dashboard & Analytics

  • Real-time vehicle health status
  • AI-generated maintenance recommendations
  • Service cost analysis and frequency tracking
  • Feedback analytics with issue patterns

πŸ› οΈ Technology Stack

Backend

  • 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)

Frontend

  • React - Modern UI framework
  • React Router - Client-side routing
  • Tailwind CSS - Utility-first styling
  • Lucide React - Beautiful icons
  • Axios - HTTP client with interceptors

AI/ML Features

  • RandomForest Classifier - Failure prediction
  • Issue Classification - Multi-class problem solving
  • Feature Engineering - Derived features for better accuracy
  • Cross-validation - Model validation and performance metrics

πŸš€ Quick Start

Method 1: Automated Setup (Recommended)

  1. Run the complete setup script:

    python setup_complete.py
  2. Start the application:

    # Option 1: Start both servers
    run_app.bat
    
    # Option 2: Start separately
    run_backend.bat
    run_frontend.bat

Method 2: Manual Setup

Prerequisites

  • Python 3.8+
  • Node.js 16+
  • npm (comes with Node.js)

Backend Setup

  1. Navigate to backend directory:

    cd automotive-maintenance/backend
  2. Create virtual environment:

    python -m venv venv
  3. Activate virtual environment:

    # Windows
    venv\Scripts\activate
    
    # macOS/Linux
    source venv/bin/activate
  4. Install dependencies:

    pip install -r requirements.txt
  5. Initialize database:

    python init_data.py
  6. Run the backend:

    python main.py

Frontend Setup

  1. Navigate to frontend directory:

    cd automotive-maintenance/frontend
  2. Install dependencies:

    npm install
  3. Start development server:

    npm run dev

🌐 Access Points

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

πŸ”‘ Default Login Credentials

  • Username: demo_user
  • Password: demo123

πŸ“ Project Structure

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

πŸ”§ API Endpoints

Authentication

  • POST /auth/register - User registration
  • POST /auth/login - User login
  • GET /auth/me - Get current user
  • GET /auth/verify-token - Verify token validity

Vehicles

  • GET /vehicles/ - Get user's vehicles
  • POST /vehicles/ - Add new vehicle
  • GET /vehicles/{vehicle_id} - Get specific vehicle
  • PUT /vehicles/{vehicle_id} - Update vehicle
  • DELETE /vehicles/{vehicle_id} - Delete vehicle
  • GET /vehicles/search/{query} - Search vehicles

Predictions

  • POST /predict/vehicle - Get vehicle predictions
  • GET /predict/health - System health check

Service Records

  • GET /service-records/vehicle/{vehicle_id} - Get vehicle service records
  • POST /service-records/ - Create service record
  • GET /service-records/analytics/vehicle/{vehicle_id} - Get service analytics
  • POST /service-records/feedback - Create feedback
  • GET /service-records/feedback/vehicle/{vehicle_id} - Get vehicle feedback

πŸ€– AI Model Details

Enhanced Features

  • 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

Model Performance

  • 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

Issue Classification

  • Multi-class Problem: 8 different issue types
  • Severity Levels: 4 severity categories
  • Cost Estimation: Realistic cost ranges
  • Action Recommendations: Specific repair suggestions

πŸ“Š Database Schema

Core Tables

  • 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

Relationships

  • Users β†’ Vehicles (One-to-Many)
  • Vehicles β†’ Service Records (One-to-Many)
  • Vehicles β†’ Feedback (One-to-Many)
  • Service Records β†’ Feedback (One-to-Many)

πŸ”’ Security Features

  • 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

🎨 UI/UX Features

  • 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

πŸ› Troubleshooting

Common Issues

  1. Backend won't start:

    # Check Python version
    python --version
    
    # Reinstall dependencies
    pip install -r requirements.txt --force-reinstall
  2. Frontend won't start:

    # Clear npm cache
    npm cache clean --force
    
    # Delete node_modules and reinstall
    rm -rf node_modules
    npm install
  3. Database errors:

    # Delete database and reinitialize
    rm automotive_maintenance.db
    python init_data.py
  4. Authentication issues:

    • Clear browser localStorage
    • Check if backend is running on port 8000
    • Verify CORS settings

Port Conflicts

If ports 3000 or 8000 are in use:

Backend (change port 8000):

uvicorn main:app --reload --host 0.0.0.0 --port 8001

Frontend (change port 3000):

npm run dev -- --port 3001

πŸ“ˆ Future Enhancements

  • 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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

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

🎯 Getting Started Checklist

  • Install Python 3.8+ and Node.js 16+
  • Run python setup_complete.py for automated setup
  • Start backend: run_backend.bat or python main.py
  • Start frontend: run_frontend.bat or npm run dev
  • Open http://localhost:3000 in browser
  • Login with demo_user / demo123
  • Add your first vehicle
  • Explore AI predictions and features

🎊 You're all set! Enjoy the automotive maintenance system!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors