- NestJS backend: auth, restaurants, orders, drivers, payments, tracking, reviews, zones, admin, email - Next.js 14 frontend: landing, restaurants, checkout, tracking, dashboards, onboarding - Expo mobile app: driver orders and earnings screens - PostgreSQL + PostGIS schema with seed data - Docker Compose for local dev (Postgres, Redis, OSRM) - MapLibre GL + OpenStreetMap integration - Stripe subscription and payment processing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
60 lines
1.7 KiB
Bash
60 lines
1.7 KiB
Bash
#!/usr/bin/env bash
|
|
# ============================================================
|
|
# The Vibe - OSRM Routing Engine Setup
|
|
# Downloads Ontario OSM data and processes it for OSRM
|
|
#
|
|
# Run this ONCE before starting docker-compose with --profile routing
|
|
# Estimated time: 5-15 minutes depending on machine
|
|
# ============================================================
|
|
|
|
set -e
|
|
|
|
OSRM_DATA_DIR="./osrm_data"
|
|
OSM_FILE="ontario-latest.osm.pbf"
|
|
OSM_URL="https://download.geofabrik.de/north-america/canada/ontario-latest.osm.pbf"
|
|
|
|
echo "==> Setting up OSRM for Ontario, Canada"
|
|
echo ""
|
|
|
|
# Create data directory
|
|
mkdir -p "$OSRM_DATA_DIR"
|
|
|
|
# Step 1: Download Ontario OSM data
|
|
if [ ! -f "$OSRM_DATA_DIR/$OSM_FILE" ]; then
|
|
echo "==> Downloading Ontario OSM data (~200MB)..."
|
|
curl -L "$OSM_URL" -o "$OSRM_DATA_DIR/$OSM_FILE"
|
|
echo "==> Download complete."
|
|
else
|
|
echo "==> Ontario OSM file already exists, skipping download."
|
|
fi
|
|
|
|
# Step 2: Extract using car profile
|
|
echo "==> Extracting road network (car profile)..."
|
|
docker run --rm \
|
|
-v "$(pwd)/$OSRM_DATA_DIR:/data" \
|
|
osrm/osrm-backend:latest \
|
|
osrm-extract -p /opt/car.lua /data/$OSM_FILE
|
|
|
|
# Step 3: Partition
|
|
echo "==> Partitioning..."
|
|
docker run --rm \
|
|
-v "$(pwd)/$OSRM_DATA_DIR:/data" \
|
|
osrm/osrm-backend:latest \
|
|
osrm-partition /data/ontario-latest.osrm
|
|
|
|
# Step 4: Customize
|
|
echo "==> Customizing..."
|
|
docker run --rm \
|
|
-v "$(pwd)/$OSRM_DATA_DIR:/data" \
|
|
osrm/osrm-backend:latest \
|
|
osrm-customize /data/ontario-latest.osrm
|
|
|
|
echo ""
|
|
echo "==> OSRM setup complete!"
|
|
echo ""
|
|
echo "Start the OSRM routing engine with:"
|
|
echo " docker-compose --profile routing up -d osrm"
|
|
echo ""
|
|
echo "Test it:"
|
|
echo " curl 'http://localhost:5000/route/v1/driving/-79.3832,43.6532;-79.4034,43.6487?overview=false'"
|