How mrakhilmalvi/chainwallet-web works
Project Type and Purpose
• This is a full-stack decentralized application (DApp) built with Next.js (React) for the frontend, WAGMI/Ethers for blockchain connectivity, and Solidity contracts under the contracts folder. Its purpose is to let users stake ERC-20 tokens, participate in an ICO, and earn rewards on any blockchain network (configured via RPC URLs).
File-Structure Highlights
• “pages/”: Next.js routing – pages/_app.js (app shell), pages/index.js (home), pages/admin.js (admin dashboard), pages/activities.js (user activity logs).
• “Components/”: UI atoms, molecules and templates – global Header/Footer/HeroSection/Loader, feature folders for Admin & Investor functionality, and shared components (Buttons, Inputs, Modals).
• “Context/”: JSON ABIs and constants + React Context provider wiring up WAGMI hooks, reading NEXT_PUBLIC_* env variables for chain IDs, contract addresses, currency, explorer URLs.
• “contracts/”: Solidity source files defining the staking and ICO contracts.
• “public/”: Static assets (CSS, images, vanilla JS).
• Configuration files: next.config.js, .env.local (runtime env), package.json (scripts & deps).
Key README Insights
• Technical stack: Next.js, React 18, WAGMI for wallet/connect, Ethers for contract calls, HeadlessUI + Heroicons + NextUI for styling, React-Hot-Toast for notifications, Formspree for contact form.
• Environment variables drive smart-contract addresses, network config (Holesky testnet).
• Deployment: Remix for contract compilation/deployment, any EVM RPC provider (e.g., Ankr).