This repository provisions a source-built routing stack for small-business delivery optimization:
- OSRM compiled from source
- VROOM compiled from source
- One public HTTP server at
localhost:5050for health, optimization, and OSRM proxy access
engine/osrm: OSRM build/runtime imageservices/deliveryoptimizer-api: Python HTTP router + VROOM build imageinfra/compose: Docker Compose definitionsinfra/env: Runtime/build environment variables
GET /health: readiness (200only if OSRM + VROOM are ready)POST /api/v1/deliveries/optimize: optimize multi-stop delivery routesGET /api/v1/osrm/*: proxy OSRM API requests (e.g.,route,nearest,table)
curl -sS -X POST http://localhost:5050/api/v1/deliveries/optimize \
-H "Content-Type: application/json" \
-d '{
"depot": { "location": [7.4236, 43.7384] },
"vehicles": [
{ "id": "van-1", "capacity": 8 }
],
"jobs": [
{ "id": "order-1", "location": [7.4212, 43.7308], "demand": 2, "service": 180 },
{ "id": "order-2", "location": [7.4261, 43.7412], "demand": 1, "service": 120 }
]
}'Example response (trimmed):
{
"status": "ok",
"summary": {
"routes": 1,
"unassigned": 0
},
"routes": [
{
"vehicle": 1,
"vehicle_external_id": "van-1",
"steps": [
{ "type": "start" },
{ "type": "job", "job": 1, "job_external_id": "order-1" },
{ "type": "job", "job": 2, "job_external_id": "order-2" },
{ "type": "end" }
]
}
],
"unassigned": []
}cmake --preset devcmake --build --preset dev --target buildcmake --build --preset dev --target upcmake --build --preset dev --target smoke(runs HTTP health check)
ccache is used for C++ engine compilation inside Docker build stages. The local CMake preset also defaults CCACHE_DIR to .ccache at the repository root.
If your machine is memory constrained, reduce parallel compile jobs in infra/env/routing.env:
OSRM_BUILD_JOBS=1VROOM_BUILD_JOBS=1
Default dev map data is monaco-latest.osm.pbf for fast startup. Set OSRM_PBF_URL in infra/env/routing.env for your target delivery region.
When the stack is running:
curl -f http://localhost:5050/healthExpected: HTTP 200 and JSON with "status":"ok".
If port 5000 is free on your machine and you want that exact endpoint, set OSRM_PUBLIC_PORT=5000 in infra/env/routing.env.
Frontend application for optimizing delivery routes.
- Node.js 18+ or Bun
- Backend API running (see main repo README)
Copy .env.example to .env.local:
cp .env.example .env.local
Configure your backend API URL:
NEXT_PUBLIC_API_URL=http://localhost:5050
Development
npm install
npm run dev
Open http://localhost:3000
Project Structure
- src/app/ - Next.js App Router pages
- src/components/ - Reusable React components (coming soon)
- src/lib/ - Utilities and API clients (coming soon)
Connecting to Backend
The backend API (PR #27) must be running for full functionality.
See CLAUDE.md or main README for setup instructions.