Full lesson
first-solana-dapp
What it does
From the project README:
You can use any normal anchor commands. Either move to the `anchor` directory and run the `anchor` command or prefix the command with `pnpm`, eg: `pnpm anchor`.
- Original
- MikePawel/first-solana-dapp
- SuperStack fork
- Blockchains/first-solana-dapp @
742445f - Stars
- 0
- Last push (original)
- 2025-09-29
- Languages
- TypeScript, Rust, CSS, JavaScript
- Detected stack
- AnchorNext.jsweb3.js
- Categories
- Other
- Licence
- MIT
- Homepage
- https://first-solana-dapp.vercel.app
Architecture
27 source files. By extension: .tsx ×20, .ts ×6, .rs ×1.
| Top-level directory | Source files |
|---|---|
src | 21 |
anchor | 5 |
(root) | 1 |
On-chain programs: anchor/programs/firstdapp
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/first-solana-dapp/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
anchor/programs/firstdapp/src/lib.rs L37–60 @ 742445f · MIT · original #[account(mut)] pub payer: Signer<'info>, #[account( init, space = 8 + Firstdapp::INIT_SPACE, payer = payer )] pub firstdapp: Account<'info, Firstdapp>, pub system_program: Program<'info, System>,}#[derive(Accounts)]pub struct CloseFirstdapp<'info> { #[account(mut)] pub payer: Signer<'info>, #[account( mut, close = payer, // close account and return lamports to payer )] pub firstdapp: Account<'info, Firstdapp>,} #[derive(Accounts)]- Line 38
pub payer: Signer<'info>,: Requires this account to have signed the transaction. - Line 41
init,: Creates and pays for a new account. Space and payer must be specified. - Line 55
close = payer, // close account and return lamports to payer: Closes the account at the end of the instruction and refunds its lamports.
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.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | next dev |
. | npm run start | next start |
. | npm run build | next build |
. | npm run lint | next lint |
anchor | anchor build | compile programs and generate IDLs |
anchor | anchor test | local validator + test suite |
anchor | anchor run test | ../node_modules/.bin/jest --preset ts-jest |
What you could build from it
- Fork the SuperStack copy and extend it within the Other gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)