|
1 | | -# geo-agent-template |
| 1 | +# global-30x30 — geo-agent app |
2 | 2 |
|
3 | | -A GitHub template for deploying an AI-powered interactive map app. |
4 | | -Users describe in plain language what datasets to show; the app uses an LLM agent with map tools and SQL access to visualize and analyze cloud-native geospatial data. |
| 3 | +A geo-agent configuration for exploring the spatial and social context of the **Kunming-Montreal Global Biodiversity Framework Target 3** ("30×30") — the commitment that at least 30% of terrestrial, inland water, marine and coastal areas be effectively conserved by 2030. |
5 | 4 |
|
6 | | -**No JavaScript to write.** The core modules (map, chat, agent, tools) are loaded from CDN. You configure which data to show via three small files. |
| 5 | +Inspired by the analysis in Fajardo et al. 2026, *Social implications of the 30×30 global conservation target* (Nature Communications, [doi:10.1038/s41467-026-71860-8](https://doi.org/10.1038/s41467-026-71860-8)). See [`coverage.md`](coverage.md) for which of that paper's analyses can and cannot be reproduced from the current STAC catalog. |
7 | 6 |
|
8 | | -**Full documentation:** [boettiger-lab.github.io/geo-agent/docs](https://boettiger-lab.github.io/geo-agent/docs/) |
| 7 | +## Layers |
| 8 | + |
| 9 | +- **WDPA December 2025** — current global protected areas |
| 10 | +- **LandMark IPLC v202509** — Indigenous and community-mapped lands |
| 11 | +- **WWF Terrestrial Ecoregions (2017)** — biodiversity representation framing |
| 12 | +- **IUCN Species Richness (2025)** — vertebrate richness rasters |
| 13 | +- **NCP — Biodiversity & Natural Habitat** (Chaplin-Kramer 2019) and **Irrecoverable / Vulnerable Carbon** (Noon 2022) |
| 14 | +- **GHS-POP 2020** — gridded global population |
| 15 | +- **Overture countries / regions** — admin context |
9 | 16 |
|
10 | 17 | ## Repository structure |
11 | 18 |
|
12 | 19 | ``` |
13 | 20 | index.html ← HTML shell — loads core JS/CSS from CDN |
14 | | -layers-input.json ← which STAC collections to show + LLM settings |
15 | | -system-prompt.md ← LLM system prompt (customize per app) |
| 21 | +layers-input.json ← STAC collections + LLM settings + welcome examples |
| 22 | +system-prompt.md ← LLM system prompt (30×30 framing + caveats) |
16 | 23 | k8s/ ← Kubernetes deployment manifests (optional) |
17 | 24 | ``` |
18 | 25 |
|
19 | | -## Quick start |
20 | | - |
21 | | -### 1. Create your repo from this template |
22 | | - |
23 | | -Click **"Use this template"** on GitHub → **"Create a new repository"**. |
24 | | - |
25 | | -### 2. Choose your datasets |
26 | | - |
27 | | -Browse the available STAC catalog: |
28 | | - |
29 | | -``` |
30 | | -https://radiantearth.github.io/stac-browser/#/external/s3-west.nrp-nautilus.io/public-data/stac/catalog.json |
31 | | -``` |
32 | | - |
33 | | -Edit `layers-input.json` — set your collections and adjust the default map view. |
34 | | -See the [configuration reference](https://boettiger-lab.github.io/geo-agent/docs/guide/configuration) for all fields. |
35 | | - |
36 | | -### 3. Edit `system-prompt.md` |
37 | | - |
38 | | -Describe the domain, what users are likely to ask, and include SQL examples relevant to your datasets. |
39 | | - |
40 | | -### 4. Deploy |
41 | | - |
42 | | -#### Option A: GitHub Pages (no server needed) |
43 | | - |
44 | | -The `llm` block in `layers-input.json` is already enabled. Each visitor enters their own API key (e.g. from [OpenRouter](https://openrouter.ai)) in the in-app settings panel — keys are stored in the browser only, never on the server. |
45 | | - |
46 | | -1. Enable GitHub Pages in your repo: Settings → Pages → Source → **GitHub Actions** |
47 | | -2. Add `.github/workflows/gh-pages.yml`: |
48 | | - |
49 | | -```yaml |
50 | | -name: Deploy to GitHub Pages |
51 | | -on: |
52 | | - push: |
53 | | - branches: [main] |
54 | | -permissions: |
55 | | - contents: read |
56 | | - pages: write |
57 | | - id-token: write |
58 | | -jobs: |
59 | | - deploy: |
60 | | - runs-on: ubuntu-latest |
61 | | - environment: |
62 | | - name: github-pages |
63 | | - url: ${{ steps.deployment.outputs.page_url }} |
64 | | - steps: |
65 | | - - uses: actions/checkout@v4 |
66 | | - - uses: actions/configure-pages@v5 |
67 | | - - uses: actions/upload-pages-artifact@v3 |
68 | | - with: |
69 | | - path: . |
70 | | - - id: deployment |
71 | | - uses: actions/deploy-pages@v4 |
72 | | -``` |
73 | | -
|
74 | | -3. Push — the workflow deploys automatically on changes to `main`. |
75 | | - |
76 | | -#### Option B: Kubernetes |
77 | | - |
78 | | -API keys are injected server-side via a ConfigMap + Kubernetes secrets — no user-facing key entry. |
79 | | - |
80 | | -1. Delete the `llm` block from `layers-input.json` (the server-injected `config.json` takes precedence anyway) |
81 | | -2. Replace the git clone URL in `k8s/deployment.yaml` with your repo URL |
82 | | -3. Replace the slug `calenviroscreen` throughout `k8s/` with your app name |
83 | | -4. Set your hostname in `k8s/ingress.yaml` |
84 | | -5. Create the required secret: |
85 | | - |
86 | | -```bash |
87 | | -kubectl create secret generic llm-proxy-secrets \ |
88 | | - --from-literal=proxy-key=YOUR_PROXY_KEY |
89 | | -``` |
90 | | - |
91 | | -6. Deploy: |
92 | | - |
93 | | -```bash |
94 | | -kubectl apply -f k8s/ |
95 | | -kubectl rollout status deployment/my-app |
96 | | -``` |
97 | | - |
98 | | -After pushing changes, redeploy: `kubectl rollout restart deployment/my-app` |
99 | | - |
100 | | -See the [deployment guide](https://boettiger-lab.github.io/geo-agent/docs/guide/deployment) for full details on all options including Hugging Face Spaces. |
| 26 | +This is a fork of [`boettiger-lab/geo-agent-template`](https://github.com/boettiger-lab/geo-agent-template); the JavaScript runtime is loaded from CDN. See the [geo-agent docs](https://boettiger-lab.github.io/geo-agent/) for the full configuration reference. |
101 | 27 |
|
102 | | -## Local development |
| 28 | +## Local preview |
103 | 29 |
|
104 | 30 | ```bash |
105 | 31 | python -m http.server 8000 |
106 | | -# Open http://localhost:8000 — enter your API key in the settings panel |
| 32 | +# Open http://localhost:8000 — enter an API key in the settings panel |
107 | 33 | ``` |
108 | | - |
109 | | -## More resources |
110 | | - |
111 | | -- [Configuration reference](https://boettiger-lab.github.io/geo-agent/docs/guide/configuration) — all `layers-input.json` fields with examples |
112 | | -- [Deployment guide](https://boettiger-lab.github.io/geo-agent/docs/guide/deployment) — GitHub Pages, Hugging Face Spaces, Kubernetes |
113 | | -- [Core library](https://github.com/boettiger-lab/geo-agent) — source code for the map, chat, and agent modules |
0 commit comments