-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Adrijan-Petek edited this page Dec 30, 2025
·
1 revision
Before you begin, ensure you have the following:
- Node.js: Version 18.0 or higher
- MetaMask: Latest version installed
- Base Sepolia ETH: Testnet tokens for gameplay
- VS Code: For development
- Git: Version control
- Yarn/NPM: Package management
git clone https://github.com/Adrijan-Petek/joybit.git
cd joybitnpm installCreate a .env.local file in the root directory:
# Network Configuration
NEXT_PUBLIC_CHAIN_ID=84532
NEXT_PUBLIC_BASE_TESTNET_RPC_URL=https://sepolia.base.org
# WalletConnect
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id
# Admin Configuration
NEXT_PUBLIC_ADMIN_WALLET_ADDRESS=0xYourAdminAddress
# Database (Turso)
TURSO_DATABASE_URL=your_database_url
TURSO_AUTH_TOKEN=your_auth_token
# Security Configuration
SECURITY_MAX_REQUESTS_PER_MINUTE=60
SECURITY_MAX_REQUESTS_PER_HOUR=1000
SECURITY_BLOCK_DURATION_MINUTES=15
SECURITY_SQL_INJECTION_DETECTION=true
SECURITY_XSS_DETECTION=true
SECURITY_INPUT_VALIDATION=true
# Contract Addresses (after deployment)
NEXT_PUBLIC_JOYBIT_TOKEN_ADDRESS=0x...
NEXT_PUBLIC_JOYBIT_GAME_ADDRESS=0x...
NEXT_PUBLIC_CARD_GAME_ADDRESS=0x...
NEXT_PUBLIC_DAILY_CLAIM_ADDRESS=0x...
NEXT_PUBLIC_TREASURY_ADDRESS=0x...Visit the Base Sepolia Faucet to get free test ETH.
npm run devVisit http://localhost:3000 to start playing!
- Click "Connect Wallet" in the top right
- Select MetaMask (or your preferred Web3 wallet)
- Approve the connection request
- Switch to Base Sepolia testnet if prompted
- Match-3: Strategic tile-matching with progressive difficulty
- Card Game: Luck-based strategy with blockchain randomness
- Daily Claim: Build streaks for maximum rewards
- Select a game from the main menu
- Pay the entry fee (test ETH)
- Follow on-screen instructions
- Claim your JOYB token rewards!
Joybit includes enterprise-grade security:
- Real-time Threat Detection: Monitors for SQL injection, XSS, and suspicious patterns
- Rate Limiting: Prevents abuse with configurable request limits
- IP Blocking: Automatic blocking of malicious actors
- Audit Logging: Comprehensive security event tracking
For administrative access:
- Use the admin wallet address specified in
.env.local - Navigate to
/adminroute - Access security dashboard, theme management, and analytics
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
# Testing
npm run test # Run all tests
npm run test:watch # Run tests in watch mode
# Contracts
npm run compile # Compile Solidity contracts
npm run deploy:test # Deploy to testnet
npm run deploy:main # Deploy to mainnet
# Database
npm run db:setup # Initialize database tables
npm run db:migrate # Run database migrations
# Security
npm run security:check # Run security audit
npm run security:logs # View security logsjoybit/
โโโ app/ # Next.js app directory
โ โโโ admin/ # Admin dashboard
โ โโโ api/ # API routes
โ โโโ card-game/ # Card game page
โ โโโ daily-claim/ # Daily claim page
โ โโโ game/ # Match-3 game page
โ โโโ leaderboard/ # Leaderboard page
โโโ components/ # React components
โโโ contracts/ # Solidity contracts
โโโ lib/ # Utility libraries
โโโ proxy.ts # Security proxy (Next.js 16)
โโโ public/ # Static assets
โโโ wiki/ # Documentation
Wallet Connection Issues:
- Ensure MetaMask is unlocked
- Check if you're on Base Sepolia network
- Verify RPC URL in wallet settings
Transaction Failures:
- Check ETH balance
- Verify contract addresses
- Ensure gas limit is sufficient
Build Errors:
- Clear node_modules:
rm -rf node_modules && npm install - Check Node.js version:
node --version - Verify environment variables
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ง Contact: adrijan@joybit.game
- Explore Games
- Security Features
- API Documentation
- Deployment Guide /home/mobb/Downloads/Joybit/wiki/Getting-Started.md