A full-stack web application that diagnoses Electric Vehicle faults using an ensemble ML model. Users describe symptoms in plain English and receive instant, accurate diagnoses with confidence scores and step-by-step troubleshooting guides.
| Layer | Tech | Hosting |
|---|---|---|
| Frontend | React + Vite | Netlify |
| Backend | FastAPI (Python) | Render |
| Database | SQLite (SQLAlchemy ORM) | Bundled with backend |
| ML Model | Scikit-Learn Ensemble (LR + SGD + NB) | Trained at startup |
- Ensemble ML Model — 3 classifiers (Logistic Regression, SGD, Naive Bayes) with weighted averaging
- Wrong Input Detection — Keyword validation + confidence threshold rejects gibberish/unrelated text
- Temperature-Scaled Confidence — Realistic, calibrated confidence scores
- 127+ Fault Codes across 16 EV subsystems
- Feedback System — Users can rate diagnosis accuracy
- Search History — Recent diagnoses displayed in a table
- Premium Dark UI — Glassmorphism, animations, responsive design
evDOCTOR/
├── backend/
│ ├── main.py # FastAPI app & API endpoints
│ ├── database.py # SQLAlchemy engine & session setup
│ ├── models.py # ORM models (FaultCode, SearchHistory, Feedback)
│ ├── schemas.py # Pydantic request/response validation
│ ├── ml_engine.py # Ensemble ML engine with OOD detection
│ ├── init_db.py # CSV → SQLite database seeder
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── src/
│ │ ├── App.jsx # Main React component
│ │ ├── App.css # Premium styling
│ │ └── index.css # Base styles
│ ├── netlify.toml # Netlify deployment config
│ └── .env # API URL environment variable
├── EV_DTC_Dataset.csv # Master fault code dataset
├── Procfile # Render deployment config
└── README.md
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python init_db.py
uvicorn main:app --reload --port 8000cd frontend
npm install
npm run devFrontend runs at http://localhost:5173, Backend at http://localhost:8000.
- Create a Web Service on Render
- Set Root Directory to
backend - Set Build Command:
pip install -r requirements.txt - Set Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT - Set env var
FRONTEND_URLto your Netlify URL
- Connect your GitHub repo to Netlify
- Set Base Directory to
frontend - Set Build Command:
npm run build - Set Publish Directory:
frontend/dist - Set env var
VITE_API_URLtohttps://your-render-backend.onrender.com/api
The database layer (models.py, database.py) demonstrates:
- Primary Keys, Foreign Keys, Unique Constraints
- CHECK Constraints, NOT NULL, Default Values
- Indexes (single + composite), Relationships (1:N)
- Cascade Delete, ON DELETE SET NULL
- Session management, Connection pooling
- Foreign key enforcement in SQLite via PRAGMA