Sol.College

Structure lesson (licence does not allow quoting code)

dq

Original
val-samonte/dq
SuperStack fork
Blockchains/dq @ 3eb68ef
Stars
1
Last push (original)
2024-10-27
Languages
TypeScript, Rust, JavaScript, HTML, CSS
Detected stack
AnchorMetaplexweb3.js
Categories
Other
Licence
AGPL-3.0: code not quoted on Sol.College

Architecture

246 source files. By extension: .tsx ×104, .ts ×98, .rs ×35, .js ×9.

Top-level directorySource files
app201
programs30
programs-ecs5
tests5
scripts4
migrations1

On-chain programs: programs/dq, programs/itembox

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
executeComponentsprograms-ecs/systems/check_turn/src/lib.rs:12
initInitprograms/dq/src/lib.rs:14
create_characterCreateCharacterprograms/dq/src/lib.rs:18
init_handlerInitprograms/dq/src/instructions/init.rs:32
create_character_handlerCreateCharacterprograms/dq/src/instructions/create_character.rs:62
initInitprograms/itembox/src/lib.rs:18
create_recipeCreateRecipeprograms/itembox/src/lib.rs:36
craft_itemCraftItemprograms/itembox/src/lib.rs:40
mint_itemMintItemprograms/itembox/src/lib.rs:44
init_handlerInitprograms/itembox/src/instructions/init.rs:32
mint_item_handlerMintItemprograms/itembox/src/instructions/mint_item.rs:74
create_recipe_handlerCreateRecipeprograms/itembox/src/instructions/create_recipe.rs:41

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
app/isekai/src/sdk/itembox-sdk.tsPublicKey, getAssociatedTokenAddressSync, transfer, Keypair, Program, findProgramAddressSync
app/itembox/src/sdk/itembox-sdk.tsPublicKey, getAssociatedTokenAddressSync, transfer, Keypair, Program, findProgramAddressSync
tests/sdk.tsPublicKey, getAssociatedTokenAddressSync, transfer, Keypair, Program, findProgramAddressSync
tests/itembox.tsPublicKey, transfer, Program, Keypair, SystemProgram, AnchorProvider
programs/itembox/src/instructions/craft_item.rsPubkey, CpiContext, has_one, Program, AccountInfo, invoke
scripts/init-itembox.tsTransaction, PublicKey, VersionedTransaction, AnchorProvider, Program, Connection
tests/anchor.tsProgram, Keypair, PublicKey, AnchorProvider, SystemProgram, Transaction
app/isekai/src/atoms/anchorProviderAtom.tsTransaction, Keypair, VersionedTransaction, AnchorProvider, PublicKey, signTransaction
app/itembox/src/atoms/anchorProviderAtom.tsTransaction, Keypair, VersionedTransaction, AnchorProvider, PublicKey, signTransaction
programs/itembox/src/utils.rsAccountInfo, Pubkey, invoke, transfer
programs/itembox/src/instructions/create_fungible_blueprint.rsseeds, Pubkey, has_one, Program, transfer, invoke
programs/itembox/src/instructions/create_nonfungible_blueprint.rsPubkey, seeds, has_one, invoke, Program, transfer

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/dq/. 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
.npm run lint
app/frontendnpm run dev
app/frontendnpm run build
app/frontendnpm run lint
app/isekainpm run dev
app/isekainpm run build
app/isekainpm run lint
app/itemboxnpm run dev
app/itemboxnpm run build
app/itemboxnpm run lint
.anchor build
.anchor test
.anchor run create-collection
.anchor run init-itembox
.anchor run test
.cargo build

What you could build from it