Skip to content

BBubbyy/Farcaster2048-testnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

88 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Farcaster 2048 - Mainnet Version

A modern 2048 game built for Farcaster with blockchain integration, global leaderboard, and wallet authentication.

๐ŸŒ Deployed on Base Mainnet

Farcaster 2048 License

โœจ Features

  • ๐ŸŽฏ 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

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 22.11.0+ (for Farcaster SDK)
  • MongoDB Atlas Account (free)
  • npm or yarn

Installation

# 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

Access

๐Ÿ“š Documentation

All documentation files are located in the docs/ folder:

๐Ÿ—๏ธ Architecture

Frontend (Vercel)
    โ†“
Backend API (Railway/Render)
    โ†“
MongoDB Atlas (Database)
    โ†“
Base Blockchain (Optional)

๐Ÿ”ง Configuration

Backend Environment Variables

MONGODB_URI=mongodb+srv://...
PORT=3000
BLOCKCHAIN_ENABLED=false

Frontend Configuration

// Set API URL in index.html or config.js
window.API_URL = 'https://your-backend.railway.app';

๐Ÿ“ฆ Project Structure

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

๐ŸŽฎ How to Play

  1. Enter your name (or connect wallet)
  2. Use arrow keys to move tiles
  3. Combine same numbers to create larger ones
  4. Try to reach 2048!
  5. Your score is automatically saved to the global leaderboard

๐Ÿ” Wallet Features

  • MetaMask Integration - Connect with MetaMask
  • Farcaster Auth - Native Farcaster authentication
  • Message Signing - Identity verification (no gas fees)
  • Statistics Tracking - Track your gaming stats

๐Ÿ“Š Leaderboard

  • Global leaderboard showing top players
  • Player names (wallet addresses hidden)
  • Real-time updates
  • Persistent storage in MongoDB

โ›“๏ธ Blockchain (Base Mainnet)

  • 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

๐Ÿš€ Deployment

Vercel (Frontend)

vercel --prod

Railway/Render (Backend)

  1. Connect GitHub repository
  2. Set environment variables
  3. Deploy

Farcaster

  1. Enable Developer Mode
  2. Create manifest
  3. Publish app

See Deployment Guide for details.

๐Ÿ› ๏ธ Development

# Backend
cd backend
npm start

# Frontend
python3 -m http.server 8000

๐Ÿ“ License

MIT

๐Ÿ™ Acknowledgments

  • Built for Farcaster
  • Inspired by the classic 2048 game
  • Powered by MongoDB Atlas and Base network

๐Ÿ”— Links

About

Farcaster2048 testnet deploy on base

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors