OpenSource-Hub

genlayer-project-boilerplate

应用程序

genlayerlabs/genlayer-project-boilerplate

GenLayer 智能合约项目模板,含前端与测试工具。

项目简介

一个可直接上手的 GenLayer 示例项目,实现了足球竞猜游戏。包含集成 Web/LLM 的 Python 智能合约、直接/集成测试套件、Next.js 15 前端和 CI 流水线,适合作为 GenLayer 开发起点。

README 预览

# Sample GenLayer project\n[](https://opensource.org/license/mit/)\n[](https://discord.gg/8Jm4v89VAu)\n[](https://t.me/genlayer)\n[](https://x.com/GenLayer)\n[](https://star-history.com/#yeagerai/genlayer-js)\n\n## About\nThis project includes the boilerplate code for a GenLayer use case implementation, specifically a football bets game.\n\n## What's included\n- An example intelligent contract (Football Bets) with web access and LLM integration\n- **Direct mode tests** — fast, in-memory unit tests with web/LLM mocking (~ms per test)\n- **Integration tests** — full end-to-end tests against GenLayer Studio\n- **Contract linting** — static analysis to catch common contract issues before deployment\n- **CI pipeline** — GitHub Actions workflow for linting and direct tests\n- A production-ready Next.js 15 frontend with TypeScript, TanStack Query, and Radix UI\n- Configuration file template and deployment scripts\n\n## Requirements\n- Python >= 3.12\n- [GenLayer CLI](https://github.com/genlayerlabs/genlayer-cli) globally installed: `npm install -g genlayer`\n- GenLayer Studio (for integration tests and deployment): Install from [Docs](https://docs.genlayer.com/developers/intelligent-contracts/tooling-setup#using-the-genlayer-studio) or use the hosted [GenLayer Studio](https://studio.genlayer.com/)\n\n## Project Structure\n\n```\ncontracts/              # Python intelligent contracts\ntests/\n  direct/               # Fast in-memory tests (no Studio required)\n    test_create_bet.py   # Bet creation logic\n    test_resolve_bet.py  # Bet resolution with web/LLM mocks\n    test_views.py        # Read-only view methods\n  integration/           # Full tests against GenLayer Studio\n    test_football_bets.py\n    fixtures.py          # Expected state fixtures\nfrontend/               # Next.js 15 app (TypeScript, TanStack Query, Radix UI)\ndeploy/                 # TypeScript deployment scripts\ngltest.config.yaml      # Test runner network configuration\npyproject.toml