{"id":50288669,"url":"https://github.com/codewithveek/ecofarm","last_synced_at":"2026-05-28T04:04:20.033Z","repository":{"id":352530252,"uuid":"1215481849","full_name":"codewithveek/ecofarm","owner":"codewithveek","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-20T01:48:35.000Z","size":2374,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T03:36:13.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codewithveek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T00:44:49.000Z","updated_at":"2026-04-20T01:48:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codewithveek/ecofarm","commit_stats":null,"previous_names":["codewithveek/ecofarm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codewithveek/ecofarm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fecofarm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fecofarm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fecofarm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fecofarm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewithveek","download_url":"https://codeload.github.com/codewithveek/ecofarm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithveek%2Fecofarm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33593420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-28T04:04:13.417Z","updated_at":"2026-05-28T04:04:20.013Z","avatar_url":"https://github.com/codewithveek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌱 EcoFarm\n\n\u003e Grow trees. Earn points. Heal the planet.\n\u003e A gamified 2D farm where every action is backed by real-world weather data,\n\u003e AI agents, and on-chain proof of care.\n\nBuilt for the **DEV Weekend Challenge: Earth Day Edition 2026**.\n\n---\n\n## Tech stack\n\n| Layer | Tech |\n|---|---|\n| Game engine | Phaser.js v4 |\n| Auth + agent identity | Auth0 for Agents |\n| AI agent | Google Gemini 2.0 Flash |\n| Backend | Node.js + Express |\n| Database | Neon Postgres (free tier) |\n| Weather data | Open-Meteo (free, no key) |\n| Air quality | OpenAQ (free) |\n| On-chain logs | Solana (devnet) |\n\n---\n\n## Quick start\n\n### 1. Clone \u0026 install\n\n```bash\ngit clone https://github.com/you/ecofarm\ncd ecofarm\nnpm install\n```\n\n### 2. Configure environment\n\n```bash\ncp .env.example .env.local\n# Fill in your Auth0, Neon, and Gemini credentials\n```\n\n### 3. Run the database migration\n\n```bash\npsql $DATABASE_URL -f server/migrations/001_init.sql\n```\n\n### 4. Start everything\n\n```bash\nnpm run dev:all\n# Game:   http://localhost:3000\n# Server: http://localhost:4000\n```\n\n---\n\n## Project structure\n\n```\necofarm/\n├── index.html\n├── vite.config.js\n├── .env.example\n│\n├── src/                        # Phaser v4 client\n│   ├── main.js                 # Game bootstrap\n│   ├── config/\n│   │   └── game.config.js      # Constants, API URLs, stage defs\n│   ├── scenes/\n│   │   ├── BootScene.js        # Auth0 initialisation\n│   │   ├── PreloadScene.js     # Asset loading + animation defs\n│   │   ├── AuthScene.js        # Login screen\n│   │   ├── FarmScene.js        # Main 2D farm (tilemap + farmer)\n│   │   ├── UIScene.js          # HUD overlay (runs parallel)\n│   │   ├── LeaderboardScene.js # Global leaderboard overlay\n│   │   └── AgentScene.js       # Agent panel overlay\n│   ├── systems/\n│   │   ├── PlotManager.js      # All farm plots + tree growth\n│   │   └── WeatherSystem.js    # Open-Meteo fetch + visual effects\n│   ├── agents/                 # (future) client-side agent UI helpers\n│   └── utils/\n│       └── FarmAPI.js          # All backend HTTP calls\n│\n├── server/                     # Node.js backend\n│   ├── index.js                # Express app + cron scheduler\n│   ├── db.js                   # Neon Postgres abstraction\n│   ├── routes/\n│   │   ├── farm.js             # GET /api/farm, POST /api/farm/plots/:id/:action\n│   │   └── combined.js         # /api/agent, /api/leaderboard, /api/pledge\n│   ├── agents/\n│   │   └── AgentRunner.js      # Gemini-powered agent (runs every 6h)\n│   ├── services/\n│   │   ├── weather.service.js  # Open-Meteo + OpenAQ wrappers\n│   │   └── solana.service.js   # Memo transaction logger\n│   └── migrations/\n│       └── 001_init.sql        # Postgres schema\n│\n├── shared/\n│   └── constants.js            # Shared between client + server\n│\n└── public/\n    └── assets/\n        ├── tilemaps/           # farm.json (Tiled), terrain.png, decor.png\n        ├── sprites/            # trees.png, farmer.png, water-splash.png, etc.\n        ├── audio/              # plant.mp3, water.mp3, harvest.mp3, ambient.mp3\n        └── fonts/              # farm-font.png + farm-font.xml (bitmap font)\n```\n\n---\n\n## How the agent works\n\n1. User opens **Agent panel** → toggles permission scopes (Auth0 for Agents issues scoped tokens)\n2. Server cron fires every 6 hours per active-agent user\n3. `AgentRunner` fetches farm state + Open-Meteo rainfall for the user's location\n4. Sends context to **Gemini 2.0 Flash** → receives a JSON decision array\n5. Agent executes only actions within the user's granted scopes\n6. Each action is logged as a **Solana memo transaction** (verifiable proof)\n7. User gets a notification: *\"Your agent watered 7 trees — Lagos had 8mm rain today\"*\n\n---\n\n## Prize categories targeted\n\n- ✅ **Best use of Auth0 for Agents** — agent scope delegation + token issuance\n- ✅ **Best use of Google Gemini** — farm decision AI\n- ✅ **Best use of Solana** — on-chain action proof + optional NFT farm plots\n- ✅ **Best use of GitHub Copilot** — used throughout development\n\n---\n\n## Assets needed (create or source)\n\n| File | Description |\n|---|---|\n| `assets/tilemaps/farm.json` | Tiled map — 8×6 grid, Ground + Paths + Decor layers |\n| `assets/tilemaps/terrain.png` | Grass, dirt, path tiles (64×64) |\n| `assets/sprites/trees.png` | 6 columns × N rows spritesheet (stage × tree type) |\n| `assets/sprites/farmer.png` | 4-direction walk cycle, 48×64 frames |\n| `assets/sprites/water-splash.png` | 8-frame splash animation, 32×32 |\n| `assets/audio/ambient.mp3` | Looping farm background sound |\n\nFree sources: [OpenGameArt](https://opengameart.org), [itch.io free assets](https://itch.io/game-assets/free), [Kenney.nl](https://kenney.nl/assets)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithveek%2Fecofarm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithveek%2Fecofarm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithveek%2Fecofarm/lists"}