Skip to content

GuillermoSiaira/game-theory-app

Repository files navigation

🎮 Free Software Game Theory

An interactive application that simulates Hegelian dialectics between free and proprietary software using game theory and Ethereum smart contracts.

Game Screenshot

🌟 Features

  • 🎯 Game Theory Simulation - Prisoner's dilemma applied to software development
  • 🤖 Intelligent AI Agents - 5 different strategies (Tit-for-Tat, Always Cooperate, etc.)
  • ⛓️ Blockchain Integration - Smart contracts on Sepolia Testnet
  • 💰 Staking System - Bet real ETH on your decisions
  • 📊 Real-time Analytics - Payoff charts and statistics
  • 🌐 Multi-language - Spanish, English, and Latin
  • 🎨 Light/Dark Theme - Modern interface with Tailwind CSS
  • 📱 Responsive Design - Works on desktop and mobile

🛠️ Tech Stack

  • Frontend: Next.js 14, React 19, TypeScript
  • Styling: Tailwind CSS, shadcn/ui
  • Blockchain: Ethers.js, MetaMask
  • Charts: Recharts
  • Icons: Lucide React

🚀 Installation & Usage

Prerequisites

  • Node.js 18+
  • npm or yarn
  • MetaMask (optional, works in simulation mode)

Installation

# Clone the repository
git clone https://github.com/YOUR_USERNAME/game-theory-app.git
cd game-theory-app

# Install dependencies
npm install

# Run in development
npm run dev

Web3 Setup (Optional)

  1. Install MetaMask
  2. Connect to Sepolia Testnet
  3. Get test ETH: Sepolia Faucet
  4. Play with real test money!

🎮 How to Play

Simulation Mode

  1. Open the application
  2. Go to the "Game" tab
  3. Join the game with a stake
  4. Choose your strategy: Free Software (cooperate) or Proprietary Software (defect)
  5. Observe results and payoffs

Web3 Mode

  1. Connect your MetaMask wallet
  2. Make sure you're on Sepolia Testnet
  3. Join the game with real test ETH
  4. Your actions are recorded on blockchain
  5. Withdraw your earnings when finished

🧠 AI Strategies

Strategy Description Cooperation Rate
Tit-for-Tat Cooperates initially, then mimics opponent 70%
Always Cooperate Always chooses free software 100%
Always Defect Always chooses proprietary software 0%
Majority Rule Follows the majority strategy 50%
Random Randomly chooses between options 50%

📊 Payoff Matrix

Others: Free Others: Proprietary
You: Free 4 ETH (Mutual cooperation) 0 ETH (You're exploited)
You: Proprietary 5 ETH (You exploit others) 1 ETH (Mutual defection)

🏗️ Project Architecture

game-theory-app/
├── app/                    # Next.js App Router
│   ├── layout.tsx         # Main layout
│   ├── page.tsx           # Main page
│   └── globals.css        # Global styles
├── components/            # React components
│   ├── ui/               # shadcn/ui components
│   ├── game-dashboard.tsx # Game dashboard
│   ├── payoff-chart.tsx  # Payoff charts
│   └── ai-agents.tsx     # AI agents management
├── hooks/                # Custom hooks
│   ├── use-web3-game-state.ts # Web3 game state
│   ├── use-theme.ts      # Light/dark theme
│   └── use-language.ts   # Multi-language
├── lib/                  # Utilities
│   └── contract.ts       # Smart contract interaction
└── types/                # TypeScript definitions
    └── game.ts           # Game types

🔗 Smart Contract

  • Network: Sepolia Testnet
  • Address: 0x6F6f3C1d3c2A57bDD65403d4935e7A58b52C5035
  • Explorer: View on Etherscan

🤝 Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 Roadmap

  • Integration with more networks (Polygon, Arbitrum)
  • Tournaments and rankings
  • NFTs for winning strategies
  • DAO integration for governance
  • Real-time multiplayer mode

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Inspired by Richard Stallman's philosophy on free software
  • Game theory applied by John Nash
  • Hegelian dialectics in technology
  • Ethereum developer community

📞 Contact


Give it a star if you liked the project!

🎯 Live Demo

🔗 Try it live here! (Replace with your actual deployment URL)

📸 Screenshots

Game Interface

Game Interface

AI Agents

AI Agents

Analytics Dashboard

Analytics


About

Interactive game-theory dapp (Free vs Proprietary) — Next.js + Solidity (Sepolia) — simulation + analytics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published