Sol.College

Structure lesson (licence does not allow quoting code)

endless-game-runner

Original
tushar1977/endless-game-runner
SuperStack fork
Blockchains/endless-game-runner @ 6251008
Stars
0
Last push (original)
2025-07-31
Languages
JavaScript, CSS, Rust, TypeScript, HTML, Python
Detected stack
AnchorMetaplexweb3.js
Categories
Gaming
Licence
none detected: code not quoted on Sol.College
Homepage
https://endless-game-runner.vercel.app

Architecture

39 source files. By extension: .js ×20, .rs ×14, .py ×3, .ts ×2.

Top-level directorySource files
frontend_surf20
surf16
backend3

On-chain programs: surf/programs/surf

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
init_playerInitPlayersurf/programs/surf/src/lib.rs:26
update_nftUpdateNftsurf/programs/surf/src/lib.rs:50
list_nftListNftsurf/programs/surf/src/lib.rs:54
buy_nftBuyNFTsurf/programs/surf/src/lib.rs:58
list_nftListNftsurf/programs/surf/src/instructions/list_nft.rs:9
update_nftUpdateNftsurf/programs/surf/src/instructions/update_nft.rs:6
buy_nftBuyNFTsurf/programs/surf/src/instructions/buy_nft.rs:9
update_playerUpdatePlayersurf/programs/surf/src/instructions/update_player.rs:4
init_playerInitPlayersurf/programs/surf/src/instructions/init_Player.rs:3

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
surf/tests/surf.tsPublicKey, getAssociatedTokenAddressSync, Keypair, SystemProgram, seeds, findProgramAddressSync
frontend_surf/src/components/NFTAdminPanel.jsPublicKey, Transaction, useWallet, getAssociatedTokenAddressSync, signTransaction, findProgramAddressSync
frontend_surf/src/components/listNFT.jsPublicKey, Transaction, signTransaction, getAssociatedTokenAddressSync, findProgramAddressSync, SystemProgram
surf/programs/surf/src/instructions/mint_nft.rsCpiContext, seeds, invoke_signed, Program, invoke, has_one
frontend_surf/src/components/myNft.jsPublicKey, signTransaction, getAssociatedTokenAddressSync, Transaction, findProgramAddressSync, useWallet
frontend_surf/src/components/mintOrUpdate.jsPublicKey, findProgramAddressSync, signTransaction, Transaction, getLatestBlockhash, Keypair
frontend_surf/src/Profile.jsPublicKey, WalletMultiButton, signTransaction, findProgramAddressSync, SystemProgram, useWallet
surf/programs/surf/src/instructions/buy_nft.rsseeds, Program, CpiContext, has_one, transfer, invoke
surf/programs/surf/src/instructions/list_nft.rsseeds, Program, has_one, CpiContext, Pubkey, AccountInfo
frontend_surf/src/hooks/useProgram.jssignTransaction, useWallet, Connection, PublicKey, AnchorProvider, Program
surf/programs/surf/src/instructions/update_nft.rsseeds, invoke_signed, Program, has_one, AccountInfo
frontend_surf/src/components/DevnetFaucet.jsrequestAirdrop, useWallet, Connection, PublicKey

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/endless-game-runner/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
frontend_surfnpm run start
surfnpm run lint
surfanchor build
surfanchor test
surfanchor run test

What you could build from it