Green Goods

Measures, tracks, and rewards the impact on gardens with a simple progressive web app.
https://github.com/greenpill-dev-guild/green-goods

Category: Biosphere
Sub Category: Biodiversity Citizen Science

Keywords

attestations biodiversity biodiversity-monitoring community conservation environment ethereum foundry greenpill impact ipfs public-goods pwa regenerative smart-contracts solidity tailwindcss typescript vite web3

Keywords from Contributors

archiving measur transforms generic optimize compose observation conversion projection animals

Last synced: 1 day ago
JSON representation

Repository metadata

Bringing biodiversity data onchain to better measure, track and reward impact on gardens with a simple PWA.

https://github.com/greenpill-dev-guild/green-goods/blob/develop/

          # 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 Architecture

The project is organized as a monorepo using pnpm workspaces:

```
green-goods/
├── packages/
│   ├── client/           # Frontend React application
│   ├── contracts/        # Smart contracts and deployment scripts
│   └── server/           # Backend services and APIs
├── apps/                 # Additional applications
└── docs/                 # Documentation
```

### Key Components

#### Client (`packages/client`)

- React-based Progressive Web App (PWA)
- Built with Vite, TypeScript, and Tailwind CSS
- Handles user authentication, garden management, and blockchain interactions

#### Contracts (`packages/contracts`)

- Solidity smart contracts for garden management
- Foundry-based deployment scripts
- Integration with Privy for wallet management

#### Server (`packages/server`)

- Backend services and APIs
- Handles data persistence and business logic
- Integrates with blockchain networks

## 🚀 Getting Started

### Prerequisites

- Node.js (v20 or higher)
- pnpm (v9.x)
- Foundry (for smart contract development)
- Git

### Installation

1. Clone the repository:

   ```bash
   git clone https://github.com/your-org/green-goods.git
   cd green-goods
   ```

2. Install dependencies:

   ```bash
   pnpm install
   ```

3. Set up environment variables:

   ```bash
   # Copy example env files
   cp packages/client/.env.example packages/client/.env
   cp packages/contracts/.env.example packages/contracts/.env
   cp packages/server/.env.example packages/server/.env
   ```

4. Configure environment variables:
   - `PRIVY_CLIENT_ID`: Your Privy application ID
   - `PRIVY_APP_SECRET_ID`: Privy app secret
   - `PRIVY_AUTHORIZATION_PRIVATE_KEY`: Privy authorization key
   - `PINATA_JWT`: Pinata API JWT token
   - `PRIVATE_KEY`: Ethereum private key for deployments

## 💻 Development

### Running the Development Environment

1. Start the client:

   ```bash
   pnpm --filter client dev
   ```

2. Start the server:

   ```bash
   pnpm --filter server dev
   ```

3. Deploy contracts (if needed):
   ```bash
   pnpm --filter contracts deploy
   ```

### Testing

Run tests across all packages:

```bash
pnpm test
```

Run tests for a specific package:

```bash
pnpm --filter  test
```

### Code Quality and Formatting

```bash
# Format code across all packages
pnpm format

# Check formatting without applying changes
pnpm format:check

# Lint and check code quality (ultra-fast with oxlint)
pnpm lint

# Run oxlint specifically (10-100x faster than ESLint)
pnpm lint:oxlint

# Type check all packages (if available)
pnpm typecheck
```

## ⚡ Development Tools & Performance

### Linting & Code Quality

We use a **high-performance linting setup**:

- **Oxlint**: Ultra-fast Rust-based linter
- **Biome**: Fast formatting and basic checks
- **Combined**: Complete code quality coverage

**Performance:**
- **Linting Speed**: 30ms on 84 files
- **Rules**: 99 comprehensive rules including React, TypeScript, and accessibility

### Build System

The project supports **dual build systems**:

#### Production Builds (Recommended)
```bash
pnpm run build              # Optimized Vite build with chunking
```
- **Bundle Size**: 4.4MB main bundle with optimal code splitting
- **Build Time**: ~33 seconds with full optimization
- **Features**: Dynamic imports, PWA support, optimal chunking

