Developer Quickstart

Get the Green Goods monorepo running locally in 10 minutes. Start building on the regenerative impact protocol.


What You'll Need

  • πŸ–₯️ macOS, Linux, or Windows (WSL2)

  • πŸ“¦ Bun (v1.0+)

  • πŸ”¨ Foundry (for contracts)

  • 🐳 Docker Desktop (for indexer)

  • πŸ”§ Git

Optional but recommended:

  • 🦊 MetaMask or another web3 wallet

  • πŸ”‘ Test ETH on Base Sepolia (faucet)


Step 1: Clone and Install

1.1 Clone the Repository

git clone https://github.com/greenpill-dev-guild/green-goods.git
cd green-goods

1.2 Install Dependencies

This installs all dependencies across the monorepo (client, admin, indexer, contracts).

What's installed:

  • Frontend dependencies (React, Vite, TanStack Query)

  • Smart contract tools (Solidity, Foundry)

  • Indexer dependencies (Envio, ReScript)

  • Development tools (Biome, 0xlint, Vitest)


Step 2: Configure Environment

2.1 Create .env File

2.2 Add Required Variables

Edit .env with your preferred editor:

Get API Keys:

2.3 (Optional) Import Deployer Key

For contract deployment:

Detailed Environment Setup β†’


Step 3: Start the Full Stack

Green Goods uses PM2 to orchestrate all services.

3.1 Start Everything

This starts:

  • βœ… Client PWA: https://localhost:3001 (HTTPS via mkcert)

  • βœ… Admin Dashboard: http://localhost:3002

  • βœ… Indexer: http://localhost:8080 (GraphQL playground)

Services Running All services running via PM2

3.2 Verify Services

Check service status:

View logs:

3.3 Stop Services


Step 4: Explore the Stack

4.1 Client PWA (https://localhost:3001)

The main gardener-facing Progressive Web App.

Key Features to Explore:

  • Passkey authentication (works on localhost)

  • MDR workflow (Media β†’ Details β†’ Review)

  • Offline queue (disconnect WiFi and try submitting)

  • Work dashboard

Tech Stack:

  • React 18 + TypeScript + Vite

  • TanStack Query + Zustand

  • Tailwind CSS v4 + Radix UI

  • Offline-first architecture

Client Package Docs β†’

4.2 Admin Dashboard (http://localhost:3002)

Operator and admin interface.

Key Features to Explore:

  • Wallet connection (MetaMask)

  • Garden management (create, edit, view)

  • Work review interface

  • Member management

Tech Stack:

  • React 18 + TypeScript + Vite

  • Urql (GraphQL) + XState + Zustand

  • Tailwind CSS v4 + Radix UI

Admin Package Docs β†’

4.3 GraphQL Indexer (http://localhost:8080)

Envio indexer exposing Green Goods blockchain data.

Try a Query:

  1. Visit http://localhost:8080

  2. Password: testing

  3. Run example query:

Tech Stack:

  • Envio HyperIndex

  • PostgreSQL (via Docker)

  • GraphQL API

  • ReScript event handlers

Indexer Package Docs β†’


Step 5: Run Tests

Green Goods has comprehensive test coverage.

5.1 Client Tests

Test Types:

  • Component tests (Vitest + Testing Library)

  • Hook tests

  • Integration tests

  • Service layer tests

5.2 Admin Tests

5.3 Contract Tests

Test Types:

  • Unit tests (Foundry)

  • Integration tests

  • Gas optimization tests

  • Upgrade safety tests

5.4 Run All Tests

Testing Guide β†’


Step 6: Deploy to Testnet (Optional)

6.1 Compile Contracts

6.2 Deploy to Base Sepolia

Dry run first (simulation):

Deploy for real:

What gets deployed:

  • GardenToken (NFT registry)

  • ActionRegistry (task definitions)

  • Resolvers (work and approval logic)

  • Schemas (EAS attestation templates)

  • Root "Green Goods Community Garden"

Deployment Guide β†’


Common Development Tasks

Run Specific Package

Format Code

Uses Biome (35x faster than Prettier).

Lint Code

Uses 0xlint (30ms on entire codebase) + Biome.

Build for Production


Project Structure

Key Files

  • package.json: Workspace scripts and dependencies

  • biome.json: Formatting and linting config

  • .gitbook.yaml: GitBook documentation config

  • ecosystem.config.js: PM2 service definitions

Monorepo Structure Guide β†’


Next Steps for Developers

🎨 Frontend Development

Build new features:

  • Create UI components with Radix + Tailwind

  • Add hooks using TanStack Query

  • Implement offline workflows with job queue

  • Add internationalization (en/es/pt)

Example: Add Garden Filter:

⛓️ Smart Contract Development

Extend contracts:

  • Add new resolver logic

  • Create custom action types

  • Implement garden templates

  • Add governance features

Example: Custom Action Type:

πŸ“Š Indexer Development

Add new queries:

  • Define entities in schema.graphql

  • Add event handlers in src/EventHandlers.ts

  • Run bun codegen to regenerate types

Example: Track Action Completion Rates:

πŸ”— API Integrations

Build external tools using the GraphQL API:


Troubleshooting

"bun not found"

Install Bun: https://bun.sh/docs/installation

"Port already in use"

"Docker not running"

"Foundry commands not found"

Install Foundry:

"Indexer fails to start"


Learn More

Developer Guides

Package Documentation

Design Resources

Community


What's Next?

You're now set up to build on Green Goods! πŸŽ‰

Your developer toolkit:

  • βœ… Full monorepo running locally

  • βœ… All services orchestrated via PM2

  • βœ… Tests passing

  • βœ… Ready to build features or integrations

Start building:

  • Explore the codebase

  • Build a custom integration

  • Propose a new feature


Ready to contribute? Read Contributing Guide β†’

Last updated