Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E spot — EV Road Trip Planner (MVP)

Plan Indian intercity EV road trips: pick your EV, enter start and destination, and get 3–5 distinct charging plans (fastest / cheapest / fewest stops / highest rated / balanced family) with per-stop battery levels, charge times, and estimated costs.

Zero paid APIs. Everything runs on genuinely free services — no credit card anywhere: OSRM demo server (routing), Open Charge Map (chargers), Open-Elevation (terrain), Nominatim (search), OpenStreetMap tiles (map).

Screenshots

Plan a trip Compare plans
Landing page Results page
Vehicle picker, location autocomplete, battery slider Plan cards, stop-by-stop itinerary, route map

Structure

api/   Express + TypeScript API (decoupled for future mobile use)
  src/core/       Pure logic: range engine, charging curve, geo, coverage scorer, plan generator (unit-tested)
  src/providers/  OSRM / OCM / Open-Elevation / Nominatim behind swap-friendly interfaces
  src/services/   Route → corridor → stations → elevation → plans pipeline
  src/data/       Curated EV specs + EV-hub cities for charger-aware routing
  src/models/     Mongoose schemas (Vehicle, Trip, Station w/ 2dsphere index)
web/   Next.js (App Router) + Tailwind + react-leaflet frontend

Quick start

npm install

# optional but recommended — MongoDB + Redis via Docker:
docker compose up -d
npm run seed          # load the 15-vehicle Indian EV dataset into Mongo

cp api/.env.example api/.env      # add your free OCM key here (optional)

npm run dev           # api on :4000 + web on :3000

No Docker? It still works: vehicles are served from bundled seed data, the cache falls back to in-process memory, and trips just aren't persisted.

Tests

npm test        # vitest — range engine, charging curve, geo, plan generator

Charger-aware routing

The shortest road isn't always drivable in an EV — India's free routing/charger data has real gaps. So the planner doesn't just take OSRM's fastest route:

  1. It asks OSRM for a few route alternatives, and also builds candidate routes via major EV-hub cities (src/data/hubs.ts) that stay on well-charged national highways.
  2. For each candidate it discovers chargers along the corridor and runs a pure coverage scorer (src/core/coverage.ts) that checks whether the vehicle can complete the route without any charging gap exceeding its range.
  3. It plans on the best-covered route, and tells the user when it picked a charger-friendlier road over the fastest one (routeNote in the response).

Impact example: Chennai→Mumbai discovery jumps from ~37 to ~210 compatible chargers once hub routing keeps the trip on charged highways. Some cross-country routes through the sparsely-charged Deccan interior remain genuinely infeasible for short-range EVs on current free data — the app says so honestly rather than inventing chargers, and suggests a longer-range EV.

Notes & constraints

  • Rate limits respected: Nominatim is throttled to 1 req/sec behind a 7-day cache; OSRM and OCM responses are cached (6 h TTL); elevations are cached per point for 30 days. The OSRM public server is for evaluation only — set OSRM_BASE_URL to a self-hosted instance when usage grows.
  • Charger availability is best-effort: Open Charge Map is community-maintained; the app surfaces a 0–5 "community score" (operational status, verification recency) instead of pretending to have live data. Tariffs are operator-level estimates (configurable via RATE_INR_PER_KWH).
  • Safety buffer: plans never schedule arrival anywhere below 15% battery (RESERVE_BATTERY_PERCENT).
  • Out of scope for MVP (by design): live slot booking, multi-vehicle trips, offline mode, in-trip rerouting. Socket.IO is anticipated for a future "live trip" mode but not included.

Attribution

Charging data © Open Charge Map contributors · Routing © OSRM · Geocoding & map tiles © OpenStreetMap contributors.

License

© 2026 Mohith Balakumar. All rights reserved.

This source is published for portfolio and evaluation purposes only. It is not open source. No permission is granted to use, copy, modify, merge, publish, distribute, sublicense, or sell any part of this software, in whole or in part, without prior written permission from the copyright holder.

Viewing and forking via GitHub's interface is permitted under GitHub's Terms of Service; that does not grant any licence to the code itself.

Third-party data and services used by this project (OpenStreetMap, Open Charge Map, OSRM, Open-Elevation) remain under their own licences — see Attribution above.

About

EV road-trip planner for India that tells you exactly where to charge, how long it takes, and what it costs — 5 optimized strategies per route. Detects charging deserts on the shortest road and reroutes via better-covered highways instead. 100% free APIs, zero paid services.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages