-
Install Nextjs with
yarn create next-app .
(FULLSTOP IS IMPORTANT) -
Install React-Moralis to build web3 frontend easily.
-
Install "Web3UIKit" = Beautiful and Lightweight UI components for web3 developers. This UI library will speed up your Dapp development no matter which chain you build on.
-
Create Header.jsx
-
Create LotteryEntrance.jsx
-
Go back to contract directory and run local hardhat node chain.
-
Create a new file "update-frontend-deploy" script into deploy folder in hardhat-lottery-smartcontract directory. This script will create constants (abi stuff) folder automatically everytime we update the backend files.
-
Run
yarn build
to build a static site of nextjs version. This site have no way to talk with the backend. Since we are deploying it on IPFS we didn't need the backend. -
Then run
yarn next export
which will make a folder "out" consisting the static site which we can upload on IPFS.
Note: Step 9 will fail if any server side stuff is available.
- Download Desktop IPFS or You can run a node on Brave Browser.
- Import the "out" folder.
- CLick "Set Pinning" and apply.
- Copy CID
- search
ipfs://copy-cid
or NEXTJS Static site linkipfs://QmeH7oCUPP3eeCUcQoAqjFjoKeHgcCNrQHFQ5CLZ3Fki5G/
- Go to fleek.co and signin with github
- Then Connect your repository like netlify and setup your site.
- Get the site Link https://rohit-decentralized-lottery.on.fleek.co/