Skip to content

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

On-Chain Guestbook dApp 📖✍️

Deployed on Vercel GitHub License

React Solidity Hardhat Tailwind CSS Ethers.js


photo_2025-09-18_11-46-24


🚀 About The Project

This project is a full-stack decentralized application (dApp) that demonstrates a complete end-to-end Web3 development workflow. It functions as a simple, on-chain guestbook where users can connect their Ethereum wallet and write a message that is permanently and transparently stored on the Sepolia testnet blockchain.

This repository serves as a portfolio piece showcasing the integration of a smart contract backend with a modern React frontend.

Core Features:

  • Wallet Connectivity: Connects to user's MetaMask wallet.
  • On-Chain Data Reading: Fetches and displays the current message from the smart contract.
  • On-Chain Data Writing: Allows users to submit a new message via a blockchain transaction.
  • Real-time Transaction Feedback: Provides UI updates for pending, successful, and failed transactions.

🛠️ Tech Stack

Smart Contract (Backend)

  • Solidity: For writing the smart contract logic.
  • Hardhat: For the development environment, testing, and deployment scripts.
  • Alchemy: For the RPC node connection to the Sepolia network.

Frontend

  • React.js (Vite): For building the interactive user interface.
  • Ethers.js: For connecting the frontend to the user's wallet and the smart contract.
  • Tailwind CSS: For utility-first styling.
  • Vercel: For deployment and hosting.

⚙️ Getting Started

To run this project locally, you will need to run the backend (Hardhat node) and the frontend (Vite server) in separate terminals.

Prerequisites

  • Node.js (v18 or later recommended)
  • An Ethereum wallet browser extension like MetaMask

Installation & Local Setup

  1. Clone the Repository

    git clone [https://github.com/Omega4T/BlockChainMessage.git](https://github.com/Omega4T/BlockChainMessage.git)
    cd BlockChainMessage
  2. Set Up the Backend (Smart Contract)

    # Navigate to the smart contract directory
    cd smart-contract
    # Install dependencies
    npm install

    Create a .env file in this directory and add your Sepolia RPC URL and Private Key. This is needed for public testnet deployment.

    SEPOLIA_URL="YOUR_RPC_URL"
    PRIVATE_KEY="YOUR_WALLET_PRIVATE_KEY"
  3. Set Up the Frontend

    # Navigate to the frontend directory from the root
    cd frontend 
    # Install dependencies
    npm install

    Create a .env file in this frontend directory for the contract address.

    VITE_CONTRACT_ADDRESS=YOUR_DEPLOYED_CONTRACT_ADDRESS
  4. Run the Application Locally

    • Terminal 1 (Run Blockchain):
      cd smart-contract
      npx hardhat node
    • Terminal 2 (Deploy Contract Locally):
      cd smart-contract
      npx hardhat run scripts/deploy.js --network localhost
      (Copy the deployed address and paste it into the frontend's .env file)
    • Terminal 3 (Run Frontend):
      cd frontend
      npm run dev

📜 Deployed Contract on Sepolia

The smart contract is publicly deployed on the Sepolia Testnet.

View Contract on Etherscan


About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages