Tutorial "Build your own betting dApp"
Our detailed tutorial covers everything you need to build a betting website on the Azuro protocol, from environment setup to frontend development. Whether you're a seasoned developer or just starting out, our tutorial is designed to help you build a fully functional betting website.
Here is an example of the final result: https://github.com/Azuro-protocol/azuro-tutorial-app (opens in a new tab).
Setup a project
- Setup a new Next.js application that will serve as the basis for the project.
- Install all the necessary dependencies required for the project to function correctly.
Prepare users to connect their wallets
- Implement a Web3 wallets connector that will enable users to connect their wallets to the application.
- Create a UI button that will allow users to connect their wallets to the application.
Create a page with sport events
- Configure the GraphQL environment to enable the application to retrieve data regarding sports events.
- Display a list of sport events that users can select and view details on.
Create a sport event page
- Create a dedicated page for each sport event that displays the available markets and odds buttons.
- Implement functionality that automatically updates the odds values to reflect changes in real-time.
Place a first bet
- Implement smart contracts logic that enables users to place bets on the selected sports event.
- Create an interface that allows users to place bets by selecting the desired market and entering the desired amount.
Create a bets history page
- Create a dedicated page that displays a list of all the bets placed by the user.
- Implement logic that enables users to claim their winnings if they placed a winning bet.