The moralis integration has been removed. Please use the the graph integration instead.
This is a section of the Javascript Blockchain/Smart Contract FreeCodeCamp Course.
⌨️ (16:34:07) Lesson 10: NextJS Smart Contract Lottery (Full Stack / Front End)
Example App here! Example App on IPFS here!
Built with ❤️ using: NextJS Solidity Chainlink Moralis web3uikit Ethers Hardhat IPFS
This project is a part of the Hardhat FreeCodeCamp video.
Video coming soon...
git --version
and you see a response like git version x.x.x
node --version
and get an ouput like: vx.x.x
npm
yarn --version
and get an output like: x.x.x
npm
or corepack
git clone https://github.com/PatrickAlphaC/nextjs-smartcontract-lottery-fcc
cd nextjs-smartcontract-lottery-fcc
yarn
yarn dev
If you want to get to typescript and you cloned the javascript version, just run:
git checkout typescript
If you can't or don't want to run and install locally, you can work with this repo in Gitpod. If you do this, you can skip the clone this repo
part.
To have VSCode extension prettier auto-format .jsx
and .tsx
, add the following to your settings.json file:
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
In a different terminal / command line
git clone https://github.com/PatrickAlphaC/hardhat-fund-me-fcc
cd hardhat-fund-me-fcc
yarn
yarn hardhat node
You can read more about how to use that repo from its README.md
http://127.0.0.1:8545/
)Ideally, you'd then import one of the accounts from hardhat to your wallet/metamask.
Back in a different terminal with the code from this repo, run:
yarn dev
Head over to your localhost and play with the lottery!
I didn't write any front end tests 😢
If you'd like to create some tests for this repo, please make a PR!
yarn build
yarn next export
Note: Some features of NextJS & Moralis are not static, if you're deviating from this repo, you might run into errors.
import
and choose the folder the above step just created (should be out
)Get IPFS companion for your browser (or use Brave Browser)
Go to ipfs://YOUR_CID_HERE
and see your ipfs deployed site!
You can also have Fleek auto-deploy your website if you connect your github. Connect to fleek and follow along the docs there. You'll get an IPFS hash and a "regular" URL for your site.
To check linting / code formatting:
yarn lint
If you appreciated this, feel free to follow me or donate!
ETH/Polygon/Avalanche/etc Address: 0x9680201d9c93d65a3603d2088d125e955c73BD65