create-solana-dapp
Scaffold a full-stack Solana dApp with an on-chain program and Next.js client using the create-solana-dapp generator.
Search across all documentation pages
Scaffold a full-stack Solana dApp with an on-chain program and Next.js client using the create-solana-dapp generator.
Quick-reference recipe card - copy-paste ready.
pnpm create solana-dapp@latest
cd my-dapp
pnpm install
anchor build
pnpm devWhen to reach for this:
pnpm create solana-dapp@latest my-marketplace \
--template anchor-nextjs \
--wallet adapter
cd my-marketplace
pnpm install
# Align toolchain with guide pins
avm use 0.32.1
anchor build
anchor test
# Start local validator + app (template scripts vary)
pnpm devWhat this demonstrates:
programs/ and app/ folders.anchor build.solana-test-validator, deploy, and dev server startup.| Path | Contents |
|---|---|
programs/<name>/ | Anchor program source |
app/ or src/ | Next.js frontend |
Anchor.toml | Program IDs and cluster URLs |
tests/ | Integration tests |
# Re-run codegen after IDL changes (template-dependent)
anchor build
pnpm run codegen 2>/dev/null || trueAnchor.toml, anchor-lang, and run avm use 0.32.1.Anchor.toml provider cluster.| Alternative | Use When | Don't Use When |
|---|---|---|
anchor init only | Program-first, client later | Need immediate UI |
mucho CLI | Foundation opinionated templates | Custom Next.js architecture |
| Manual monorepo | Full control of stack choices | Fast MVP deadline |
create-solana-dapp minimal flags | Slimmer output | Learning full-stack wiring |
Check generated package.json and bump to 7.0.0 to match this guide's pinned stack.
Templates often document pnpm first; npm/yarn usually work with equivalent install commands.
Anchor.toml and declare_id! in programs/<name>/src/lib.rs - update after anchor keys sync.
anchor deploy against configured cluster after funding deployer keypair.
Yes - keep programs/ and tests; replace frontend with any kit-based client.
Most templates include Anchor integration tests - extend with LiteSVM for unit speed.
Select template variants at create time or add dependencies post-generation.
Community-maintained scaffold widely used in Solana ecosystem tutorials - verify template repo for updates.
Edit Anchor.toml provider URL and frontend env NEXT_PUBLIC_RPC_URL.
Depends on template flag - commonly @solana/wallet-adapter-react or kit-native wallets.
Stack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.
Reviewed by Chris St. John·Last updated Jul 19, 2026