How dappuniversity/fun-pump works
Main Components
a. Frontend (Next.js App)
• Located under app/: React/Next.js pages (layout.js, page.js) and components (Header.js, List.js, Token.js, Trade.js).
• Static/config assets: globals.css, config.json, images.json, public/.
• ABI artifacts under app/abis/ (Factory.json).
b. Smart Contracts
• Solidity sources in contracts/
• Compiled ABIs used by frontend.
c. Blockchain Node & Deployment
• Hardhat local node (npx hardhat node).
• Deployment scripts via Hardhat-Ignition in ignition/modules/Factory.js.
d. Tests
• Test suite under test/ (Factory.js) using Hardhat & Ethers.js.
e. Tooling & Config
• Hardhat config: hardhat.config.js
• Next.js config: next.config.mjs, jsconfig.json
• package.json / package-lock.json
Relationships & Data Flow
• User → Browser → Next.js UI (React components)
• UI uses Ethers.js to load Factory.json ABI and connect to a JSON-RPC endpoint.
• JSON-RPC endpoint is the Hardhat node (local blockchain emulator).
• Hardhat node processes transactions, invokes the Factory.sol contract on the EVM.
• Deployment script (Ignition) runs on the dev machine, calls Hardhat network to deploy Factory.sol, writes the deployed address into app/abis/Factory.json or config.json.
• Tests also connect via Ethers.js to Hardhat node, exercise Factory.sol.
Architectural Patterns & Key Technologies
• Pattern: Single-Page Application (Next.js) + Backendless blockchain layer
• Components: Presentation (React), Data Access (Ethers.js & ABIs), Smart Contract Business Logic (Solidity)
• Deployment: Infrastructure-as-Code via Hardhat-Ignition
• Testing: Automated unit/integration tests under Hardhat framework
• Config & Assets: Centralized under app/config.json, images.json, public/
Essential Elements
• Clear, concise labels (e.g., “Next.js UI”, “Hardhat JSON-RPC”).
• Blue = Client/UI layer
• Green = Blockchain/EVM layer
• Orange = Tooling (deployment & testing)