mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-04 17:04:53 +02:00
update graph linkings
This commit is contained in:
parent
a2936841f9
commit
5188f12ad4
2 changed files with 203 additions and 7 deletions
159
README.md
159
README.md
|
@ -6,7 +6,7 @@ Configurer .env.local pour mettre le token bearer d'un compte dédié
|
|||
installer les dépendances avec composer
|
||||
déployer sur un serveur ayant du php 8
|
||||
|
||||
# Dépendances
|
||||
# Dépendances
|
||||
|
||||
- PHP 8.1 ou supérieur
|
||||
- Composer
|
||||
|
@ -18,7 +18,7 @@ déployer sur un serveur ayant du php 8
|
|||
- intl
|
||||
- mbstring
|
||||
|
||||
# base de données
|
||||
# Base de données
|
||||
|
||||
créer un utilisateur et sa base
|
||||
|
||||
|
@ -36,5 +36,160 @@ CREATE USER 'sf'@'localhost' IDENTIFIED BY 'sfrgdHYJi56631lyshFSQGfd45452ùwdf54
|
|||
CREATE DATABASE `osm-my-commerce`;
|
||||
GRANT ALL PRIVILEGES ON `osm-my-commerce`.* TO 'sf'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
# Installation et configuration
|
||||
|
||||
## 1. Installation des dépendances
|
||||
```shell
|
||||
composer install
|
||||
npm install
|
||||
```
|
||||
|
||||
## 2. Configuration de l'environnement
|
||||
Créer un fichier `.env.local` avec les variables suivantes :
|
||||
```env
|
||||
DATABASE_URL="mysql://sf:sfrgdHYJi56631lyshFSQGfd45452ùwdf54f8fg5dfhg5_tyfdgthIOPHFUGH@127.0.0.1:3306/osm-my-commerce?serverVersion=8.0.32&charset=utf8mb4"
|
||||
# ou pour PostgreSQL :
|
||||
# DATABASE_URL="postgresql://sf:sfrgdHYJi56631lyshFSQGfd45452ùwdf54f8fg5dfhg5_tyfdgthIOPHFUGH@127.0.0.1:5432/osm-my-commerce?serverVersion=15&charset=utf8"
|
||||
|
||||
# Token OSM pour les modifications
|
||||
OSM_TOKEN="votre_token_osm_ici"
|
||||
```
|
||||
|
||||
## 3. Migrations de base de données
|
||||
|
||||
### Créer une nouvelle migration
|
||||
```shell
|
||||
php bin/console make:migration
|
||||
```
|
||||
|
||||
### Exécuter les migrations
|
||||
```shell
|
||||
php bin/console doctrine:migrations:migrate
|
||||
```
|
||||
|
||||
### Voir le statut des migrations
|
||||
```shell
|
||||
php bin/console doctrine:migrations:status
|
||||
```
|
||||
|
||||
### Annuler la dernière migration
|
||||
```shell
|
||||
php bin/console doctrine:migrations:migrate prev
|
||||
```
|
||||
|
||||
# Commandes custom Symfony
|
||||
|
||||
## Commandes de gestion des données
|
||||
|
||||
### Mise à jour des coordonnées des villes
|
||||
Récupère et stocke les coordonnées lat/lon pour toutes les villes dans la base de données :
|
||||
```shell
|
||||
php bin/console app:update-city-coordinates
|
||||
```
|
||||
|
||||
### Test du budget
|
||||
Teste le calcul du budget pour une ville donnée :
|
||||
```shell
|
||||
php bin/console app:test-budget [insee_code]
|
||||
```
|
||||
|
||||
### Labourage d'une ville
|
||||
Ajoute une nouvelle ville à la base de données avec son code INSEE :
|
||||
```shell
|
||||
php bin/console app:labourage [insee_code]
|
||||
```
|
||||
|
||||
## Commandes de maintenance
|
||||
|
||||
### Nettoyage du cache
|
||||
```shell
|
||||
php bin/console cache:clear
|
||||
```
|
||||
|
||||
### Validation du schéma de base de données
|
||||
```shell
|
||||
php bin/console doctrine:schema:validate
|
||||
```
|
||||
|
||||
### Mise à jour du schéma de base de données
|
||||
```shell
|
||||
php bin/console doctrine:schema:update --force
|
||||
```
|
||||
|
||||
# Fonctionnalités principales
|
||||
|
||||
## Interface publique
|
||||
- **Page d'accueil** : Carte interactive des villes avec taux de complétion
|
||||
- **Ajouter ma ville** : Formulaire pour ajouter une nouvelle ville
|
||||
- **Statistiques par ville** : Graphiques détaillés de progression
|
||||
- **Graphiques thématiques** : Suivi spécifique par type d'objet (ex: arrêts de bus, bornes de recharge, etc.)
|
||||
|
||||
## Interface d'administration
|
||||
- **Tableau de bord** : Vue d'ensemble des statistiques
|
||||
- **Gestion des villes** : Ajout, modification, suppression
|
||||
- **Suivi des modifications** : Historique des changements
|
||||
- **Export de données** : CSV, JSON, API Overpass
|
||||
|
||||
## API et intégrations
|
||||
- **API Overpass** : Récupération de données OSM
|
||||
- **Nominatim** : Géocodage des adresses
|
||||
- **Addok** : Service de géocodage alternatif
|
||||
|
||||
# Structure du projet
|
||||
|
||||
```
|
||||
src/
|
||||
├── Command/ # Commandes custom Symfony
|
||||
├── Controller/ # Contrôleurs (public et admin)
|
||||
├── Entity/ # Entités Doctrine
|
||||
├── Repository/ # Repositories Doctrine
|
||||
├── Service/ # Services métier
|
||||
└── Kernel.php # Configuration du kernel
|
||||
|
||||
templates/
|
||||
├── admin/ # Templates d'administration
|
||||
├── public/ # Templates publics
|
||||
└── base.html.twig # Template de base
|
||||
|
||||
assets/ # Assets frontend (JS, CSS)
|
||||
config/ # Configuration Symfony
|
||||
migrations/ # Migrations de base de données
|
||||
```
|
||||
|
||||
# Développement
|
||||
|
||||
## Ajouter une nouvelle commande
|
||||
```shell
|
||||
php bin/console make:command NomCommande
|
||||
```
|
||||
|
||||
## Ajouter une nouvelle entité
|
||||
```shell
|
||||
php bin/console make:entity NomEntite
|
||||
```
|
||||
|
||||
## Ajouter un nouveau contrôleur
|
||||
```shell
|
||||
php bin/console make:controller NomController
|
||||
```
|
||||
|
||||
## Tests
|
||||
```shell
|
||||
php bin/phpunit
|
||||
```
|
||||
|
||||
# Déploiement
|
||||
|
||||
## Variables d'environnement de production
|
||||
- `APP_ENV=prod`
|
||||
- `APP_SECRET=clé_secrète_ici`
|
||||
- `DATABASE_URL=url_de_la_base_production`
|
||||
- `OSM_TOKEN=token_osm_production`
|
||||
|
||||
## Optimisations
|
||||
```shell
|
||||
composer install --no-dev --optimize-autoloader
|
||||
php bin/console cache:clear --env=prod
|
||||
```
|
||||
|
|
|
@ -18,6 +18,22 @@
|
|||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.action-bar {
|
||||
background: white;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #dee2e6;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.action-bar .btn {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
|
@ -77,11 +93,36 @@
|
|||
{% block body %}
|
||||
<div class="container-fluid">
|
||||
<div class="stats-header">
|
||||
<h2>
|
||||
<i class="bi {{ icons[theme]|default('bi-question-circle') }}"></i>
|
||||
{{ theme_label }} - {{ stats.name }}
|
||||
</h2>
|
||||
<p class="mb-0">Code INSEE: {{ stats.zone }}</p>
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<div>
|
||||
<h2>
|
||||
<i class="bi {{ icons[theme]|default('bi-question-circle') }}"></i>
|
||||
{{ theme_label }} - {{ stats.name }}
|
||||
</h2>
|
||||
<p class="mb-0">Code INSEE: {{ stats.zone }}</p>
|
||||
</div>
|
||||
<a href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-arrow-left"></i> Retour aux stats
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="action-bar">
|
||||
<a href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}" class="btn btn-primary">
|
||||
<i class="bi bi-bar-chart"></i> Stats de la ville
|
||||
</a>
|
||||
<a href="{{ path('app_admin_labourer', {'insee_code': stats.zone}) }}" class="btn btn-warning">
|
||||
<i class="bi bi-arrow-clockwise"></i> Labourer la ville
|
||||
</a>
|
||||
<a href="{{ path('admin_followup_graph', {'insee_code': stats.zone}) }}" class="btn btn-info">
|
||||
<i class="bi bi-graph-up"></i> Suivi OSM (graphes)
|
||||
</a>
|
||||
<a href="{{ path('admin_followup_embed_graph', {'insee_code': stats.zone, 'theme': theme}) }}" class="btn btn-success" target="_blank">
|
||||
<i class="bi bi-box-arrow-up-right"></i> Graphe embedded
|
||||
</a>
|
||||
<a href="{{ path('app_admin') }}" class="btn btn-secondary">
|
||||
<i class="bi bi-house"></i> Accueil admin
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="stats-grid">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue