A modern 2048 game built for Farcaster with blockchain integration, global leaderboard, and wallet authentication.
🌐 Deployed on Base Mainnet
- 🎯 Classic 2048 Gameplay - Smooth, responsive game mechanics
- 🟣 Purple Theme - Beautiful purple color scheme
- 🌐 Global Leaderboard - Compete with players worldwide
- 🔐 Wallet Authentication - Connect with MetaMask or Farcaster
- 📊 Usage Statistics - Track your gaming stats
- ⛓️ Blockchain Integration - Base Mainnet integration (real ETH required)
- 🎨 Farcaster Mini App - Native Farcaster experience
- Node.js 22.11.0+ (for Farcaster SDK)
- MongoDB Atlas Account (free)
- npm or yarn
# Clone repository
git clone https://github.com/YOUR_USERNAME/farcaster-2048.git
cd farcaster-2048
# Setup backend
cd backend
npm install
# Create .env file
cp .env.example .env
# Edit .env with your MongoDB connection string
# Start backend
npm start
# Start frontend (new terminal)
cd ..
python3 -m http.server 8000- Frontend: http://localhost:8000
- Backend API: http://localhost:3000/api/test
All documentation files are located in the docs/ folder:
- Setup Guide - Complete setup instructions
- Deployment Guide - Deploy to Vercel and Farcaster
- Database Setup - MongoDB Atlas setup
- Blockchain Integration - Base network integration
- View Data Guide - How to view wallet addresses and stats
- Git Workflow - Git workflow and commands
- Quick Deploy - Quick deployment guide
Frontend (Vercel)
↓
Backend API (Railway/Render)
↓
MongoDB Atlas (Database)
↓
Base Blockchain (Optional)
MONGODB_URI=mongodb+srv://...
PORT=3000
BLOCKCHAIN_ENABLED=false// Set API URL in index.html or config.js
window.API_URL = 'https://your-backend.railway.app';farcaster-2048/
├── backend/
│ ├── server.js # Express server
│ ├── db.js # MongoDB connection
│ ├── blockchain.js # Blockchain integration
│ └── .env # Environment variables
├── index.html # Main HTML file
├── game.js # Game logic
├── wallet.js # Wallet integration
├── style.css # Styles
├── manifest.json # Farcaster manifest
└── vercel.json # Vercel config
- Enter your name (or connect wallet)
- Use arrow keys to move tiles
- Combine same numbers to create larger ones
- Try to reach 2048!
- Your score is automatically saved to the global leaderboard
- MetaMask Integration - Connect with MetaMask
- Farcaster Auth - Native Farcaster authentication
- Message Signing - Identity verification (no gas fees)
- Statistics Tracking - Track your gaming stats
- Global leaderboard showing top players
- Player names (wallet addresses hidden)
- Real-time updates
- Persistent storage in MongoDB
- Base Mainnet integration (chainId: 8453)
- On-chain score storage (requires real ETH for gas)
- Hybrid approach (MongoDB + Blockchain)
- Smart contract deployed on Base Mainnet
⚠️ IMPORTANT: This is the mainnet version - real ETH is required for transactions
vercel --prod- Connect GitHub repository
- Set environment variables
- Deploy
- Enable Developer Mode
- Create manifest
- Publish app
See Deployment Guide for details.
# Backend
cd backend
npm start
# Frontend
python3 -m http.server 8000MIT
- Built for Farcaster
- Inspired by the classic 2048 game
- Powered by MongoDB Atlas and Base network