Before you begin, ensure you have installed:
cd "C:\Users\patil\OneDrive\Desktop\Projects\Minor Project\ev-charging-scheduler"Windows:
cd backend
python -m venv venv
venv\Scripts\activatemacOS/Linux:
cd backend
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtpython generate_data.pyExpected output:
✓ Saved charging_stations.csv with 50 records
✓ Saved ev_demand_patterns.csv with 10000 records
✓ Saved grid_load_data.csv with 8760 records
✓ Saved energy_pricing.csv with 2190 records
✓ Saved ev_specifications.csv with 8 records
python train_models.pyExpected output:
Training Demand Prediction Model...
Train R² Score: 0.xx
Test R² Score: 0.xx
✓ Saved demand_predictor.pkl
Training Range Prediction Model...
Train R² Score: 0.xx
Test R² Score: 0.xx
✓ Saved range_predictor.pkl
Training Grid Load Forecasting Model...
Train R² Score: 0.xx
Test R² Score: 0.xx
✓ Saved grid_load_forecaster.pkl
uvicorn main:app --reloadBackend will be running at: http://localhost:8000
API Documentation: http://localhost:8000/docs
Open a new terminal/command prompt window.
cd frontendnpm installnpm run devFrontend will be running at: http://localhost:5173
Navigate to: http://localhost:5173
-
3D Map View
- Rotate, zoom, and pan the 3D terrain
- Click on charging station markers
- Watch animated EVs moving through the terrain
-
Range Predictor
- Select a vehicle model
- Adjust battery level slider
- Enter battery capacity
- Select driving conditions
- Click "Predict Range"
-
Grid Dashboard
- View current grid load
- Check 6-hour forecast chart
- See charging recommendations
Port 8000 already in use:
uvicorn main:app --reload --port 8001Module not found:
pip install -r requirements.txt --upgradeML models not loading:
python train_models.pyPort 5173 already in use:
npm run dev -- --port 5174Dependencies not installing:
npm cache clean --force
npm installAPI connection errors:
- Ensure backend is running
- Check
.envfile has correct API URL - Check browser console for errors
Get all stations:
curl http://localhost:8000/api/stationsPredict range:
curl -X POST http://localhost:8000/api/predict/range \
-H "Content-Type: application/json" \
-d "{\"battery_level\": 80, \"battery_capacity\": 60, \"vehicle_model\": \"Tesla Model 3\", \"driving_conditions\": \"normal\"}"Get grid load:
curl http://localhost:8000/api/grid/load- Open http://localhost:8000/docs
- Click on any endpoint
- Click "Try it out"
- Fill in parameters
- Click "Execute"
ev-charging-scheduler/
├── backend/ # FastAPI server
│ ├── main.py # Main application
│ ├── api/routes.py # API endpoints
│ ├── generate_data.py # Data generation
│ ├── train_models.py # Model training
│ └── ml_models/ # Trained models
├── frontend/ # React app
│ ├── src/
│ │ ├── App.jsx # Main component
│ │ ├── components/ # UI components
│ │ └── scenes/ # 3D scenes
│ └── package.json
└── data/ # Datasets
Backend: Press Ctrl + C in the terminal
Frontend: Press Ctrl + C in the terminal
-
Explore the Code
- Read
docs/PROJECT_DOCUMENTATION.md - Check API endpoints at
/docs - Review ML model training script
- Read
-
Customize
- Add more charging stations
- Modify 3D scene elements
- Adjust ML model parameters
-
Deploy
- Frontend → Vercel
- Backend → Render
- See deployment guide in documentation
- Check
docs/PROJECT_DOCUMENTATION.mdfor detailed documentation - Review API docs at
http://localhost:8000/docs - Check console logs for errors
- Verify all dependencies are installed
- Backend server running on port 8000
- Frontend server running on port 5173
- 3D map displays charging stations
- Range predictor returns results
- Grid dashboard shows data
- No console errors
Happy Coding! 🚀⚡