Sol.College

Structure lesson (licence does not allow quoting code)

collosseum-hackathon-submit

Original
getBonny/collosseum-hackathon-submit
SuperStack fork
Blockchains/collosseum-hackathon-submit @ 4e68342
Stars
0
Last push (original)
2024-06-09
Languages
TypeScript, SCSS, HTML, Rust, Swift, JavaScript
Detected stack
Anchorweb3.js
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

246 source files. By extension: .ts ×228, .rs ×15, .js ×3.

Top-level directorySource files
bonny-frontend122
bonny-backend103
bonny-program-library18
bonny-function-parse-receipt3

On-chain programs: bonny-program-library/programs/bonny-program-library

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
initializeInitializebonny-program-library/programs/bonny-program-library/src/lib.rs:19
reward_pool_createRewardPoolCreatebonny-program-library/programs/bonny-program-library/src/lib.rs:24
reward_pool_transferRewardPoolTransferbonny-program-library/programs/bonny-program-library/src/lib.rs:29
user_createUserCreatebonny-program-library/programs/bonny-program-library/src/lib.rs:34
actuateSelfbonny-program-library/programs/bonny-program-library/src/actions/reward_pool_transfer.rs:61
actuateSelfbonny-program-library/programs/bonny-program-library/src/actions/initialize.rs:34
actuateSelfbonny-program-library/programs/bonny-program-library/src/actions/user_create.rs:58
actuateSelfbonny-program-library/programs/bonny-program-library/src/actions/reward_pool_create.rs:66

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
bonny-backend/src/service/solana/pda.tsPublicKey, findProgramAddressSync, getAssociatedTokenAddressSync
bonny-program-library/tests/bonny-program-library.spec.tsSystemProgram, PublicKey, Transaction, sendAndConfirmTransaction, Program, Keypair
bonny-backend/src/service/solana/solana.service.tsPublicKey, SystemProgram, AnchorProvider, Connection, Keypair, Program
bonny-program-library/tests/pda.tsPublicKey, findProgramAddressSync, getAssociatedTokenAddressSync
bonny-program-library/programs/bonny-program-library/src/actions/reward_pool_create.rsseeds, Program, AccountInfo, invoke_signed, invoke
bonny-program-library/programs/bonny-program-library/src/actions/user_create.rsProgram, AccountInfo, seeds, invoke_signed, invoke
bonny-program-library/programs/bonny-program-library/src/actions/reward_pool_transfer.rsseeds, Program, invoke, AccountInfo, invoke_signed
bonny-frontend/src/app/login/service/login.service.tsPublicKey, Transaction, signTransaction
bonny-backend/src/controller/auth/auth.service.tsPublicKey
bonny-program-library/programs/bonny-program-library/src/program_wrappers/token_2022.rsPubkey
bonny-backend/src/controller/auth/auth.controller.tsTransaction

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/collosseum-hackathon-submit/. 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
bonny-frontendnpm run start
bonny-frontendnpm run build
bonny-frontendnpm run test
bonny-frontendnpm run lint
bonny-program-librarynpm run lint
bonny-backendnpm run start
bonny-backendnpm run build
bonny-backendnpm run test
bonny-backendnpm run lint
bonny-function-parse-receipt/functionsnpm run start
bonny-function-parse-receipt/functionsnpm run build
bonny-function-parse-receipt/functionsnpm run test
bonny-function-parse-receipt/functionsnpm run lint
bonny-function-parse-receipt/functionsnpm run deploy
bonny-program-libraryanchor build
bonny-program-libraryanchor test

What you could build from it