Skip to content

MayankSharma-ops/BlockChain-ChatDApp

Repository files navigation

🧠 Decentralized Blockchain Chat DApp

A production-grade peer-to-peer messaging platform built on Ethereum using smart contracts — no servers, no databases, fully decentralized.

Status License Built With Web3


🌐 Live Demo

🔗 Live App: https://chat-dapp-live.netlify.app/


🚀 Project Overview

This project demonstrates a complete end-to-end Web3 application where users communicate directly through blockchain transactions.

Unlike traditional chat apps that rely on centralized servers, this system stores relationships and messages on-chain, ensuring:

  • 🔐 Trustless communication
  • 🌐 Censorship resistance
  • 🧾 Immutable message history
  • 👛 Uses wallet-based identity
  • Generates deterministic conversation IDs
  • Enforces mutual friend authorization

Designed to showcase real-world smart contract architecture + modern Web3 frontend engineering.


✨ Core Features

🔐 Wallet-Based Authentication

  • MetaMask login (no email/password)
  • On-chain account initialization
  • Address-based identity system
  • Multi-network compatibility (Holesky / Sepolia)

👥 Friend Request System (On-Chain Social Layer)

  • Send friend requests via public wallet address
  • Accept / reject request workflow
  • Mutual friendship enforcement at contract level
  • Pending request tracking
  • Prevent duplicate friend relationships
  • Deterministic relationship mapping

💬 Messaging System

  • Peer-to-peer blockchain messaging
  • Deterministic chat channels
  • Immutable message storage
  • Timestamped conversations
  • Real-time UI updates
  • Sender/receiver message alignment

🖥️ Frontend Experience

  • Responsive mobile-first design
  • Modern chat interface
  • Message alignment (sender vs receiver)
  • Attachment picker UI
  • Dismissible error handling
  • Optimized re-render performance

⛓️ Blockchain Integration

  • Smart contract-controlled state
  • Gas-efficient data structures
  • Multi-network support
  • Holesky / Sepolia compatible

🏗️ Architecture

User (MetaMask) │ ▼ Frontend (Next.js + React) │ ▼ Ethers.js / Web3Modal │ ▼ Smart Contract (Solidity) │ ▼ Ethereum Network(Mainnet/Testnet)


⚙️ Local Development Setup

1. Clone Repository

git clone https://github.com/MayankSharma-ops/BlockChain-ChatDApp.git
cd chatapp

2️⃣ Install Dependencies

npm install

3️⃣ Run Development Server

npm run dev

=======

🛠 Smart Contract Development (Hardhat)

npx hardhat help
npx hardhat compile
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js --network localhost
npx hardhat run scripts/deploy.js

👨‍💻 Author

Mayank Sharma 💼 Web3 / Full-Stack Developer 🐙 GitHub: https://github.com/MayankSharma-ops

BlockChain-ChatDApp

0x5FbDB2315678afecb367f032d93F642f64180aa3

📜 License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors