Hybrid Web2/Web3 rewards platform for Guatemala businesses. Combines email-based onboarding with blockchain-powered rewards and experiential NFTs.
- Email-based Auth: No wallet needed - magic link authentication
- Gasless Transactions: Platform sponsors all blockchain interactions
- Experience NFTs: Upload photos, create memories, earn bonus points
- Multi-tier Rewards: Bronze/Silver/Gold loyalty levels
- Burnable Rewards: NFTs can be burned for redemptions
- Business Dashboard: Easy management for business owners
Frontend (React + Vite)
β
Backend (Node.js + Express)
β
Smart Contracts (Base L2)
- Node.js 18+
- MongoDB
- Base Sepolia ETH (for deployment)
# Root project
npm install
# Backend
cd backend && npm install
# Frontend
cd frontend && npm installCopy .env.example to .env and fill in:
# Blockchain
PRIVATE_KEY=your_private_key_here
SPONSOR_PRIVATE_KEY=sponsor_wallet_private_key
BASE_SEPOLIA_RPC=https://sepolia.base.org
# Backend
MONGODB_URI=mongodb://localhost:27017/guate-rewards
JWT_SECRET=your_jwt_secret
RESEND_API_KEY=your_resend_api_key
FROM_EMAIL=rewards@yourdomain.com
# Optional
IPFS_API_KEY=your_web3_storage_api_key# Compile contracts
npm run compile
# Deploy to Base Sepolia
npm run deploy:base-testnetCopy the factory address from deployment output to your .env:
FACTORY_ADDRESS=0x...
Terminal 1 (Backend):
cd backend
npm run devTerminal 2 (Frontend):
cd frontend
npm run devVisit http://localhost:3000 π
- Sign up with just email (magic link)
- Earn points with every purchase (1 point per Q1)
- Create experiences by uploading photos (earn 2x bonus points)
- Redeem rewards at participating businesses
- Create account with business name
- Deploy reward program (one-click Web3 setup)
- Register sales to award points to customers
- Track analytics through dashboard
Purchase β Email Link β Upload Photo β Mint Experience NFT β Earn Bonus Points
- Deploys individual business reward programs
- Handles sponsored transactions (gasless for users)
- Manages platform fees and revenue splits
- Token ID 0: Loyalty points (fungible)
- Token ID 1M+: Experience NFTs (non-fungible)
- Supports burning for redemptions
- Dynamic metadata based on IPFS/Arweave
POST /api/auth/register- Email signup/loginPOST /api/auth/verify- Magic link verificationGET /api/auth/profile- User profile
POST /api/sponsor/record-purchase- Award points for purchasePOST /api/sponsor/create-program- Deploy business programPOST /api/sponsor/redeem- Burn tokens for rewards
POST /api/experience/create- Upload photo & mint NFTGET /api/experience/my-experiences- User's experiences
Frontend:
- React 18 + Vite
- TailwindCSS
- React Query
- React Router
Backend:
- Node.js + Express
- MongoDB + Mongoose
- JWT Auth
- Resend (email)
- Multer (file upload)
Blockchain:
- Solidity 0.8.20
- Hardhat
- OpenZeppelin
- Ethers.js v6
- Base L2 (cheap gas)
Storage:
- IPFS for NFT metadata
- Local/MongoDB for user data
- Email service: $5-10
- Base L2 gas (sponsored): $10-20
- Backend hosting: $20
- Database: Free-$9
- Total: ~$40-60/month
- Mint reward: ~$0.005
- Mint experience NFT: ~$0.005
- Burn for redemption: ~$0.005
guate-rewards/
βββ contracts/ # Smart contracts
βββ backend/
β βββ models/ # MongoDB models
β βββ services/ # API routes
β βββ server.js
βββ frontend/src/
β βββ components/ # React components
β βββ contexts/ # Auth context
β βββ hooks/ # Custom hooks
βββ scripts/ # Deployment scripts
βββ deployments/ # Contract addresses
# Smart contract tests
npm test
# Backend tests
cd backend && npm test
# Frontend tests
cd frontend && npm test# Start local Hardhat node
npx hardhat node
# Deploy to local network
npm run deploy:local- Update environment variables
- Deploy contracts to Base mainnet
- Configure production database
- Set up proper email domain
- Enable IPFS pinning service
- Configure monitoring/analytics
Deploy to Base Sepolia for testing:
npm run deploy:base-testnet- Platform Fee: 2.5% of reward program transactions
- Setup Fee: Q300-600 per business onboarding
- Premium Features: Advanced analytics, custom branding
- Free: Manual entry, basic analytics
- Basic (Q100/month): Automated points, email notifications
- Premium (Q250/month): POS integration, advanced features
- Email authentication
- Basic rewards system
- Experience NFT creation
- Business dashboard
- Base testnet deployment
- WhatsApp notifications
- POS system integrations
- Mobile PWA
- Multi-language support
- Cross-business loyalty network
- DeFi integrations (staking, lending)
- Mobile app (React Native)
- Advanced analytics & ML
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Smart contracts use OpenZeppelin standards
- Private keys encrypted at rest
- Rate limiting on API endpoints
- Input validation and sanitization
- CORS and security headers configured
MIT License - see LICENSE file for details.
- π§ Email: hello@guaterewards.com
- π¬ Discord: Join community
- π Docs: docs.guaterewards.com
Made with β€οΈ for Guatemala π¬πΉ