How cigalesdefrance/cartes works
Project type and purpose
• This is a static, full-stack “data pipeline + static site” application for generating and hosting interactive distribution maps of French cicada species.
• Purpose: aggregate heterogeneous geolocated cicada records (CSV, geoJSON, KML) from multiple external databases (GBIF, INPN, iNaturalist, etc.), process them via ETL scripts, generate statistics and maps, then serve them as a static website with interactive maps and charts.
High-level components
a. External Data Sources
• GBIF, INPN, iNaturalist, ONEM, WAD, Fauna Europea, CDF, custom code lists.
b. ETL & Data-Processing Layer
• PowerShell scripts (SCRIPTS/*.ps1) for downloads, format conversions (CSV → geoJSON/KML).
• R scripts (SCRIPTS/*.R) for generating statistical outputs and static chart HTML.
c. Local Data Store
• DATA/ (canton, département, région boundaries).
• BDD/ subdirectories containing per-species CSV, geoJSON, KML.
• BDD-CODES.csv, CIGALES-CODES.csv for lookup tables.
d. Build & CI/CD
• GitHub Actions workflows (.github/workflows/*.yml) triggering data refresh, map rebuild, statistics, and site deployment.
e. Static Site & Assets
• index.html plus per-species and statistics HTML pages (STATISTIQUES/*, BDD/*/index.html).
• ASSETS/ directory with logos, style.css, OpenLayers (ol.js), custom JS (autres.js, index.js).
f. Web Client
• Browser loads static HTML, CSS, JS, fetches local geoJSON/KML for map rendering.
Relationships & data flow
• CI/CD triggers ETL scripts → fetch external data → writes into BDD/, DATA/.
• R scripts consume BDD/ + DATA/ → generate statistics HTML pages under STATISTIQUES/.
• Build process collates generated files + ASSETS into final static site.
• Web client requests HTML pages → loads ASSETS (JS/CSS) → fetches geoJSON/KML from BDD/ → renders interactive maps (OpenLayers).
• Users interact via browser; no dynamic backend or database server at runtime.
Architectural patterns & principles
• Static-site architecture (no server-side runtime code beyond build time).
• ETL pipeline for data ingestion and transformation.
• Separation of concerns: data acquisition (PowerShell), analytics (R), presentation (HTML/JS/CSS).
• CI/CD for reproducible builds and automated deployment.