Yalla E-Sports is an innovative platform designed to revolutionize the gaming and streaming ecosystem. By leveraging the Solana blockchain, Yalla E-Sports offers gamers and streamers the opportunity to earn SOL and unique NFTs as rewards for their achievements and engagement. The platform is built with a Node.js and Express backend and a frontend powered by Streamlit.
yalla/
├── server/
│ ├── src/
│ │ ├── routes/
│ │ ├── services/
│ │ ├── utils/
│ │ └── index.js
│ ├── .env
│ └── package.json
├── streamlit_app/
│ ├── app.py
│ ├── requirements.txt
│ └── venv/
└── README.md
-
Environment Configuration: Generate a
.envfile within theserverfolder, incorporating the following details:SOLANA_NETWORK=https://api.devnet.solana.com TREASURY_WALLET_PRIVATE_KEY=[insert_private_key_array]
-
Dependencies: Execute
npm installinside theserverfolder to install required libraries. -
Server Activation: Launch the server with
npm run dev, accessible athttp://localhost:5000.
- package.json: Specifies project dependencies and scripts.
- utils/solana.js: Facilitates Solana blockchain interactions.
- services/userService.js: Manages user data via Firebase.
- services/rewardService.js: Handles achievement and engagement rewards.
- routes/userRoutes.js: Manages user registration and profile endpoints.
- routes/rewardRoutes.js: Oversees achievement and engagement reward endpoints.
-
Dependencies: In the
streamlit_appdirectory, runpip install -r requirements.txt. -
Application Launch: Start the Streamlit app with
streamlit run app.py, which will open athttp://localhost:8501.
- requirements.txt: Lists Python package requirements.
- app.py: Contains the Streamlit application logic for user registration, profile management, and reward simulation.
Navigate to the server directory and execute:
npm install
npm run devIn the streamlit_app directory, perform:
pip install -r requirements.txt
streamlit run app.py- User Registration: Register a new user in the Streamlit app by providing a username and wallet address.
- Profile Viewing: Access a user's profile to view achievements, SOL balance, and rarest NFT.
- Achievement Simulation: Simulate game wins and reward accrual.
- Engagement Rewards: Reward users based on their engagement hours.
- Leaderboard: Display a global leaderboard of top players.
SOLANA_NETWORK=https://api.devnet.solana.com
TREASURY_WALLET_PRIVATE_KEY=[insert_private_key_array]{
"name": "yalla-esports-server",
"version": "1.0.0",
"main": "src/index.js",
"scripts": {
"start": "node src/index.js",
"dev": "nodemon src/index.js"
},
"dependencies": {
"@solana/spl-token": "^0.3.5",
"@solana/web3.js": "^1.66.0",
"cors": "^2.8.5",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"firebase-admin": "^10.0.0"
},
"devDependencies": {
"nodemon": "^2.0.15"
}
}- Substitute
[insert_private_key_array]in the.envfile with your actual Solana wallet private key array. - Utilize Solana's devnet for demonstration purposes to avoid real SOL transactions.
Following these guidelines will help you set up a fully operational application that demonstrates the integration of the Solana blockchain with dynamic rewards for the gaming community.