- Go 38.7%
- HTML 25.8%
- Elm 13.5%
- Mercury 4.3%
- Makefile 3.3%
- Other 14.4%
|
|
||
|---|---|---|
| cmd/terrapyre | ||
| docs | ||
| frontend | ||
| internal | ||
| pkg | ||
| scripts | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
terrapyre
peer-to-peer climate resilience platform
decentralized climate data science for people who need it. no cloud, no vendor lock-in, no PhD required.
terrapyre v0.1.0-dev
what it is
a platform where farmers, local officials, and climate scientists can upload data, ask questions, and get actionable predictions -- powered by a polyglot engine they never have to see.
martha in kenya uploads a CSV from a $12 soil sensor. she gets a maize yield forecast with uncertainty bounds. she shares it with her cooperative via a link that never expires. no code, no cloud, no gatekeeping.
stack
| language | role |
|---|---|
| Go | orchestrator, session management, websocket, api |
| Elm | frontend ui, zero runtime exceptions |
| Veilid | p2p storage, decentralized dataset distribution |
| Julia | primary compute engine, fortran bridge |
| R | statistical analysis, ggplot2 visualization |
| Fortran | validated atmospheric + climate models |
| Mercury | policy enforcement, data sovereignty rules |
| Zig | hot path acceleration (replaces Carbon) |
| x86 asm | simd inner loops inside Zig |
| Orca | live parameter tuning (expert mode) |
| Groovy | build automation, ci |
| Java | enterprise integration layer (optional) |
| JSON | wire format throughout |
build
# check deps
make check-deps
# build go + zig (minimum viable)
make all
# Elm frontend (one-time: fetch compiler if you don't have elm on PATH)
make get-elm
make elm
# optional: rest of stack
make julia-deps
make r-deps
# dev server
make dev
Elm: The UI is Elm. Use make get-elm to download the official Elm 0.19.1 binary into bin/elm (no Node/npm required). Or install Elm and run make elm. From frontend/ you can also use Bun (bun run build) or npm (npm run build) if you add elm to the path or use a global install—Bun is faster for installs and script runs.
project layout
terrapyre/
├── cmd/terrapyre/ # go entry point
├── internal/
│ ├── orchestrator/ # session mgmt, handlers, websocket dispatch
│ ├── veilid/ # p2p storage layer (stub -> real bindings)
│ ├── policy/ # mercury policy engine (go interpreter -> mercury)
│ └── models/ # model runner, pipeline definitions
│ ├── rainfall/ # atmospheric.jl + statistical.R
│ ├── crop/ # glm.R + montecarlo.jl
│ └── flood/ # inundation.jl
├── pkg/
│ ├── zig/ # raster_process.zig (hot path)
│ ├── fortran/ # atmospheric model (.f90)
│ └── mercury/ # policy rules (.m)
├── frontend/ # elm ui
├── scripts/ # build_all.groovy
├── static/ # compiled elm output
├── Makefile
└── go.mod
roadmap
- go orchestrator skeleton
- session manager
- websocket dispatch
- veilid stub (local fs)
- mercury policy engine (go interpreter)
- model runner (subprocess)
- julia rainfall stub
- r statistical correction stub
- zig raster processor stub
- elm frontend
- orca osc listener
- real veilid bindings
- mercury -> real mercury compilation
- fortran atmospheric model integration
- java enterprise layer
- webrtc peer sessions
- desktop app packaging (tauri or wails)
deploying publicly
- License: MIT (see LICENSE).
- Default config: Server binds
0.0.0.0:7700; run without--devin production so logging and WebSocket origin checks are stricter. - CORS: Default is permissive (
*). For a public deployment, restrictAccess-Control-Allow-Originin the orchestrator to your frontend origin(s). - Secrets: No API keys or credentials are in the repo. Add a config file (e.g.
terrapyre.toml) and keep it out of version control if you add secrets later. - Go module: If you fork or mirror the repo, update the module path in
go.modto match your import path, or usego mod edit -replacewhen developing locally.
data sovereignty
every dataset on terrapyre is owned by its uploader. mercury policies are compiled to logical rules that the orchestrator enforces before any model can access data. a non-commercial research dataset cannot be used for commercial export -- not by policy, by logic.
built by lifelessai / git.hexed.systems
