Skip to main content

Architecture

Green Goods is an offline-first, single-chain platform for documenting regenerative work on-chain. The system is built as a Bun monorepo with six packages that communicate through clearly defined boundaries.

Package boundaries

PackageResponsibility
packages/clientGardener-facing PWA UI
packages/adminOperator-facing dashboard UI
packages/sharedHooks, providers, stores, business logic
packages/contractsSolidity modules + deployment scripts
packages/indexerEnvio event indexing and GraphQL surface
packages/agentAutomation/bot workflows

Architecture principles

  • DRY for shared hooks, query keys, and deployment addresses.
  • KISS for chain/environment model -- single chain set by VITE_CHAIN_ID.
  • YAGNI for config surface and feature toggles.
  • Separation of concerns across packages with strict import boundaries.
  • Offline-first -- the client PWA works without internet and syncs when connected.
  • Graceful degradation -- optional contract modules fail silently via try/catch.

System context

How all packages connect end-to-end: contracts emit events, the indexer materializes them into GraphQL, and frontends read through shared hooks.

Sibling projects

Green Goods is part of a trio of Greenpill projects that share identity, chain, and attestation infrastructure:

ProjectWhat it addsIntegration point
CoopBrowser-first knowledge capture, local AI refinement, group memoryRoost workspace embeds Green Goods member flows; evidence packaging feeds Hypercerts
WEFAGamified plant care and nature educationPlant verification creates attestation-grade nurture evidence; energy economy maps to impact

All three share passkey-first identity, ERC-4337 smart accounts, offline-first architecture, and EAS attestations on Arbitrum. See the Agent package docs for details on how the projects connect.

Deep dives

PageWhat you will learn
Local vs Global BalanceHow the offline-first job queue and two-indexer read path keep the PWA responsive while data settles on-chain.
Entity Relationship DiagramEvery domain entity, its fields, and how they relate -- from on-chain events through the indexer to the frontend.
Modular ApproachThe hub-and-spoke contract module system, package dependency graph, and Hats Protocol role tree.
Sequence DiagramsStep-by-step flows for garden minting, work submission, vault deposits, passkey onboarding, and more.

Next page

Next best action

Start with the offline-first architecture that makes Green Goods unique.

Local vs Global Balance