Scissors • Crash • Mines • Turtle • Plinko • Dice • Slot Game
A modern crypto-powered gaming platform supporting multi-chain tokens and exciting on-chain games. This platform provides a comprehensive gaming experience with real-time multiplayer gameplay, secure wallet integration, and instant cryptocurrency payouts.
The platform supports multiple cryptocurrencies across various blockchain networks:
- Bitcoin (BTC) - Native Bitcoin network
- Ethereum (ETH) - Ethereum mainnet and testnets
- Binance Smart Chain (BSC) - BNB and BEP-20 tokens
- Tron (TRX) - Tron network and TRC-20 tokens
- USDT - Tether on all major chains (ERC-20, TRC-20, BEP-20)
- Additional ERC-20, BEP-20, and TRC-20 tokens
The frontend is a React-based single-page application that provides:
- Interactive game UI with real-time updates
- Web3 wallet integration (MetaMask, WalletConnect, Coinbase Wallet)
- User authentication (Email, Google OAuth, Web3 wallet)
- Real-time Socket.IO connections for live game updates
- User account dashboard with balance, history, and settings
- Responsive design for desktop and mobile devices
- Multi-language support (if configured)
Key Technologies:
- React 18.2.0
- Redux for state management
- Material-UI for components
- Web3.js and Ethers.js for blockchain interactions
- Socket.IO client for real-time communication
- Axios for API requests
Comprehensive admin dashboard for platform management:
- User management and moderation
- Game configuration and settings
- Live transaction monitoring
- Platform analytics and statistics
- Revenue tracking and reporting
- Campaign and promotion management
- System health monitoring
The backend is built using a microservices architecture with separate services for each game and functionality:
| Service | Port | Description |
|---|---|---|
| Main Server | 5000 | Core API server handling authentication, payments, and user management |
| Admin Service | 6100 | Admin panel backend service |
| Management Service | 4000 | Platform management and analytics service |
| Chatroom Service | 4900 | Real-time chat system for user communication |
| Scissors Game | 5200 | Scissors game service with Socket.IO |
| Mines Game | 5300 | Mines game service with Socket.IO |
| Dice Game | 5400 | Dice game service with Socket.IO |
| Slot Game | 5500 | Slot game service with Socket.IO |
| Plinko Game | 5600 | Plinko game service with Socket.IO |
| Crash Game | 5700 | Crash game service with Socket.IO |
| Turtle Race | 5100 | Turtle race game service with Socket.IO |
Each game service operates independently with its own Socket.IO server for real-time gameplay, ensuring scalability and fault tolerance.
Before you begin, ensure you have the following installed:
- Node.js v16 or higher (for Backend services)
- Node.js v14 or higher (for Frontend and Admin panel)
- MongoDB instance (local or cloud-based like MongoDB Atlas)
- npm or yarn package manager
- Git for version control
- Web crypto wallet extension (MetaMask, TrustWallet, etc.) for testing
- Clone the repository:
git clone <repository-url>
cd Web3-Casino-Crash-Game-Gamefi- Install dependencies for each component:
# Backend
cd backend
npm install --legacy-peer-deps
# Frontend
cd ../frontend
npm install --legacy-peer-deps
# Admin Panel
cd ../admin
npm install- Navigate to the backend directory:
cd backend- Install dependencies:
npm install --legacy-peer-deps-
Create a
.envfile in the backend directory (see Configuration section) -
Start the main server:
npm run dev- Start additional game services (in separate terminals or as background processes):
npm run admin # Admin service (port 6100)
npm run manage # Management service (port 4000)
npm run chatroom # Chat service (port 4900)
npm run crash # Crash game (port 5700)
npm run dice # Dice game (port 5400)
npm run mines # Mines game (port 5300)
npm run scissors # Scissors game (port 5200)
npm run slot # Slot game (port 5500)
npm run plinko # Plinko game (port 5600)
npm run turtle # Turtle race (port 5100)Note: All services use npx nodemon for automatic restart on code changes during development.
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install --legacy-peer-deps- Create a
.envfile (optional, for Google OAuth):
REACT_APP_GOOGLE_CLIENT_ID=your_google_client_id_here- Start the development server:
npm startThe frontend will be available at http://localhost:8800
- Navigate to the admin directory:
cd admin- Install dependencies:
npm install- Start the admin panel:
npm startThe admin panel will be available at http://localhost:9000 (or the configured port)
Create a .env file in the backend directory with the following variables:
# Server Configuration
SERVER_PORT=5000
NODE_ENV=development
# Database
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/PlayZelo?retryWrites=true&w=majority
# JWT Authentication
JWT_SECRET=your_strong_random_secret_here
JWT_EXPIRE=1h
# Tatum API (for crypto payments)
TATUM_API_KEY_TESTNET=your_testnet_api_key
TATUM_API_KEY_MAINNET=your_mainnet_api_key
# Infura (Ethereum provider)
INFURA_URL_TESTNET=https://sepolia.infura.io/v3/your_infura_key
INFURA_URL_MAINNET=https://mainnet.infura.io/v3/your_infura_key
# Network Configuration
NETWORK=mainnet
DEV_MODE=false
# Email Service (SendGrid)
SENDGRID_API_KEY=your_sendgrid_api_keyThe frontend configuration is located in frontend/src/config/baseConfig.js.
To switch between local and production environments, modify the isLocal variable:
const isLocal = true; // Set to false for productionFor local development, the frontend will connect to:
- API:
http://localhost:5000/api - Socket Server:
http://localhost:4000 - Chat Socket:
http://localhost:4900
Create a .env file in the admin directory:
ADMIN_USERNAME=admin
ADMIN_PASSWORD=change_this_password
ADMIN_AUTH_KEY=your_auth_key
JWT_SECRET=your_jwt_secretThe platform implements multiple security measures:
- JWT-based Authentication: Secure token-based authentication for all API requests
- Two-Factor Authentication (2FA): Optional 2FA using TOTP for enhanced account security
- Secure Wallet Integration: Web3 wallet connections with signature verification
- CORS Protection: Configurable Cross-Origin Resource Sharing policies
- Rate Limiting: API rate limiting to prevent abuse
- Input Validation: Server-side validation for all user inputs
- Secure Password Hashing: Bcrypt for password storage
- Environment Variables: Sensitive data stored in environment variables, not in code
Important Security Note: Never commit .env files to version control. Always use .env.example files as templates.
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Real-Time: Socket.IO
- Authentication: JWT (JSON Web Tokens)
- Blockchain: Web3.js, Ethers.js, TronWeb
- Payments: Tatum API for crypto transactions
- Email: SendGrid for transactional emails
- Task Scheduling: node-cron
- Framework: React 18.2.0
- State Management: Redux with Redux Thunk
- UI Library: Material-UI (MUI)
- Routing: React Router DOM
- Web3 Integration: @web3-react/core, Ethers.js
- Real-Time: Socket.IO client
- HTTP Client: Axios
- Build Tool: react-app-rewired with custom webpack config
- Primary Database: MongoDB
- ODM: Mongoose
- Models: User, Game, Transaction, Bet History, and more
The platform supports multiple blockchain networks:
- Ethereum: Mainnet and Sepolia testnet via Infura
- Binance Smart Chain: Mainnet and testnet
- Tron: Mainnet and Shasta testnet
- Bitcoin: Via Tatum API
- MetaMask wallet connection
- WalletConnect for mobile wallets
- Coinbase Wallet integration
- Trust Wallet support
- Tatum API: Handles wallet creation, deposits, and withdrawals
- Smart Contract Integration: ERC-20, BEP-20, and TRC-20 token support
- Transaction Monitoring: Real-time transaction status updates
- Multi-currency Support: BTC, ETH, BNB, TRX, USDT, and more
- Real-time multiplayer gameplay with Socket.IO
- Multiple game types (Crash, Dice, Mines, Scissors, Slot, Plinko, Turtle Race)
- Provably fair gaming with seed-based randomness
- Instant game results and payouts
- Game history and statistics
- Multi-currency wallet support
- Deposit and withdrawal functionality
- Real-time balance updates
- Transaction history
- Multi-chain token support
- Multiple authentication methods (Email, Google OAuth, Web3 wallet)
- User profile management
- Game settings and preferences
- Betting history and statistics
- Affiliate program support
- Tournament participation
- Comprehensive admin dashboard
- User management and moderation
- Game configuration
- Transaction monitoring
- Analytics and reporting
- Campaign management
- Real-time chat system
- User-to-user messaging
- Chat moderation tools
To run all backend services simultaneously, execute each service in a separate terminal or use a process manager like PM2:
# Terminal 1 - Main Server
cd backend
npm run dev
# Terminal 2 - Admin Service
npm run admin
# Terminal 3 - Management Service
npm run manage
# Terminal 4 - Chat Service
npm run chatroom
# Terminal 5-11 - Game Services
npm run crash
npm run dice
npm run mines
npm run scissors
npm run slot
npm run plinko
npm run turtlebackend/
├── server.js # Main server entry point
├── config.js # Configuration file
├── controllers/ # Request handlers
├── models/ # Database models
├── routes/ # API routes
├── middleware/ # Express middleware
├── helper/ # Utility functions
├── crash/ # Crash game service
├── dice/ # Dice game service
├── mines/ # Mines game service
├── scissors/ # Scissors game service
├── slot/ # Slot game service
├── plinko/ # Plinko game service
├── turtlerace/ # Turtle race service
├── userchat/ # Chat service
├── management/ # Management service
└── admin/ # Admin service
frontend/
├── src/
│ ├── App.js # Main app component
│ ├── index.js # Entry point
│ ├── config/ # Configuration files
│ ├── redux/ # Redux store and reducers
│ ├── routes/ # Route definitions
│ ├── views/ # Page components
│ ├── layout/ # Layout components
│ ├── assets/ # Static assets
│ └── themes/ # Theme configuration
└── public/ # Public assets
Always use environment variables for sensitive configuration. Never hardcode:
- API keys
- Database credentials
- JWT secrets
- Private keys
- Service URLs
We welcome contributions to improve the platform. To contribute:
- Fork the repository
- Create a feature branch from the main branch
- Make your changes with clear commit messages
- Test your changes thoroughly
- Push your branch to your fork
- Open a Pull Request with a detailed description
- Follow existing code style and conventions
- Write clear, commented code
- Add tests for new features when possible
- Update documentation for significant changes
- Ensure all services start without errors
Port Already in Use: If a port is already in use, either stop the conflicting service or change the port in the configuration file.
MongoDB Connection Error:
Ensure MongoDB is running and the connection string in .env is correct. Check network connectivity for cloud MongoDB instances.
Module Not Found:
Run npm install again in the affected directory. Use --legacy-peer-deps flag if you encounter peer dependency conflicts.
Socket.IO Connection Issues:
Verify that the Socket.IO server is running and the client is configured with the correct URL in baseConfig.js.
Web3 Wallet Connection: Ensure you have a Web3 wallet extension installed (MetaMask, etc.) and are on a supported network.
This project is licensed under the ISC License.
You are free to use, modify, and distribute this software. However, please use it responsibly and in compliance with applicable laws and regulations in your jurisdiction.
For questions, support, or collaboration opportunities:
- Telegram: https://t.me/d0sc4u
Feel free to reach out for technical support, feature requests, or general inquiries about the platform.
This platform utilizes various open-source libraries and frameworks. Special thanks to all the contributors and maintainers of the projects that make this platform possible.
Note: This is a gaming platform that involves cryptocurrency transactions. Always ensure compliance with local regulations regarding online gaming and cryptocurrency usage. Use responsibly and at your own risk.