- php 8.1
- Serveur de base de données (mariadb, mysql, postgres, etc.)
"Puller" le projet
Installer les dépendances via composer
composer install
ou
wget https://getcomposer.org/composer.phar && php composer.phar install
Importer le fichier schema.sql
Copier le .env.dist
sous .env
et remplir
php src/Jobs/CyclableJob.php
php src/Jobs/InfoNeigeJob.php
php -S 127.0.0.1:8002
POST /auth
Request body: {
uuid: String,
}
Response: {
"user_id": integer,
"token": string
}
Les requêtes doivent être authentifiées avec le jeton reçu dans la requête précédente.
headers : {
Authorization: Bearer %token
}
Troncon {
coords: []<Long,Lat>
id: uint,
length: uint
side_one_state: ?integer
side_two_state: ?integer
trc_id: uint
updated_at: date(Y-m-d H:i:s)
winter: bool
winter_protected: bool
}
Contribution {
id: uint,
created_at: date(Y-m-d H:i:s),
issue_id: uint,
comment: strin,
user_id: uint,
name: string,
quality: ?integer,
external_id: ?uint,
is_external: bool,
is_deleted: bool,
replies: []Reply,
coords: []<Long,Lat>,
score: {
positive: uint,
negative: uint,
last_vote: ?date(Y-m-d H:i:s),
last_vote_date: ?date(Y-m-d H:i:s)
},
updated_at: date(Y-m-d H:i:s),
image: {
url: string,
width: uint,
height: uint,
is_external: bool
}
}
GET /update
headers: {
Authorization: Bearer %token
}
Query String: {
update?: timestamp,
}
Response: {
troncons: []Troncon,
contributions: []Contribution,
date: timestamp
}
# long, lat
Location: float,float,
POST /contribution
headers: {
Authorization: Bearer %token
Content-type: multipart/form-data
}
Request: {
location: Location,
comment: string,
issue_id: uint,
name: string,
photo: binary,
quality: integer(-1|0|1)
}
Response: {
contribution: Contribution
}