18 Commits

Author SHA1 Message Date
syoul
2499fac213 restart pipeline
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-03-22 20:04:02 +01:00
syoul
debb4cf8ec feat: pipeline CI + Docker pour déploiement sur sonic
- Dockerfile multi-stage (node:20 build + nginx:alpine serve)
- nginx.conf SPA avec try_files et gzip
- docker-compose.yml avec labels Registrator/Fabio (SERVICE_80_CHECK_TCP)
- .woodpecker.yml : validate, security-check, build-image, SBOM, write-env,
  test-env, deploy (stop→acme→up), test-deploy, healthcheck
- .gitignore : ajout .env et /.reports/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 20:02:24 +01:00
syoul
94474fc007 fix: détection pays fiable via nom de ville Cesium+ + reorder bounding boxes
- Extrait le pays depuis le champ city Cesium+ en priorité (ex: "Heusy, 4800, Belgique" → BE)
- Bounding boxes réordonnées : petits pays (LU, BE, CH, NL) avant FR pour éviter les faux positifs
- Affiche l'heure du dernier refresh sur le badge live

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 19:08:22 +01:00
syoul
d99ad3707d fix: show full city name with postal code and country in top villes
Restore full Cesium+ city field (including postal code), restructure
the city card so name wraps on two lines with country badge + tx count
+ volume all readable without truncation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:55:37 +01:00
syoul
55d2b50cd3 fix: replace emoji flags with text badges, clean city names from postal codes
Emoji flags render as boxes on Linux. Replace with a small FR/BE/CH
badge. Also strip postal codes from Cesium+ city names (e.g.
"Saint-Jean-de-Laur, 46260" → "Saint-Jean-de-Laur").

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:53:42 +01:00
syoul
8d9a9a3c07 feat: show country flag next to city names in top villes
Determine country from geoPoint coordinates using bounding boxes
for the main Ğ1 community countries (FR, BE, CH, ES, DE, IT, ...).
Display the emoji flag before each city name in the top villes panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:52:00 +01:00
syoul
a8792641ab feat: show up/down delta indicators on stats after each refresh
Volume total, transaction count, and top city volumes now display
↑ (green) or ↓ (red) arrows compared to the previous refresh,
making it visible that data is actually updating.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:47:53 +01:00
syoul
a6fc4a534f fix: use real totalCount from Subsquid instead of capped fetch limit
Add totalCount to the GraphQL query so transactionCount reflects the
true number of transfers in the period, not the 2000-item fetch cap.
This also fixes the average Ğ1/tx calculation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:40:07 +01:00
syoul
2674b3891b fix: add error handling and refresh indicator to auto-refresh
- Add .catch() so failed background fetches don't silently break the interval
- Add refreshing state with a spinning ↻ on the live badge during background updates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:34:47 +01:00
syoul
c6cb990b40 chore: rename app from ĞéoFlux to Ğ1Flux
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:18:32 +01:00
syoul
31f8db6625 chore: remove debug logs from DataService
Pipeline confirmed working (17826 keyMap, ~350 geolocalized).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:13:56 +01:00
syoul
a288a5b2e7 fix: handle all ES geo_point formats from Cesium+
Cesium+ stores geoPoint in multiple Elasticsearch formats (object,
string "lat,lon", array [lon,lat]). Using z.object() caused a ZodError
that silently swallowed the entire Cesium+ response, leaving geoMap
empty and displaying 0 geolocalized transactions.

Replace the strict Zod schema with z.unknown() and a parseGeoPoint()
helper that normalizes all three formats. Also add [GéoFlux] debug
logs to DataService to trace keyMap/duniterKeys/geoMap pipeline steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 18:12:15 +01:00
syoul
9265517c52 fix: identityKeyMap — augmenter la limite à 20000 (17826 identités au total)
La limite de 10000 excluait SyoulAnuanua et ~7826 autres identités.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:46:12 +01:00
syoul
5fe71c1801 feat: géolocalisation par clé cryptographique (SS58 → Duniter base58)
Au lieu de chercher par nom (title), on résout maintenant par clé :
1. buildIdentityKeyMap() : charge toutes les identités Ğ1v2 depuis Subsquid
   avec leur ownerKeyChange → currentSS58 → genesisKey → duniterKey
