How guboc11/blockhero works
Project type and purpose
• This is a decentralized application (dApp) built on the Internet Computer (IC).
• It comprises a Rust‐based canister backend (BlockHero_backend) and a React‐based frontend (BlockHero_frontend), all managed under DFINITY’s dfx toolchain.
• The user interface communicates with on‐chain Canisters (WASM modules) via the IC HTTP API and Candid interfaces.
File structure
• Top‐level:
• dfx.json – defines canisters and network settings.
• Cargo.toml, Cargo.lock – orchestrate Rust project dependencies.
• package.json, package-lock.json – root Node scripts (often proxying calls to dfx).
• src/BlockHero_backend
• Rust code (lib.rs, types.rs) and its Cargo.toml – your on‐chain business logic.
• BlockHero_backend.did – the autogenerated Candid interface.
• src/BlockHero_frontend
• A Vite‐powered React application (main.jsx, App.jsx, etc.) – your dApp’s UI.
• api.js – where createActor constructs canister actors using Candid.
• Tailwind and SCSS configs – styling and build pipelines.
• Frontend/frontend
• A second React app (Create React App) – likely an earlier or alternate UI template.
• Config files (tsconfig.json, tailwind.config.js, vite.config.js) – build and transpilation rules.
README for additional insights
• dfx commands to start a local replica, deploy canisters, generate Candid interfaces, and run the frontend dev server.
• Advice on environment variables to switch networks (local vs ic).
Elements
• Clear labels for:
• Developer Workstation (tools)
• Local Replica (dfx)
• Canister Backend (Rust/WASM + Candid)
• Asset Canister (static files)
• Frontend App (React)
• Browser / End User
• Internet Computer (prod)
• dfx deploy → canister uploads
• Browser → asset canister (UI fetch)
• UI → backend canister (API calls)
• Backend canister ↔ state storage on IC
• Tools & Dev (grey/infrastructure)
• Frontend components (green)
• Backend canisters (blue)