Compare commits
11 Commits
d799a17540
...
11d655edf9
Author | SHA1 | Date | |
---|---|---|---|
11d655edf9 | |||
![]() |
73b0b3b133 | ||
![]() |
9b0bf54a3d | ||
![]() |
54d9ff3a3d | ||
![]() |
155e1a2220 | ||
![]() |
b21d9ec57f | ||
![]() |
0b5fc57fde | ||
![]() |
bffbac0361 | ||
![]() |
4433f6c9d3 | ||
![]() |
0c9ab344a1 | ||
![]() |
02330d1ea6 |
31
CHANGELOG.md
31
CHANGELOG.md
@ -4,6 +4,37 @@ Tous les changements notables apportés à ce projet seront documentés dans ce
|
|||||||
Le format est basé sur [Keep a Changelog](http://keepachangelog.com/fr/1.0.0/)
|
Le format est basé sur [Keep a Changelog](http://keepachangelog.com/fr/1.0.0/)
|
||||||
et ce projet adhère à [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
et ce projet adhère à [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [3.1.6] - 2023-10-04
|
||||||
|
|
||||||
|
### Modifications
|
||||||
|
- Utilisation de datatourisme/api 3.1.6
|
||||||
|
|
||||||
|
## [3.1.5] - 2023-05-11
|
||||||
|
|
||||||
|
### Modifications
|
||||||
|
- Utilisation de datatourisme/api 3.1.5
|
||||||
|
|
||||||
|
## [3.1.3] - 2023-02-10
|
||||||
|
|
||||||
|
### Modifications
|
||||||
|
- Utilisation de datatourisme/api 3.1.3
|
||||||
|
|
||||||
|
## [3.1.1] - 2023-02-01
|
||||||
|
|
||||||
|
### Modifications
|
||||||
|
- Utilisation de datatourisme/api 3.1.0
|
||||||
|
|
||||||
|
## [3.1.0] - 2022-12-08
|
||||||
|
|
||||||
|
### Corrections
|
||||||
|
- Support des variables dans le point d'accès GraphQL
|
||||||
|
|
||||||
|
## [3.0.0] - 2022-07-04
|
||||||
|
|
||||||
|
### Modifications
|
||||||
|
- Utilisation de datatourisme/api 3.0.0
|
||||||
|
- Passage à PHP 7.4
|
||||||
|
|
||||||
## [2.0.1] - 2020-10-05
|
## [2.0.1] - 2020-10-05
|
||||||
|
|
||||||
### Modifications
|
### Modifications
|
||||||
|
20
README.md
20
README.md
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://www.datatourisme.gouv.fr" target="_blank">
|
<a href="https://www.datatourisme.fr" target="_blank">
|
||||||
<img alt="DATAtourisme" src="https://framagit.org/datatourisme/api/raw/master/docs/_media/logo.png">
|
<img alt="DATAtourisme" src="https://gitlab.adullact.net/adntourisme/datatourisme/api/raw/master/docs/_media/logo.png">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
La plateforme <strong>OPEN DATA</strong> de l'information touristique
|
La plateforme <strong>OPEN DATA</strong> de l'information touristique
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center"><a href="https://www.datatourisme.gouv.fr/">https://www.datatourisme.gouv.fr</a></p>
|
<p align="center"><a href="https://www.datatourisme.fr/">https://www.datatourisme.fr</a></p>
|
||||||
|
|
||||||
|
|
||||||
# Environnement full-stack Docker
|
# Environnement full-stack Docker
|
||||||
@ -18,13 +18,13 @@ Ce projet contient un environnement [docker-compose](https://docs.docker.com/com
|
|||||||
services suivants :
|
services suivants :
|
||||||
|
|
||||||
* La base de données [Blazegraph](http://www.blazegraph.com)
|
* La base de données [Blazegraph](http://www.blazegraph.com)
|
||||||
* L'[API DATAtourisme](https://framagit.org/datatourisme/api) associée à :
|
* L'[API DATAtourisme](https://gitlab.adullact.net/adntourisme/datatourisme/api) associée à :
|
||||||
* Un point d'accès HTTP GraphQL
|
* Un point d'accès HTTP GraphQL
|
||||||
* [GraphiQL](https://github.com/graphql/graphiql), une interface visuelle de conception de requête
|
* [GraphiQL](https://github.com/graphql/graphiql), une interface visuelle de conception de requête
|
||||||
* [Voyager](https://github.com/APIs-guru/graphql-voyager), un visualisateur de schéma sous forme de graphe.
|
* [Voyager](https://github.com/APIs-guru/graphql-voyager), un visualisateur de schéma sous forme de graphe.
|
||||||
|
|
||||||
Ce stack vous permet de mettre rapidement en place un environnement de restitution des données touristiques
|
Ce stack vous permet de mettre rapidement en place un environnement de restitution des données touristiques
|
||||||
téléchargées à partir de la [plateforme diffuseur](https://diffuseur.datatourisme.gouv.fr).
|
téléchargées à partir de la [plateforme diffuseur](https://diffuseur.datatourisme.fr).
|
||||||
|
|
||||||
## Utilisation
|
## Utilisation
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ Par défaut, vous devrez rendre disponible les ports 8080 et 9999.
|
|||||||
|
|
||||||
Pour vous servir de l'environnement, vous devez d'abord récupérer des données touristiques :
|
Pour vous servir de l'environnement, vous devez d'abord récupérer des données touristiques :
|
||||||
|
|
||||||
1. Connectez-vous à la [plateforme diffuseur](https://diffuseur.datatourisme.gouv.fr). Il sera nécessaire de
|
1. Connectez-vous à la [plateforme diffuseur](https://diffuseur.datatourisme.fr). Il sera nécessaire de
|
||||||
créer un compte s'il s'agit de votre première connexion.
|
créer un compte s'il s'agit de votre première connexion.
|
||||||
2. Créez et configurez un flux de données à l'aide de l'éditeur visuel de requête.
|
2. Créez et configurez un flux de données à l'aide de l'éditeur visuel de requête.
|
||||||
3. Configurez le flux pour utiliser un format **compatible avec l'API** :
|
3. Configurez le flux pour utiliser un format **compatible avec l'API** :
|
||||||
@ -74,7 +74,7 @@ $ docker-compose up
|
|||||||
|
|
||||||
Ces commandes lanceront deux serveurs :
|
Ces commandes lanceront deux serveurs :
|
||||||
- un serveur [Blazegraph](https://www.blazegraph.com/) sur le port 9999 chargé de vos données.
|
- un serveur [Blazegraph](https://www.blazegraph.com/) sur le port 9999 chargé de vos données.
|
||||||
- un serveur incluant l'[API DATAtourisme](https://framagit.org/datatourisme/api) sur le port 8080.
|
- un serveur incluant l'[API DATAtourisme](https://gitlab.adullact.net/adntourisme/datatourisme/api) sur le port 8080.
|
||||||
|
|
||||||
Vous pouvez accèder aux interfaces suivantes :
|
Vous pouvez accèder aux interfaces suivantes :
|
||||||
|
|
||||||
@ -98,11 +98,11 @@ Lorsque vous souhaitez mettre à jour les données de votre environnement, vous
|
|||||||
|
|
||||||
## Liens
|
## Liens
|
||||||
|
|
||||||
* [API DATAtourisme](https://framagit.org/datatourisme/api)
|
* [API DATAtourisme](https://gitlab.adullact.net/adntourisme/datatourisme/api)
|
||||||
* [Documentation de l'API](https://datatourisme.frama.io/api)
|
* [Documentation de l'API](https://datatourisme.frama.io/api)
|
||||||
* [Plateforme diffuseur](https://diffuseur.datatourisme.gouv.fr)
|
* [Plateforme diffuseur](https://diffuseur.datatourisme.fr)
|
||||||
* Centre de support
|
* Centre de support
|
||||||
|
|
||||||
## License
|
## Licence
|
||||||
|
|
||||||
MIT License
|
MIT License
|
@ -3,7 +3,7 @@ version: '3.1'
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
blazegraph:
|
blazegraph:
|
||||||
image: conjecto/blazegraph:2.1
|
image: conjecto/blazegraph:2.1.5
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 9999:9999
|
- 9999:9999
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
FROM php:7.2
|
FROM php:7.4
|
||||||
MAINTAINER Conjecto <contact@conjecto.com>
|
MAINTAINER Conjecto <contact@conjecto.com>
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
--no-install-recommends git zip zlib1g-dev wget
|
--no-install-recommends git zip zlib1g-dev wget libzip-dev
|
||||||
|
|
||||||
RUN docker-php-ext-install -j$(nproc) zip
|
RUN docker-php-ext-install -j$(nproc) zip
|
||||||
|
|
||||||
@ -18,6 +18,7 @@ RUN \
|
|||||||
php -r "unlink('composer-setup.php');"
|
php -r "unlink('composer-setup.php');"
|
||||||
|
|
||||||
# install vendors
|
# install vendors
|
||||||
|
ENV COMPOSER_ALLOW_SUPERUSER=1
|
||||||
RUN php composer.phar install
|
RUN php composer.phar install
|
||||||
|
|
||||||
# run server
|
# run server
|
||||||
|
1
docker/app/.gitignore
vendored
Normal file
1
docker/app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
vendor
|
@ -7,7 +7,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.0",
|
"php": ">=7.4",
|
||||||
"datatourisme/api": "^2.0"
|
"datatourisme/api": "^3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1144
docker/app/composer.lock
generated
Normal file
1144
docker/app/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -11,24 +11,40 @@ switch($_SERVER['REQUEST_METHOD']) {
|
|||||||
case "POST":
|
case "POST":
|
||||||
if (isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] === 'application/json') {
|
if (isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] === 'application/json') {
|
||||||
$rawBody = file_get_contents('php://input');
|
$rawBody = file_get_contents('php://input');
|
||||||
$requestData = json_decode($rawBody ?: '', true);
|
try {
|
||||||
|
$requestData = json_decode($rawBody ?: '', true, 512, JSON_THROW_ON_ERROR);
|
||||||
|
} catch(\JsonException $e) {
|
||||||
|
http_response_code(400);
|
||||||
|
echo json_encode(['errors' => [['message' => $e->getMessage()]]]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$requestData = $_POST;
|
$requestData = $_POST;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "GET":
|
case "GET":
|
||||||
$requestData = $_GET;
|
$requestData = $_GET;
|
||||||
|
if (isset($requestData['variables'])) {
|
||||||
|
try {
|
||||||
|
$requestData['variables'] = json_decode($requestData['variables'], true, 512, JSON_THROW_ON_ERROR);
|
||||||
|
} catch(\JsonException $e) {
|
||||||
|
http_response_code(400);
|
||||||
|
echo json_encode(['errors' => [['message' => 'variables : ' . $e->getMessage()]]]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$payload = isset($requestData['query']) ? $requestData['query'] : null;
|
$payload = isset($requestData['query']) ? $requestData['query'] : null;
|
||||||
|
$variables = !empty($requestData['variables']) ? $requestData['variables'] : [];
|
||||||
|
|
||||||
require_once __DIR__.'/../vendor/autoload.php';
|
require_once __DIR__.'/../vendor/autoload.php';
|
||||||
|
|
||||||
$processor = \Datatourisme\Api\DatatourismeApi::create('http://blazegraph:9999/blazegraph/namespace/kb/sparql');
|
$processor = \Datatourisme\Api\DatatourismeApi::create('http://blazegraph:9999/blazegraph/namespace/kb/sparql');
|
||||||
$response = $processor->process($payload);
|
$response = $processor->process($payload, $variables);
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
exit;
|
exit;
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
<script src="//cdn.jsdelivr.net/react/15.4.2/react.min.js"></script>
|
<script src="//cdn.jsdelivr.net/react/15.4.2/react.min.js"></script>
|
||||||
<script src="//cdn.jsdelivr.net/react/15.4.2/react-dom.min.js"></script>
|
<script src="//cdn.jsdelivr.net/react/15.4.2/react-dom.min.js"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://apis.guru/graphql-voyager/releases/v1.x/voyager.css" />
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/graphql-voyager@1.3/dist/voyager.min.css" />
|
||||||
<script src="https://apis.guru/graphql-voyager/releases/v1.x/voyager.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/graphql-voyager@1.3/dist/voyager.standalone.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="voyager">Loading...</div>
|
<div id="voyager">Loading...</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user