Candy Chain is a complete, production-ready Web3 Match-3 puzzle game. Players clear dynamic candy grids via a highly-optimized Phaser 3 engine to earn off-chain arcade points, which seamlessly convert to on-chain $CRUSH token rewards through automated Serverless API integrations.
- Gasless Frontend: Users play pure Web2 Match-3 games without constantly signing transactions. Scores are pushed into a Postgres Database silently.
- Native Web3 Injections: Bypass heavy external library downloads using an ultra-fast bespoke Wagmi native dropdown modal.
- Auto-Calculated Rewards: Backend services automatically allocate
$CRUSHtoken smart-contract claims based on the Supabase daily Hall of Fame. - 60fps Neon Arcade Graphics: Highly optimized gradient mapping and Phaser canvas scaling simulating a neon arcade cabinet natively in the DOM.
- Framework: Next.js 15 (App Router)
- Game Engine: Phaser 3 (SSR disabled for native rendering)
- Styling: Tailwind CSS V4
- Blockchain Hooks: Wagmi v2 + Viem
- Database / Auth: Supabase PostgreSQL
- Blockchain Network: Base Sepolia L2
- Smart Contracts: Hardhat, Solidity, OpenZeppelin (
CRUSHToken,PrizeVault) - API: Next.js Serverless Routes for reward delegation
Ensure you define the following Environment Variables in .env.local to connect to your Supabase and Base Sepolia environments:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYADMIN_PRIVATE_KEY(Backend admin token minting)NEXT_PUBLIC_PRIZE_VAULT_ADDRESS(Deployed Proxy Address)
npm install
npm run devNavigate to the contracts directory, create a .env file, and fund your deployer address on Base Sepolia.
cd contracts
npm install
npx hardhat compile
npx hardhat ignition deploy ./ignition/modules/Deploy.ts --network base-sepoliaCandy Chain is fully optimized for Vercel.
Simply push to GitHub, import the repository into Vercel, inject the environment variables, and click Deploy. Ensure ADMIN_PRIVATE_KEY is securely stored.
Mobile Build: Wrap the Next.js app with Capacitor (npx cap init) to natively deploy the GameCanvas automatically to iOS/Android app stores while retaining the Web3 wallet injection flows.