Learn Bitcoin. Build on Stacks. Anchored to Truth.
Stacks Quest is an interactive learning experience that combines a modern web UI with Web3 primitives. The repository is structured as a small monorepo:
frontend/: Next.js (App Router) web applicationsmartcontract/: Clarity smart contracts for progress tracking + achievement NFTs
If you want a screen-by-screen walkthrough of the UI and product concepts, see SCREENS.md.
- Project Goals
- What’s in this Repo
- Tech Stack
- Quick Start (Frontend)
- Environment Variables
- Available Scripts
- App Routes / Pages
- Smart Contracts (Clarity)
- Chainhooks Integration
- Repository Documentation
- Troubleshooting
- Contributing
- License
Stacks Quest aims to:
- Teach core Bitcoin and Stacks concepts through a progression-based “quest” UX.
- Make learning feel like a game (chambers, inscriptions, trials, achievements).
- Provide a foundation for on-chain progress tracking and achievement rewards via Clarity contracts.
.
├── frontend/ # Next.js app (UI + wallet integrations)
├── smartcontract/ # Clarity contracts (progress + NFTs)
└── SCREENS.md # Product/UI documentation
- The frontend is what you run locally during development.
- The smart contracts are included as source files and can be deployed using Clarinet (see below).
- Framework: Next.js
16.0.10(App Router) - UI: React
19.2.1 - Language: TypeScript
- Styling: Tailwind CSS (
^4) - Server state:
@tanstack/react-query - EVM wallet + chains:
wagmi+viem- Default configured chains:
mainnet,sepolia(seefrontend/wagmi.config.ts)
- Default configured chains:
- Wallet UI / modal: Reown AppKit (
@reown/appkit) - Stacks auth/wallet (experimental/legacy paths):
@stacks/connect - Stacks Chainhooks:
@hirosystems/chainhooks-client
- Language: Clarity
- Contracts:
stacks-quest-progress.clarstacks-quest-nft.clar
- Node.js
18+recommended - One package manager:
npm(recommended here becausefrontend/package-lock.jsonis present)- or
pnpm(apnpm-lock.yamlalso exists)
Important: pick one and stick to it to avoid lockfile drift.
Run these commands from the frontend/ directory:
npm installnpm run devThen open:
http://localhost:3000
The repo includes a frontend/.env in your workspace, but it is gitignored, so it won’t be readable from GitHub and shouldn’t be committed. For GitHub-friendly onboarding, configure your local env like this:
- Create
frontend/.env.local - Add the variables you need
- Restart the dev server
Used by frontend/lib/chainhooks.ts and the /chainhooks page.
NEXT_PUBLIC_CHAINHOOKS_BASE_URL- Optional. Defaults to Hiro testnet base URL.
NEXT_PUBLIC_CHAINHOOKS_API_KEY- Optional, but required to list chainhooks.
Example:
NEXT_PUBLIC_CHAINHOOKS_BASE_URL=https://your-chainhooks-host
NEXT_PUBLIC_CHAINHOOKS_API_KEY=your_api_key_hereSecurity note: any NEXT_PUBLIC_* variable is exposed to the browser. Do not store secrets that must remain private.
All scripts live in frontend/package.json:
npm run dev- Start Next.js dev server.
npm run build- Production build.
npm run start- Start production server (after build).
npm run lint- Run ESLint.
This project uses the Next.js App Router (frontend/app/). Key routes include:
/- Landing page (“Stacks Quest”) with a connect button and entry to the learning roadmap.
/roadmap- “Path of Knowledge” progression screen. Unlocks content sequentially.
/lesson?topic=<id>- Lesson content for a topic.
/quest?topic=<id>- Interactive “Chamber of Inscriptions” word-hunt style quest.
/dashboard- User dashboard (currently uses mock data).
/leaderboard- Leaderboard screen (currently uses mock data).
/marketplace- Marketplace screen (currently uses mock data).
/profile- Profile editor/view. Redirects to
/if not authenticated.
- Profile editor/view. Redirects to
/chainhooks- Chainhooks integration example screen.
Notes:
- Some user state is persisted locally (for example, quest completion and roadmap progression are stored in
localStorage). - Profile data is stored via a React context provider (
frontend/contexts/ProfileContext.tsx).
The smartcontract/ folder contains the Clarity contracts that are intended to power on-chain:
- Learning progress tracking
- Quiz attempts / score validation
- Achievement NFT minting
See the detailed contract documentation here:
smartcontract/README.md
smartcontract/stacks-quest-progress.clar- Progress tracking, completion, unlocking logic.
smartcontract/stacks-quest-nft.clar- NFT minting for achievements.
This repository stores the .clar sources but does not include a full Clarinet project scaffold at the repo root.
To deploy/test locally with Clarinet:
- Install Clarinet:
https://docs.hiro.so/smart-contracts/clarinet - Create a Clarinet project:
clarinet new stacks-quest-contracts- Copy the contract files from
smartcontract/into the new project’scontracts/folder. - Update the Clarinet configuration to include the contracts.
- Run tests / deploy:
clarinet test
clarinet deployments apply -p testnetIf you want this repo itself to be a Clarinet project, add the Clarinet scaffold files (Clarinet.toml, settings/, etc.) and wire these contracts into it.
The frontend includes a minimal Chainhooks client wrapper:
frontend/lib/chainhooks.ts
And a UI example page:
- Route:
/chainhooks - Component:
frontend/components/ChainhooksExample.tsx
If you see errors there, it’s usually because NEXT_PUBLIC_CHAINHOOKS_API_KEY is missing.
SCREENS.md- Comprehensive product + screen documentation (architecture, flows, and UI breakdown).
frontend/README.md- Frontend-specific docs.
smartcontract/README.md- Contract-specific docs.
- Ensure Tailwind is installed and the dev server is restarted.
- Verify
frontend/app/globals.cssis present.
- Confirm
NEXT_PUBLIC_CHAINHOOKS_BASE_URL(optional) andNEXT_PUBLIC_CHAINHOOKS_API_KEY(usually required). - Restart
npm run devafter changing env vars.
- Choose one package manager and delete the other lockfile(s) only if you intentionally standardize (do this in a dedicated PR).
- In the meantime, for this repo:
- Use
npm install+package-lock.json.
- Use
There is currently no root CONTRIBUTING.md in this repository.
Recommended contribution workflow:
- Create a feature branch
- Keep PRs focused (UI changes separate from contract changes)
- Prefer adding screenshots for UI changes
- Avoid committing
.env*files or API keys
If you want, I can add a CONTRIBUTING.md and a PR template later.
A root LICENSE file is not currently present in this repository.
Some subdirectories mention MIT in their README, but GitHub considers the repository’s license authoritative when a top-level LICENSE exists.
Recommended next step:
- Add a root
LICENSEfile (MIT or whichever license you intend)
- Next.js
- Stacks + Clarity
- Hiro tooling (Chainhooks)
- wagmi/viem
- Reown AppKit