Laravel 11·Flutter 3.2·API REST v1

Naviguer
l'invisible

Plateforme géospatiale participative — sentiers locaux, routing multimodal et cartographie communautaire. API ouverte pour Flutter, web et partenaires.

⚡ Démarrer API Référence ↗ GitHub
api_service.dart — airroad-app/lib/core/api ● live
Dart SDK
cURL
Response
1// Calculer un itinéraire avec sentiers locaux
2final result = await ApiService.instance.calcRoute(
3  fLat: -18.916, fLng: 47.535,
4  tLat: -18.943, tLng: 47.500,
5  profile: 'foot', local: true,
6);
7if (result != null) {
8  print('${result.distanceM}m · ${result.source}');
9  // 3842m · osrm+local
10}
1curl -X POST https://your-domain.com/api/v1/routes/calculate \
2  -H "Authorization: Bearer ar_xxxxxxxxxx" \
3  -H "Content-Type: application/json" \
4  -d '{"from_lat":-18.916,"from_lng":47.535,
5    "to_lat":-18.943,"to_lng":47.500,
6    "profile":"foot","include_local":true}'
1{
2  "success": true,
3  "data": {
4    "source": "osrm+local",
5    "distance": 3842,
6    "duration": 2714,
7    "local_traces": [{ "name": "Sentier Analakely" }]
8  }
9}
12+
modes de transport
<15ms
cache routage
100%
données communautaires
v1
API REST versionnée
fonctionnalités

Ce que l'API
fait pour vous

Une seule clé Bearer, plusieurs projets. Scopes granulaires par endpoint.

🛤️
Sentiers locaux

Traces GPS communautaires filtrées par score de confiance (≥ 0.6). Fusionnées dans le routage OSRM.

confidence_score ≥ 0.6
📐
Routing enrichi

OSRM mondial + traces AirRoad. La réponse identifie la source : osrm ou osrm+local.

source: "osrm+local"
Multimodal

Trajets multi-tronçons avec profil OSRM par segment. À pied → vélo → voiture.

POST /routes/multimodal
⚠️
Incidents temps réel

Signalements communautaires. Votes confirm/deny. Résolution auto à 5 deny-votes. TTL configurable.

TTL configurable
🔑
Auth par scope

Clés ar_xxx SHA-256. Scopes fins : traces:read, routes:read… par projet partenaire.

Bearer ar_xxx
🗺️
Tuiles vectorielles

Endpoint GeoJSON XYZ. Style MapLibre GL inclus. Compatible Leaflet, MapLibre, QGIS.

GET /tiles/vector/{z}/{x}/{y}
transport types

12 profils · 3 protocoles OSRM

🚗 Voiture driving
🏍 Moto driving
🚲 Vélo cycling
🚶 À pied foot
🏃 Course foot
🚌 Bus driving
🚛 Camion driving
🚕 Taxi driving
🛺 Tuk-tuk driving
Bateau driving
🐴 À cheval foot
📍 Autre driving
api v1 · référence

Endpoints REST,
scopes précis

Middleware Laravel injecté proprement. Chaque route protégée par un scope dédié.

POST /routes/multimodal · Response
200 OK
{
  "success": true,
  "data": {
    "type":           "multimodal",
    "total_distance": 5284,
    "total_duration": 3960,
    "segments": [
      {
        "transport_type": "pieton",
        "source":         "osrm+local",
        "distance":       642,
        "local_traces": [
          { "name": "Sentier Analakely",
            "confidence": 0.85 }
        ]
      },
      {
        "transport_type": "voiture",
        "source":         "osrm",
        "distance":       4642
      }
    ]
  }
}
architecture

Moteur privé,
façade ouverte

OSRM calcule, AirRoad enrichit, vos apps consomment.

🌍
OSRM
Routing mondial
driving / cycling / foot
HTTP
AirGo API
Laravel 11
Auth · Traces · Cache
Bearer ar_xxx
📱
Vos Apps
Flutter · Web
Partenaires · ONG
stack
Laravel 11MySQL + ST_DistanceOSRM PublicGeoJSONGPX 1.1Flutter 3.2+flutter_mapRiverpodNominatimSHA-256 Bearer
quickstart

En production
en 3 étapes

Laravel sur Plesk + app Flutter. Tout est dans le même ZIP.

Laravel APIairroad-api/
1
# Installer les dépendances
composer install --no-dev
cp .env.example .env && php artisan key:generate
2
# Base de données + seeds
php artisan migrate
php artisan db:seed --class=DemoProjectSeeder
3
✓ CLE API : ar_xxxxxxxxxxxxxx
✓ URL : https://your-domain.com/api/v1
📱Application Flutterairroad-app/
1
# Packages Dart
flutter pub get
2
# Build Android / debug
flutter build apk --release
flutter run
3
# Écran de connexion au démarrage
✓ URL + Clé API → Connecter
✓ GPS + carte OSM prêts
// open source · MIT

Construisez sur
AirGo

Chaque sentier tracé enrichit la carte pour tous. Partagez, contribuez, améliorez.