explaingit

genlayerlabs/genlayer-project-boilerplate

12,551TypeScriptAudience · developerComplexity · 4/5Setup · moderate

TLDR

A starter template for building apps on GenLayer, a blockchain platform where smart contracts can fetch live internet data and use AI, includes a working football match betting game as a complete example.

Mindmap

mindmap
  root((repo))
    What It Is
      Starter boilerplate
      GenLayer blockchain app
      Football betting example
    Smart Contract
      Python on GenLayer
      Fetches live results
      Resolves bets on-chain
    Web Frontend
      Next.js app
      Radix UI components
      Connects to contract
    Setup
      GenLayer Studio required
      GenLayer CLI via npm
      Environment config file
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Deploy a smart contract that automatically fetches live sports results from a URL and resolves user bets without a middleman.

USE CASE 2

Build a Next.js web frontend that lets users place predictions and view results from a live GenLayer smart contract.

USE CASE 3

Use this boilerplate as a starting point for any GenLayer app that needs real-world data or AI inside a smart contract.

Tech stack

TypeScriptPythonNext.jsRadix UIGenLayer CLI

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires GenLayer Studio (hosted or local install) and the GenLayer CLI installed globally via npm before deployment.

In plain English

This repository is a starter project for building applications on GenLayer, a blockchain platform that allows smart contracts to call out to the internet and use AI during execution. The boilerplate comes with a working example: a football match betting game built as a smart contract. The football bets contract lets users place a prediction on which team will win a given match. After the match is over, anyone can trigger resolution, at which point the contract fetches the actual result from a URL and compares it against the stored predictions. Users who guessed correctly earn points. The contract also lets you query all bets and check point totals for any player. The project has three main parts. First, there is the smart contract itself, written in Python and deployed to GenLayer using a command-line tool called the GenLayer CLI. Second, there is a Next.js web frontend built with TypeScript, TanStack Query for data fetching, and Radix UI for interface components. The frontend connects to the deployed contract so users can interact with it through a browser. Third, there is a test suite that runs against the deployed contract in the GenLayer Studio environment to verify that creating bets, resolving them, and querying results all work correctly. To run this example, you need either the hosted GenLayer Studio or a local installation of it, plus the GenLayer CLI installed globally via npm. Setup involves deploying the contract, copying an environment configuration file, adding the deployed contract address, and starting the Next.js development server. This is a boilerplate template meant to be the starting point for new GenLayer projects, not a finished application.

Copy-paste prompts

Prompt 1
Set up the genlayerlabs/genlayer-project-boilerplate and deploy the football betting contract to GenLayer Studio step by step.
Prompt 2
Modify the football bets contract in genlayer-project-boilerplate to resolve bets for NBA games by fetching results from a different URL.
Prompt 3
Walk me through the full data flow from a user placing a bet in the Next.js frontend to it being stored and resolved in the GenLayer contract.
Prompt 4
Write a new GenLayer smart contract using this boilerplate that fetches live crypto prices and settles a prediction market automatically.
Open on GitHub → Explain another repo

← genlayerlabs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.