Authentication

All protected endpoints require session authentication. Log in via the web UI at /login/. The session cookie is automatically included. Public endpoints (/api/health/, /api/graph/) require no login.

POST/api/route/

Compute the shortest route using Dijkstra's algorithm.

Request: {"src_lat":27.7103,"src_lon":85.3222,"dst_lat":27.7350,"dst_lon":85.3400,"src_name":"Pashupatinath","dst_name":"Boudha","mode":"car"} Response: {"status":"success","data":{"path_coords":[...],"total_distance_km":4.251,"eta_minutes":6.4,"node_count":47,"route_id":12,"share_token":"uuid..."}}
GET/api/health/

Check backend and graph status.

{"status":"ready","graph":{"loaded":true,"nodes":52300,"edges":119800,"loaded_count":5,"total":5}}
GET/api/analytics/

Get personal route statistics and daily counts.

POST/api/save-route/

Save a route to favourites.

{"route_id": 12, "label": "Office commute"}
GET/api/heatmap-data/

Returns lat/lon intensity points for heatmap overlay.

GET/api/leaderboard-data/

Top 10 users by total distance computed.

POST/api/set-theme/

Save the user's theme preference.

{"theme": "emerald"}