Live Demo: https://ilmquest-app.vercel.app
IlmQuest is a decentralized application (dApp) built for the MiniPay ecosystem that allows users in emerging markets to earn their first crypto asset (cUSD) by mastering financial concepts.
Unlike "Play-to-Earn" games that often rely on ponzi-nomics or gambling mechanics, IlmQuest utilizes the ancient Islamic Finance concept of Ju'alah (Reward for Service). Users perform a verified serviceโeducationโand receive a guaranteed payment in return.
Tagline: Don't Bet. Learn.
Welcome screen with wallet connection. Users can connect their MiniPay or MetaMask wallet to get started.
Available quests displayed with difficulty levels and rewards. Users can see their balance and select a quest to play.
Memory matching game interface. Users flip cards to match crypto concepts with their definitions.
Educational fact appears when a pair is matched. Users must acknowledge the fact to continue learning.
Quest completion screen showing stats (moves, time) and reward amount. Users can claim their cUSD reward here.
Transaction confirmation and success screen. Shows transaction hash and link to block explorer.
User statistics dashboard showing total earned, quests completed, streaks, achievements, and detailed stats.
Secret admin panel for managing quests. Admins can create, edit, delete, and toggle quest status.
Form for creating new quests. Admins can add quest details, reward amounts, difficulty, and card pairs.
- ๐ฎ Memory Match Game - Learn crypto concepts through gamified education
- ๐ฐ Fee Currency Abstraction - Pay gas fees in cUSD, no CELO required
- ๐ Trusted Oracle - Backend verifies game completion before reward
- ๐ธ On-Chain Rewards - Direct cUSD payments via smart contract
- ๐ฑ Mobile-First Design - Optimized for MiniPay users in emerging markets
- ๐ฏ Admin Dashboard - Dynamic quest management system
- ๐ User Statistics - Track progress, streaks, and achievements
- ๐ Replay System - Users can replay quests after 24 hours for revision
- Purpose: Welcome users and connect wallet
- Features:
- Clean, mobile-first design
- One-click wallet connection
- Educational value proposition
- Mobile wallet detection and instructions
- Purpose: Browse and select available quests
- Features:
- List of all active quests
- Difficulty indicators (Beginner/Intermediate/Advanced)
- Reward amounts displayed
- Quest completion status (checkmark if completed)
- Replay availability (24-hour cooldown)
- Balance display (cUSD token balance)
- Purpose: Play the memory matching game
- Features:
- 4x4 grid (8 cards, 4 pairs)
- Flip cards to reveal concepts/definitions
- Match pairs to learn facts
- Move counter and timer
- Knowledge modal on each match
- Victory screen on completion
- Purpose: Display results and claim reward
- Features:
- Game statistics (moves, time, pairs matched)
- Reward amount display
- Backend verification status
- Claim reward button
- Transaction hash and block explorer link
- Balance refresh after claim
- Purpose: View user statistics and achievements
- Features:
- Total earned (cUSD)
- Quests completed count
- Current streak and best streak
- Total moves across all quests
- Average completion time
- Achievement badges
- Real-time data from MongoDB
- Purpose: Manage quests dynamically (secret route)
- Features:
- Wallet signature authentication
- View all quests (including inactive)
- Create new quests
- Edit existing quests
- Delete/disable quests
- Toggle active/inactive status
- Toggle locked/unlocked status
- Quest validation and error handling
- Node.js 18+ and pnpm
- MongoDB Atlas account (or local MongoDB)
- MetaMask or MiniPay wallet
- Celo Sepolia testnet access
-
Clone the repository
git clone https://github.com/Intelligence247/IlmQuest.git cd IlmQuest -
Install dependencies
pnpm install
-
Set up environment variables
Backend (
apps/backend/.env):MONGODB_URI=your_mongodb_connection_string ADMIN_PRIVATE_KEY=0x... VAULT_ADDRESS=0x9857b9d8F49C035Df7e56397870A0a16d851e371 CHAIN_ID=42220 VAULT_ADDRESS=0xYourDeployedVaultAddress REWARD_TOKEN_ADDRESS=0x765DE816845861e75A25fCA122bb6898B8B1282a ADMIN_WALLETS=0xYourAdminWalletAddress PORT=4000
Frontend (
apps/frontend/.env.local):NEXT_PUBLIC_BACKEND_URL=http://localhost:4000
-
Run migration script (import existing quests)
cd apps/backend node scripts/migrateQuests.js -
Start development servers
# Terminal 1: Backend cd apps/backend pnpm dev # Terminal 2: Frontend cd apps/frontend pnpm dev
-
Open the app
- Frontend: http://localhost:3000
- Backend: http://localhost:4000
IlmQuest/
โโโ apps/
โ โโโ frontend/ # Next.js 14 frontend application
โ โ โโโ app/ # App Router pages
โ โ โโโ components/ # React components
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ lib/ # Utilities and config
โ โโโ backend/ # Node.js/Express backend API
โ โ โโโ src/
โ โ โ โโโ routes/ # API routes
โ โ โ โโโ middleware/# Auth middleware
โ โ โ โโโ services/ # Business logic
โ โ โ โโโ db/ # MongoDB connection
โ โ โโโ scripts/ # Migration scripts
โ โโโ contracts/ # Solidity smart contracts (Hardhat)
โ โโโ contracts/ # Solidity files
โ โโโ test/ # Contract tests
โ โโโ ignition/ # Deployment scripts
โโโ ArchectureAndUserFlow.md
โโโ DesignSystem.md
โโโ projectIdea.md
โโโ projectPRD.md
โโโ README.md
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Wallet: ethers.js (MiniPay/MetaMask)
- State Management: React Context API
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (Atlas)
- Signing: ethers.js (ECDSA signatures)
- Security: Helmet, CORS
- Language: Solidity
- Framework: Hardhat
- Network: Celo Mainnet
- Standards: ERC20, EIP-712
- Libraries: OpenZeppelin
pnpm dev # Start all development servers
pnpm build # Build all packages
pnpm lint # Lint all codecd apps/contracts
pnpm compile # Compile smart contracts
pnpm test # Run contract tests
pnpm deploy:mainnet # Deploy to Celo Mainnet
pnpm fund:vault:mainnet # Fund vault with cUSDcd apps/backend
pnpm dev # Start backend server
node scripts/migrateQuests.js # Import quests to databasecd apps/frontend
pnpm dev # Start Next.js dev server
pnpm build # Build for production- User visits app โ Landing page with wallet connection
- Connects wallet โ MiniPay or MetaMask (desktop/mobile)
- Selects quest โ Chooses from available quests (Celo Basics, Stablecoins 101, etc.)
- Plays game โ Memory matching: flips cards to match concepts with definitions
- Learns facts โ Knowledge modal appears on each successful match
- Completes quest โ All 4 pairs matched successfully
- Backend verifies โ Oracle checks game duration, moves, and rate limits
- Receives signature โ Backend cryptographically signs reward authorization
- Claims reward โ Smart contract validates signature and pays cUSD
- Pays gas in cUSD โ Fee Currency Abstraction - no CELO needed!
- Views profile โ Stats, achievements, and total earnings updated
User Action โ Frontend โ Backend API โ MongoDB โ Smart Contract โ Blockchain
- Frontend: Handles UI, wallet connection, game logic
- Backend: Verifies games, signs rewards, manages quests
- Smart Contract: Validates signatures, distributes rewards
- Blockchain: Records transactions, maintains state
-
JualahVault:
0x980DC8695F6D30A3b20770Ad42A5458784CBeA90- Handles reward distribution
- Verifies EIP-712 signatures
- Implements replay protection (nonce tracking)
- ERC20 token transfers
-
cUSD (Reward Token):
0x765DE816845861e75A25fCA122bb6898B8B1282a- Real cUSD token on Celo Mainnet
- Used for rewards and Fee Currency Abstraction
Block Explorer: https://celoscan.io
View Contracts:
Users pay gas fees in cUSD (the same token they earn), eliminating the need for CELO tokens. This removes a major onboarding barrier for new users in emerging markets.
Implementation: Smart contract calls include feeCurrency: REWARD_TOKEN_ADDRESS parameter.
Ethical reward system based on Islamic Finance principles. Users are paid for a service (learning), not gambling. This makes crypto accessible to users who avoid gambling-based platforms.
Backend verifies game completion off-chain (checking duration, moves, rate limits), then cryptographically signs reward authorizations. Smart contract validates signatures before payout, preventing bots and abuse.
Optimized for low-bandwidth connections and small screens, perfect for MiniPay users in emerging markets. Works seamlessly on Opera MiniPay and MetaMask Mobile.
Admin dashboard allows adding/editing quests without code changes. Quests stored in MongoDB, enabling rapid content updates.
- Architecture & User Flow - Technical architecture and data flow
- Design System - UI/UX guidelines and components
- Project Idea - Business logic and vision
- PRD - Product requirements document
- Adding New Quests - Guide for adding quests
- Admin Setup - Backend admin configuration
- Profile Data Explanation - Profile stats breakdown
cd apps/contracts
pnpm testTests cover:
- Valid reward claims
- Replay protection
- Invalid signatures
- Edge cases
cd apps/backend
node test-api.jsManual testing recommended:
- Connect wallet
- Play a quest
- Verify reward claim
- Check profile stats
- Test replay cooldown
cd apps/frontend
vercel deployLive URL: https://ilmquest-app.vercel.app
- Connect GitHub repository
- Set environment variables
- Deploy
Deployed to Celo Mainnet. See contract addresses above.
Deployment Instructions: See MAINNET_DEPLOYMENT_STEPS.md
- Wallet Signature Authentication - Admin routes require cryptographic signatures
- Rate Limiting - Prevents quest spam (24-hour cooldown)
- Replay Protection - Nonce tracking prevents double-claiming
- Input Validation - Server-side validation for all quest data
- CORS Protection - Configured for specific origins
- Helmet Security - Security headers enabled
This is a hackathon project. For questions or issues, please open a GitHub issue.
MIT License - see LICENSE file for details
- Celo Foundation for the amazing blockchain infrastructure
- MiniPay team for wallet integration
- OpenZeppelin for secure smart contract libraries
- Next.js and Vercel for the excellent framework
- GitHub: Intelligence247
- Email: uthmanabdullahi2020@gmail.com
- Twitter: @I_n_telligence
- Live Demo: https://ilmquest-app.vercel.app
Built with โค๏ธ for the Celo ecosystem