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