Sol.College

Structure lesson (licence does not allow quoting code)

Q3T_Sol_Allen_Saji

This repository contains all my work done during Q3 Turbine Solana Builders Cohort.

Original
Allen-Saji/Q3T_Sol_Allen_Saji
SuperStack fork
Blockchains/Q3T_Sol_Allen_Saji @ 79fd474
Stars
1
Last push (original)
2024-10-24
Languages
TypeScript, Rust, JavaScript, CSS
Detected stack
AnchorMetaplexNext.jsSolana Actionsweb3.js
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

119 source files. By extension: .ts ×54, .rs ×45, .tsx ×20.

Top-level directorySource files
nf-tickets48
Week-1-NFT-Typescript20
NFT-staking14
anchor-marketplace11
Prerequisite-Task9
week2-escrow8
vote-program3
anchor_vault_q3_20243

On-chain programs: NFT-staking/programs/nft-staking, anchor-marketplace/programs/anchor-marketplace, anchor_vault_q3_2024/programs/anchor_vault_q3_2024, nf-tickets/programs/nf-tickets, vote-program/programs/vote-program, week2-escrow/programs/week2-escrow

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
initializeInitializenf-tickets/programs/nf-tickets/src/lib.rs:16
setup_managerSetupManagernf-tickets/programs/nf-tickets/src/lib.rs:20
create_eventCreateEventnf-tickets/programs/nf-tickets/src/lib.rs:24
create_ticketCreateTicketnf-tickets/programs/nf-tickets/src/lib.rs:28
scan_ticketScanTicketnf-tickets/programs/nf-tickets/src/lib.rs:32
withdraw_from_treasuryWithdrawFromTreasurynf-tickets/programs/nf-tickets/src/lib.rs:36
initializeInitializeanchor-marketplace/programs/anchor-marketplace/src/lib.rs:16
listListanchor-marketplace/programs/anchor-marketplace/src/lib.rs:20
delistDelistanchor-marketplace/programs/anchor-marketplace/src/lib.rs:25
purchasePurchaseanchor-marketplace/programs/anchor-marketplace/src/lib.rs:29
initializeInitializevote-program/programs/vote-program/src/lib.rs:9
upvoteVotevote-program/programs/vote-program/src/lib.rs:15
downvoteVotevote-program/programs/vote-program/src/lib.rs:21
initialize_configInitializeConfigNFT-staking/programs/nft-staking/src/lib.rs:15
initialize_userInitializeNFT-staking/programs/nft-staking/src/lib.rs:19
stakeStakeNFT-staking/programs/nft-staking/src/lib.rs:23
unstakeUnstakeNFT-staking/programs/nft-staking/src/lib.rs:27
claimClaimNFT-staking/programs/nft-staking/src/lib.rs:31
initializeInitializeanchor_vault_q3_2024/programs/anchor_vault_q3_2024/src/lib.rs:9
depositDepositanchor_vault_q3_2024/programs/anchor_vault_q3_2024/src/lib.rs:14
withdrawWithdrawanchor_vault_q3_2024/programs/anchor_vault_q3_2024/src/lib.rs:20
closeCloseanchor_vault_q3_2024/programs/anchor_vault_q3_2024/src/lib.rs:26
makeMakeweek2-escrow/programs/week2-escrow/src/lib.rs:15
refundRefundweek2-escrow/programs/week2-escrow/src/lib.rs:20
takeTakeweek2-escrow/programs/week2-escrow/src/lib.rs:24

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
nf-tickets/tests/nf-tickets.tsPublicKey, Keypair, SystemProgram, Transaction, transfer, findProgramAddressSync
NFT-staking/tests/nft-staking.tsPublicKey, getAssociatedTokenAddressSync, findProgramAddressSync, mplTokenMetadata, createUmi, Program
anchor_vault_q3_2024/programs/anchor_vault_q3_2024/src/lib.rsseeds, transfer, Program, CpiContext
Prerequisite-Task/empty-wallet.tstransfer, SystemProgram, Transaction, Connection, Keypair, sendAndConfirmTransaction
anchor-marketplace/programs/anchor-marketplace/src/contexts/purchase.rsseeds, CpiContext, transfer, Program, init_if_needed
week2-escrow/tests/week2-escrow.tsSystemProgram, getAssociatedTokenAddressSync, Program, Keypair, PublicKey, Transaction
Week-1-NFT-Typescript/cluster1/vault_deposit_nft.tsPublicKey, Connection, Keypair, Program, AnchorProvider, findProgramAddressSync
Week-1-NFT-Typescript/cluster1/vault_withdraw_nft.tsPublicKey, Connection, Keypair, Program, AnchorProvider, findProgramAddressSync
Week-1-NFT-Typescript/cluster1/vault_init.tsKeypair, PublicKey, Connection, SystemProgram, Program, AnchorProvider
Registration-Task/src/lib.rsPubkey, transfer, Transaction, Keypair
NFT-staking/programs/nft-staking/src/instructions/stake.rsseeds, Program, CpiContext, invoke_signed
Prerequisite-Task/enroll.tsPublicKey, Program, Connection, Keypair, AnchorProvider, seeds

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/q3t-sol-allen-saji/. 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
nf-ticketsnpm run lint
nf-tickets/appnpm run dev
nf-tickets/appnpm run start
nf-tickets/appnpm run build
nf-tickets/appnpm run lint
anchor-marketplacenpm run lint
vote-programnpm run lint
NFT-stakingnpm run lint
anchor_vault_q3_2024npm run lint
week2-escrownpm run lint
nf-ticketsanchor build
nf-ticketsanchor test
nf-ticketsanchor run test
anchor-marketplaceanchor build
anchor-marketplaceanchor test
anchor-marketplaceanchor run test

What you could build from it