#### Experimental Builds (Development/Testing)
```bash
pnpm run build:rolldown     # Experimental rolldown-vite build
```
- **Purpose**: Testing next-generation bundling technology
- **Performance**: Similar output with experimental Rust-based bundling
- **Status**: Based on [Vite's Rolldown integration](https://vite.dev/guide/rolldown)

### Bundle Optimization

**Dynamic Imports Implemented:**
- Landing & Login components: Lazy-loaded for better initial load
- Feature components: Assessment, Garden, WorkApproval split into separate chunks
- **Result**: Optimized bundle size with better loading performance

**Chunk Analysis:**
- `Assessment-*.js` (0.36 kB) - Assessment component
- `Garden-*.js` (10.81 kB) - Garden component  
- `WorkApproval-*.js` (66.11 kB) - Work approval component
- Main bundle: Optimally chunked vendor libraries

## 🛠️ Core Technologies

### Frontend

- **React**: UI library
- **Vite**: Build tool and dev server (with experimental Rolldown support)
- **TypeScript**: Type safety
- **Tailwind CSS**: Styling
- **TanStack Query**: Data fetching and caching
- **Privy**: Authentication and wallet management
- **Radix UI**: Accessible UI components
- **React Hook Form**: Form management
- **Biome**: Fast formatting and linting
- **Oxlint**: Ultra-fast Rust-based linting (replaces ESLint)

### Smart Contracts

- **Solidity**: Smart contract language
- **Foundry**: Development framework
- **Hardhat**: Alternative development environment

### Backend

- **Node.js**: Runtime
- **Express**: Web framework
- **TypeScript**: Type safety
- **Prisma**: Database ORM

## 📦 Package Management

### Adding Dependencies

```bash
# Add to specific package
pnpm --filter  add 

# Add dev dependency
pnpm --filter  add -D 
```

### Workspace Scripts

```bash
# Run script in specific package
pnpm --filter  

# Run script in all packages
pnpm -r 
```

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch:
   ```bash
   git checkout -b feature/your-feature-name
   ```
3. Make your changes
4. **Git hooks will automatically**:
   - Format and lint staged files on commit (pre-commit hook)
   - Run comprehensive quality checks on push (pre-push hook)
5. Manual quality checks (optional):
   ```bash
   pnpm format
   pnpm test
   pnpm lint
   ```
6. Commit your changes:
   ```bash
   git commit -m "feat: your feature description"
   ```
7. Push to your fork
8. Create a pull request

### Commit Convention

We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:

- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation changes
- `style`: Code style changes
- `refactor`: Code refactoring
- `test`: Adding or modifying tests
- `chore`: Maintenance tasks

### Pull Request Process

1. Update documentation if needed
2. Add tests for new features
3. Ensure all tests pass
4. Update the changelog
5. Get code review approval
6. Merge after approval

## 📚 Documentation

- [Architecture Overview](./docs/architecture.md)
- [API Documentation](./docs/api.md)
- [Smart Contract Documentation](./docs/contracts.md)
- [Contributing Guidelines](./docs/contributing.md)

## 🔐 Security

- Report security vulnerabilities to [email protected]
- Do not disclose security-related issues publicly

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- [Privy](https://www.privy.io/) for authentication and wallet management
- [Pinata](https://pinata.cloud/) for IPFS services
- [Foundry](https://getfoundry.sh/) for smart contract development
- All contributors and supporters of the project

        

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 3 days ago

Total Commits: 156
Total Committers: 5
Avg Commits per committer: 31.2
Development Distribution Score (DDS): 0.244

Commits in past year: 103
Committers in past year: 3
Avg Commits per committer in past year: 34.333
Development Distribution Score (DDS) in past year: 0.058

Name Email Commits
Afo o****1@g****m 118
0xWildhare s****9@g****m 31
dependabot[bot] 4****] 3
Alexander Mangel c****r@g****m 3
mrcn m****a@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 110
Total pull requests: 44
Average time to close issues: 4 months
Average time to close pull requests: 2 days
Total issue authors: 6
Total pull request authors: 3
Average comments per issue: 0.06
Average comments per pull request: 1.2
Merged pull request: 32
Bot issues: 0
Bot pull requests: 7

Past year issues: 53
Past year pull requests: 44
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 2 days
Past year issue authors: 6
Past year pull request authors: 3
Past year average comments per issue: 0.11
Past year average comments per pull request: 1.2
Past year merged pull request: 32
Past year bot issues: 0
Past year bot pull requests: 7

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/greenpill-dev-guild/green-goods

Top Issue Authors

  • Oba-One (87)
  • c-georgen (13)
  • marcaumdesign (7)
  • Cygnusfear (1)
  • cauetomaz (1)
  • moose-code (1)

Top Pull Request Authors

  • Oba-One (33)
  • dependabot[bot] (7)
  • Cygnusfear (4)

Top Issue Labels

  • design (25)
  • story (24)
  • contract (19)
  • component (16)
  • state-logic (15)
  • documentation (10)
  • api (9)
  • javascript (4)
  • infrastructure (2)
  • good first issue (1)

Top Pull Request Labels

  • contract (10)
  • api (10)
  • component (10)
  • state-logic (10)
  • dependencies (7)
  • javascript (7)
  • documentation (2)
  • database (1)
  • enhancement (1)

Score: 5.752572638825633