Skip to content

2187Nick/scaffold-eth-db

Repository files navigation

🏗 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