/scaffold-eth-db

Primary LanguageCSSMIT LicenseMIT

๐Ÿ— Scaffold-ETH-Database-v1

Scaffold-ETH stack plus Deta.sh NoSQL database! ๐Ÿš€

๐Ÿงช Quickly deploy and experiment with Solidity using a frontend that adapts to your smart contract ๐Ÿงช And a free unlimited storage backend:

join_deta

๐Ÿ„โ€โ™‚๏ธ Quick Start

Create a free account on deta.sh. Requires only an email address.

confirm your email then login to your deta account:

A page will display your project key. Copy and save this key.

project_key

Code Prerequisites: Node (v16 LTS) plus Yarn and Git

clone/fork ๐Ÿ— scaffold-eth-db:

git clone https://github.com/2187Nick/scaffold-eth-db.git

install and start your ๐Ÿ‘ทโ€ Hardhat chain:

cd scaffold-eth-db
yarn install
yarn chain

๐Ÿ’ผ Add your Deta project key in packages/react-app/.env

in a second terminal window, start your ๐Ÿ“ฑ frontend:

cd scaffold-eth-db
yarn start

in a third terminal window, ๐Ÿ›ฐ deploy your contract:

cd scaffold-eth-db
yarn deploy

๐Ÿ“ฑ Open http://localhost:3000 to see the app. Click "Grab Funds from Faucet"

To test the database we will write a message on the blockchain. Type message then click Send Message:

code: await database.put({sender: update.from, message: newPurpose});

write_msg_here

Verify the data was written to your Deta database:

deta_first_entries

Fetch Data pulls all data from the database:

code: await database.fetch();

fetch_all_data

Next enter a message to pull it's details stored in the database.

single_msg_details

To create a new database enter a name and click Create.

second_db

10 seconds later it will appear in the dropdown menu.

second_db_dropdown

Select the new database and send a new message. Check Deta to verify the new database was created.

second_db_deta

In v2 we will deploy an Express.js API running on our free Deta virtual machine.

๐Ÿ“š Additional

๐Ÿ” Edit your smart contract YourContract.sol in packages/hardhat/contracts

๐Ÿ“ Edit your frontend App.jsx in packages/react-app/src

๐Ÿ’ผ Edit your deployment scripts in packages/hardhat/deploy

๐Ÿ“š Documentation

Documentation, tutorials, challenges, and many more resources, visit: docs.scaffoldeth.io

๐Ÿฆ Other Flavors

๐Ÿ”ญ Learning Solidity

๐Ÿ“• Read the docs: https://docs.soliditylang.org

๐Ÿ“š Go through each topic from solidity by example editing YourContract.sol in ๐Ÿ— scaffold-eth

๐Ÿ“ง Learn the Solidity globals and units

๐Ÿ›  Buidl

Check out all the active branches, open issues, and join/fund the ๐Ÿฐ BuidlGuidl!

๐Ÿ’Œ P.S.

๐ŸŒ You need an RPC key for testnets and production deployments, create an Alchemy account and replace the value of ALCHEMY_KEY = xxx in packages/react-app/src/constants.js with your new key.

๐Ÿ“ฃ Make sure you update the InfuraID before you go to production. Huge thanks to Infura for our special account that fields 7m req/day!

๐Ÿƒ๐Ÿ’จ Speedrun Ethereum

Register as a builder here and start on some of the challenges and build a portfolio.

๐Ÿ’ฌ Support Chat

Join the telegram support chat ๐Ÿ’ฌ to ask questions and find others building with ๐Ÿ— scaffold-eth!


๐Ÿ™ Please check out our Gitcoin grant too!

Automated with Gitpod

Open in Gitpod