Skip to content

Bringing community and environmental actions onchain to better measure, track and reward impact on local communities with a simple PWA.

License

greenpill-dev-guild/green-goods

Β 
Β 

Green Goods

Green Goods is a decentralized platform for biodiversity conservation, enabling Garden Operators and Gardeners to document and get approval for conservation work through blockchain-based attestations.

πŸ—οΈ Repository Structure

green-goods/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ client/           # React PWA frontend (Gardener/Operator app)
β”‚   β”œβ”€β”€ admin/            # Admin dashboard (Garden & contract management)
β”‚   β”œβ”€β”€ indexer/          # GraphQL blockchain indexer
β”‚   └── contracts/        # Solidity smart contracts
β”œβ”€β”€ docs/                 # Documentation
β”œβ”€β”€ tests/                # End-to-end testing (Playwright)
└── scripts/              # Setup and utility scripts

πŸš€ Quick Start

Prerequisites

  • Node.js v20+ β€’ bun v9.x β€’ Docker β€’ Foundry

Setup & Run

# Clone and install
git clone https://github.com/your-org/green-goods.git
cd green-goods
bun install

# Configure environment (REQUIRED - all packages use root .env)
cp .env.example .env
# Edit .env with your API keys (see .env.example)

# Start all services (pm2: client, admin, indexer)
bun dev

# Tail logs
bun exec pm2 logs client
bun exec pm2 logs admin
bun exec pm2 logs indexer

βš™οΈ Environment Configuration

All packages use a single root .env file for configuration β€” no package-level .env files are used.

Key Environment Variables

# Client & Admin (Vite)
VITE_PRIVY_APP_ID=your_privy_app_id
VITE_CHAIN_ID=42161                     # Default chain (84532=Base Sepolia, 42161=Arbitrum, 42220=Celo)
VITE_ENVIO_INDEXER_URL=http://localhost:8080/v1/graphql
VITE_WALLETCONNECT_PROJECT_ID=your_project_id
VITE_PINATA_JWT=your_pinata_jwt

# Contracts (Foundry)
FOUNDRY_KEYSTORE_ACCOUNT=green-goods-deployer
BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
ARBITRUM_RPC_URL=https://arb1.arbitrum.io/rpc
CELO_RPC_URL=https://forno.celo.org
ETHERSCAN_API_KEY=your_etherscan_api_key

# Indexer (Envio)
# Most config in packages/indexer/config.yaml
# Add any overrides here if needed

How it works:

  • Vite packages (client, admin) load .env via vite.config.ts
  • Contracts load .env via deployment scripts and foundry.toml
  • Indexer loads .env via Docker Compose and scripts
  • All commands (dev, build, deploy) automatically reference root .env

See Environment Setup Guide for detailed configuration.

πŸ› οΈ Development

Essential Commands

# Development
bun dev                              # Start all services
bun --filter <package> dev           # Start individual service

# Building  
bun build                            # Build all packages
bun --filter <package> build         # Build specific package

# Smart Contracts
bun --filter contracts test             # Test contracts
bun --filter contracts deploy:local     # Deploy locally
bun --filter contracts deploy:testnet   # Deploy to testnet
bun --filter contracts deploy:arbitrum  # Deploy to Arbitrum
bun --filter contracts deploy:celo      # Deploy to Celo mainnet

# Quality
bun format && bun lint && bun test # Quality checks

🀝 Contributing

  1. Fork β†’ Branch β†’ Code β†’ Test β†’ PR
  2. Use conventional commits: feat:, fix:, docs:
  3. Git hooks auto-format and lint on commit/push

πŸ“š Documentation

Document Description
Architecture System design and architecture
Deployment Contract deployment guide
Karma GAP Impact attestation integration
Upgrades UUPS upgrade guide
Testing E2E and contract testing
Features Core platform features
Gas Limits Gas optimization guide
Production Readiness Production deployment checklist
Troubleshooting Common issues and solutions

Package docs: client β€’ admin β€’ indexer β€’ contracts


Stack: React β€’ Node.js β€’ Solidity β€’ GraphQL β€’ TypeScript
Tools: Biome β€’ 0xlint β€’ Solhint β€’ Playwright β€’ Foundry

License: MIT β€’ Setup: Environment Guide

Languages

  • TypeScript 60.1%
  • Solidity 23.3%
  • JavaScript 13.5%
  • CSS 2.8%
  • Other 0.3%