2. ss58ToDuniterKey() : conversion SS58 v2 (préfixe 2 octets) → base58 Ed25519
   = _id Cesium+ (même matériau cryptographique, encodage différent)
3. resolveGeoByKeys() : query Cesium+ par ids{} → résultat exact, pas d'ambiguïté
4. Cache keyMap 10 min : 1 requête Subsquid pour ~8000 identités, pas par refresh

Résultat : les membres migrés v1→v2 avec un profil Cesium+ sont correctement
géolocalisés même si leur nom v2 diffère de leur nom v1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:41:26 +01:00
syoul
71b457892e fix: géolocalisation Cesium+ — 0 résultats corrigé
- CesiumAdapter : terms query en minuscules (champ title analysé par ES)
- CesiumAdapter : z.coerce.number() pour geoPoint.lat/lon (37% des profils
  stockent les coordonnées en string → ZodError silencieux → 0 géolocalisées)
- CesiumAdapter : clé de la Map en toLowerCase() pour cohérence
- DataService : lookup geoMap par fromName.toLowerCase()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:05:04 +01:00
syoul
93daec7631 fix: géolocalisation Cesium+ et tests déterministes
- CesiumAdapter : utilise le champ `title` (analysé ES) au lieu de `title.keyword`
  qui retournait 0 résultats ; coerce lat/lon en number (certains profils stockent des strings)
- DataService : sépare totalVolume (all tx blockchain) de geoCount (tx heatmap)
- StatsPanel : barre de couverture géo uniquement en mode live
- App : badge source "● live Ğ1v2" ou "○ mock"
- DataService.test.ts : mock SubsquidAdapter + CesiumAdapter directement (vi.mock hoistés)
  pour que les tests soient déterministes quel que soit VITE_USE_LIVE_API dans .env.local
- tsconfig.app.json : exclude src/test pour éviter les erreurs de build prod

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 16:32:23 +01:00
syoul
2f813c5fdf feat: migration Ğ1v2 — Subsquid + Cesium+ g1.data.e-is.pro
Sources de données réelles Ğ1v2 (vérifiées par introspection) :
- SubsquidAdapter : https://squidv2s.syoul.fr/v1/graphql
  transfers(filter: timestamp >= since, orderBy: TIMESTAMP_DESC)
  with from.linkedIdentity.name pour jointure géo
- CesiumAdapter : https://g1.data.e-is.pro (59 841 profils)
  recherche batch par nom d'identité (title.keyword)
  g1.data.duniter.fr hors ligne depuis arrêt Ğ1v1

Schémas Zod mis à jour pour Ğ1v2 :
- G1v2KeySchema : SS58 "g1" + 47 chars = 49 chars (mesuré sur données réelles)
- SubsquidTransferSchema : id, blockNumber, timestamp ISO, amount BigInt string
- parseSubsquidAmount : BigInt string centimes → Ğ1 flottant

Activation : VITE_USE_LIVE_API=true dans .env.local
Badge "● live Ğ1v2 / ○ mock" ajouté dans l'UI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 16:01:36 +01:00
syoul
d20d042bca feat: initialisation de ĞéoFlux — visualisation géographique Ğ1
- Carte Leaflet plein écran avec heatmap (OpenStreetMap, dark mode)
- Sélecteur de période 24h / 7j / 30j
- Panneau latéral : volume total, compteur de transactions, top 3 villes
- mockData.ts : 2 400 transactions simulées sur 24 villes FR/EU
- DataService.ts : abstraction prête pour branchement Subsquid/Ğ1v2
- Schémas Zod (g1.schema.ts) : validation runtime Duniter GVA + Cesium+
- Adaptateurs DuniterAdapter et CesiumAdapter (Ğ1v1, à migrer v2)
- Suite de tests Vitest : 43 tests, conformité schéma Ğ1 vérifiée

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 15:49:01 +01:00