A decentralized voting dApp running on the Nuklai blockchain built with React + Firebase, thanks to @nuklai-js-sdk & @hyperchain-js-sdk.
- ReactJS
- Tailwind
- Firebase Realtime Database
- Nuklai SDK
- HyperchainSDK
- Clone the repository
- Install dependencies:
npm install-
Set up Firebase:
- Create a Firebase project
- Add your Firebase config to
src/services/firebase.js
-
Set up Nuklai SDK:
- Make sure you have the correct NuklaiVM credentials in
src/services/nuklaiService.js
- Make sure you have the correct NuklaiVM credentials in
npm startnpm run buildApp.js: Main component.Card.js: Voting interface.Votes.js: Displays voting results.firebase.js: Firebase config.nuklaiService.js: Initializing the Nuklai SDK and balance related logic.utils.js: Utility functions for vote processing via the NuklaiVM, Firebase storage logic.
getBalanceAndAddress: Retrieves the user's Nuklai address and balance from the NuklaiVMsignAndGetBalance: Processes the vote and updates Firebase.
recharts: For the pie-chart.react-hot-toast: For notifications.
This dApp is for demo purposes only. All votes are via the NuklaiVM Testnet.