Step-by-Step Process
1. Player Registration & Wallet Connection
Registration: Players register on your platform, providing minimal details (username, email) and connecting their Solana wallet (e.g., Phantom). Authentication: Use JWT-based authentication for secure sessions. The wallet connection is recorded and linked to their user account, so every on-chain action is tied to a verifiable wallet address. 2. Viewing Personal Dashboard & Transaction History
Account Overview: Players can view their profile, wallet balance, and a summary of their past activities. Transaction History: Display a detailed log pulled from your PostgreSQL transactions table. Each entry shows the type (bet, NFT mint, reward), amount, timestamp, and a unique blockchain transaction signature. Each transaction signature acts as a verifiable reference; players can click a link (e.g., to Solana Explorer) to audit the transaction on-chain. 3. Joining a Game & Placing a Bet
Selecting a Betting Room: Players choose a room that matches their desired bet size. Placing Bets: Once in a room, a bet is placed which is recorded in the bets table, and a corresponding transaction is initiated on-chain. WebSocket Broadcasts: The bet is immediately broadcast to all connected clients so players see live status updates. The backend logs each bet with details (user ID, bet amount, team selection) and associates it with a blockchain transaction that is later visible for auditing. 4. Randomized Team Assignment & Game Execution
VRF Integration: A Verifiable Random Function (VRF) (e.g., via Chainlink VRF on Solana) is used to assign players to teams fairly. Smart Contract Logging: The randomization process is executed by the smart contract and recorded on-chain. The smart contract calculates the winning team based on the cumulative coin weight, and the result is stored in the games table. All random values and team assignments are logged on-chain. Players can verify the fairness of the assignment by checking the corresponding on-chain records. 5. Reward Distribution & NFT Minting
The smart contract deducts a 5% fee and distributes the remaining prize proportionally among the winning team members. NFT Rewards: For special achievements, the system mints NFTs (recorded in the nft_rewards table) as an additional reward. Every reward distribution and NFT mint operation creates a transaction on the Solana blockchain. Players receive detailed information for each reward, including the distribution breakdown and the blockchain transaction signature that they can verify. 6. Leaderboard & Detailed Game History
Aggregated statistics (total bets, wins, NFTs earned) are stored in the leaderboard table. A REST API endpoint (or real-time WebSocket channel) provides a view of top players. Each game session’s details including room ID, participating players, bet amounts, team assignments, and final outcome—are stored in the games and bets tables. A detailed view on the frontend shows players a complete breakdown of each game they participated in. Every game and transaction is recorded in the backend database. Players can view comprehensive logs and cross-reference on-chain transaction signatures for further verification. 7. User Interface & Verification Tools
Dashboard & Detailed Views: User Dashboard: Contains sections for "My Account," "Game History," "Transaction History," and "Leaderboard." Transaction Verification: Each transaction entry includes a clickable link that opens a block explorer (e.g., Solana Explorer) so that players can verify the transaction details on-chain. WebSockets: Ensure players receive live updates (e.g., when teams are assigned or rewards are distributed) so they always see the latest information. The system design ensures that all actions—from bet placement to reward distribution—are transparent and verifiable, reinforcing trust among players.
Server Cost and Services (For Test can use Free $300 credit from AWS duration 6 months)
AWS Service / Instance Type
Cost Considerations (24×7)
Cost Optimization Strategies
Database
Database done in PostgreSql
As of Now this the basic tables needed will share the sql file and may have to introduce further tables if needed.
Server Architecture
Currently will be doing in clean architecture .We may be further doing microservices so i would prefer clean architecture since it can be easily migrated to different services.
Servises-
1)Authentication
2) Verification(all the blockchain transaction can be seen and mostly for the transparency’s )
3)Game implementation
4) Randomisation (will be a service because,will be using an algorithm for this)
5)Admin
Cron Jobs-
These are basically shedulers will be as a separate entity will be hosted in aws Lambda and integrated with rds and cloudwatch shedulers.
we may also have shedulers as a service in our main server also.We may need this for realtime scheduling.
For Cron we may use seperate db services for listing out all the schedulers and the status.
Frontend Hosting
Will be using AWS s3 bucket and Cloudfront.These services are not costly and best for ci cd.
Conclusion
Listed out the services,Project planning and brief estimate for the cloud cost.