Glossary: treetracker-query-api
Generated by .github/scripts/build-glossary.mjs from domain-graph.json (source commit 42897d6). Do not edit by hand.
This glossary lists the business terms of treetracker-query-api. Each term links to its domain, which says what the domain does, its rules, and its flows. The estate glossary shows which other repos use the same terms.
Terms
- Bounds: Geospatial & Mapping
- Capture: Tree & Capture Data
- Contract: Token & Transaction Ledger
- Country: Geospatial & Mapping
- GisFeature: Geospatial & Mapping
- GrowerAccount: Stakeholder Directory
- Organization: Stakeholder Directory
- Planter: Stakeholder Directory
- RawCapture: Tree & Capture Data
- Species: Species Catalog
- Stakeholder: Stakeholder Directory
- Token: Token & Transaction Ledger
- Transaction: Token & Transaction Ledger
- Tree: Tree & Capture Data
- Wallet: Token & Transaction Ledger
Domains
Tree & Capture Data
Core observation data of the platform. Exposes queries over trees, processed captures, and raw (unprocessed) captures, including filtered lists, counts, single-record lookups, and featured trees. This is the primary evidence that a tree was planted and geolocated.
Terms: Tree, Capture, RawCapture
Rules:
- Queries are read-only; the API never mutates capture data
- Trees and captures can be filtered by organization, date range, tag, wallet, and geometry
- Featured trees are returned via a dedicated endpoint (with a deprecated hardcoded fallback)
- Results are paginated with limit/offset
Flows:
- Query Trees (
GET /trees, /trees/:val, /trees/featured): Return trees matching filters (organization, date, tag, wallet, geometry), fetch a tree by id/UUID, provide counts, or return featured trees. - Query Captures (
GET /v2/captures, /v2/captures/:id, /v2/captures/count): Return processed tree captures matching filters, fetch a capture by id, or return capture counts. - Query Raw Captures (
GET /raw-captures, /raw-captures/:id, /raw-captures/count): Return raw (unprocessed) tree captures matching filters, fetch one by id, or return counts.
Stakeholder Directory
The people and organizations behind the trees. Exposes planters, grower accounts (v2), organizations (v1 and v2), and stakeholder lookups. Builds HATEOAS resource links to related trees, organizations, and species.
Terms: Planter, GrowerAccount, Organization, Stakeholder
Rules:
- Planters, growers, and organizations can be listed by filter, fetched by id, or requested as featured
- Grower accounts expose counts, featured selection, wallets, and selfies
- Responses embed HATEOAS links to featured trees, organizations, and species
- V2 organization queries additionally support grower-based lookups
Flows:
- Query Planters (
GET /planters, /planters/:id, /planters/featured): Return planters by filter, fetch a planter by id, or return featured planters, with HATEOAS links to trees, organizations, and species. - Query Grower Accounts (
GET /v2/growers, /v2/growers/:id, /v2/growers/count, /v2/growers/featured): Return grower accounts, counts, featured growers, wallets, and selfies, or a single grower by id, with HATEOAS links. - Query Organizations (
GET /organizations, /organizations/:id, /organizations/featured (and /v2/organizations)): Return organizations by filter, fetch by id, or return featured organizations; v2 additionally supports grower-based lookups. Builds organization resource links.
Species Catalog
Catalog of tree species. Exposes filtered species lists and single-species lookups, and supports grouping species by organization, planter, or wallet with counts.
Terms: Species
Rules:
- Species can be filtered by keyword, morphology, and range with pagination
- Species can be grouped and counted by organization, planter, or wallet
Flows:
- Query Species (
GET /species, /species/:id (and /v2/species)): Return species matching a filter (keyword, morphology, range) or fetch a single species by id, grouped and counted by organization, planter, or wallet.
Geospatial & Mapping
Spatial support for rendering the web map. Computes map bounding boxes from tree capture coordinates, resolves the nearest GIS feature to a lat/lon point using PostGIS, and serves country geometries plus a planting leaderboard.
Terms: Bounds, Country, GisFeature
Rules:
- Bounds are computed by planter, wallet, or organization from capture coordinates
- Nearest-feature lookups validate coordinate inputs before running raw PostGIS distance queries
- Country responses serialize centroids as GeoJSON
- Country leaderboard aggregates planting counts by region
- Country responses can be served from an LRU cache when caching is enabled
Flows:
- Compute Map Bounds (
GET /bounds): Compute a geographic bounding box for a planter, wallet, or organization from tree capture coordinates so the web map can frame its view. - Find Nearest GIS Feature (
GET /gis): Resolve the nearest geographic feature to a supplied lat/lon point using raw PostGIS distance queries. - Query Countries & Leaderboard (
GET /countries, /countries/:id, /countries/leaderboard, /countries/leaderboard/:region (and /v2)): Return country records by id or spatial filter with GeoJSON centroids, and a planting leaderboard aggregated by region, optionally served from an LRU cache.
Token & Transaction Ledger
Impact accounting layer. Exposes issued tokens (linked to captures and wallets), token transactions between wallets, wallet records, and contract records. Read-only queries with filtering, counting, and pagination.
Terms: Token, Transaction, Wallet, Contract
Rules:
- Tokens link a capture to a wallet and track transfer and claim state
- Transactions record source and destination wallets with processing metadata
- Tokens, transactions, and contracts are queried by id and by filter with counts
Flows:
- Query Tokens (
GET /tokens, /tokens/:tokenId (and /v2/tokens)): Return issued tokens matching a filter with counts and pagination, or fetch a single token by id. - Query Transactions (
GET /transactions): Return token transactions between wallets via filtered lookups over a database session. - Query Contracts (
GET /contract): Return contract records by filter, fetch by id, or return contract counts using dynamic where-clause building.