Skip to content

adrian23b/tapchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 TapChain

Tap. Earn. Own. — Un juego gamificado donde tapeas para ganar NFTs en Base.

Construido para el Hackathon Synthesis 🏆


🎯 ¿Qué es TapChain?

TapChain es una PWA mobile-first donde los usuarios:

  1. Se registran con su email → se crea una wallet automáticamente (sin seed phrases)
  2. Tapean la pantalla → acumulan puntos registrados on-chain en Base
  3. Completan retos → 100, 500 y 1000 taps
  4. Mintean NFTs únicos → trofeos permanentes en Base Testnet
 Usuario → Email Login → Wallet Automática (Privy)
    ↓
 Tap Tap Tap → Puntos acumulados
    ↓
 Reto completado → Backend Node.js relayer
    ↓
 Mint NFT ERC-721 → Base Testnet
    ↓
 NFT en Galería + BaseScan

🏗️ Arquitectura

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   FRONTEND      │    │   BACKEND        │    │  SMART CONTRACT │
│   React + Vite  │───▶│  Node.js Express │───▶│  ERC-721 Solidity│
│   Privy Auth    │    │  ethers.js v6    │    │  Base Sepolia   │
│   Tailwind CSS  │    │  Relayer (gas)   │    │  TapChainNFT    │
└─────────────────┘    └──────────────────┘    └─────────────────┘

🚀 Setup

1. Smart Contract

cd contract
npm install
cp .env.example .env
# Agrega tu PRIVATE_KEY en .env
npx hardhat compile
npx hardhat run scripts/deploy.js --network base-sepolia
# Copia la dirección del contrato → CONTRACT_ADDRESS

Necesitas ETH en Base Sepolia: https://docs.base.org/docs/tools/network-faucets

2. Backend

cd backend
npm install
cp .env.example .env
# Configura: PRIVATE_KEY, CONTRACT_ADDRESS, RPC_URL
npm run dev
# Corre en http://localhost:3001

3. Frontend

cd frontend
npm install
cp .env.example .env
# Configura: VITE_PRIVY_APP_ID (consigue uno en https://privy.io)
# VITE_BACKEND_URL=http://localhost:3001
npm run dev
# Abre http://localhost:5173

🔑 Variables de Entorno

Backend (.env)

Variable Descripción
PRIVATE_KEY Clave privada del minter (backend wallet)
CONTRACT_ADDRESS Dirección del contrato desplegado
RPC_URL https://sepolia.base.org
FRONTEND_URL URL del frontend (para CORS)

Frontend (.env)

Variable Descripción
VITE_PRIVY_APP_ID App ID de Privy (https://privy.io)
VITE_BACKEND_URL URL del backend

🎨 NFTs

Reto Taps Requeridos Nombre Rareza
🥉 100 taps Tapper Novato Común
🥈 500 taps Tapper Pro Raro
🥇 1,000 taps Tap Legend Épico

🌐 Red


🛠️ Stack Técnico

  • Frontend: React 18 + Vite + Tailwind CSS
  • Auth/Wallets: Privy (email → embedded wallet)
  • Backend: Node.js + Express + ethers.js v6
  • Smart Contract: Solidity 0.8.20 + OpenZeppelin ERC-721
  • Blockchain: Base (Coinbase L2)
  • Deploy: Vercel (frontend) + Railway/Render (backend)

📝 Contract ABI (principales funciones)

function recordTaps(address player, uint256 taps) external
function mintNFT(address player, uint8 challengeLevel, string tokenURI) external returns (uint256)
function getChallengeStatus(address player) external view returns (bool, bool, bool)
function tapCount(address player) external view returns (uint256)

Construido con ❤️ para Synthesis Hackathon

About

A mobile game app to onboarding users about blockchain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors