Welcome to Decentralized Discord Clone, a cutting-edge web app for decentralized person-to-person chatting. In this app, chats are securely stored on the public blockchain, ensuring transparency, privacy, and ownership of your data.
Users can register with just a username and their MetaMask wallet, adding friends, and chatting in a secure, blockchain-powered environment. Here's everything you need to know to get started with this exciting project!
- User Registration: Simple registration with a unique username, stored directly on the blockchain, alongside your MetaMask wallet address.
- Friend System: Add friends using their username and wallet address. Your friend list updates in real-time in the sidebar.
- Decentralized Messaging: Select a friend from your sidebar and start chatting instantly, with every message stored on the blockchain.
- Blockchain Backend: Leveraging Solidity smart contracts for all chat data storage.
Tech | Description |
---|---|
Solidity | Smart contract development for the Ethereum blockchain. |
Hardhat | Deployment and testing framework for Solidity. |
Vite + React | Fast frontend development with Vite and React. |
Tailwind CSS | Modern CSS framework for responsive and stylish UI. |
MetaMask | Wallet integration for Ethereum-based transactions. |
-
Clone the repository:
git clone https://github.com/akhilkailas017/Decentralized-Discord-clone.git
-
Navigate to the project directory:
cd Decentralized-Discord-Clone
-
Install dependencies:
npm i
-
Run the development server:
npm run dev
-
Once the server is running, open the provided URL in your browser to view the application.
⚠️ Prerequisite: Ensure that you have the MetaMask extension installed and set up in your default browser.
If you'd like to redeploy the smart contract, follow these steps:
-
Clone the repository:
git clone https://github.com/akhilkailas017/Decentralized-Discord-clone.git
-
Navigate to the Hardhat folder:
cd Decentralized-Discord-Clone/hardhat
-
Create an
.env
file in thehardhat
folder with the following structure:metamaskprivatekey="" infuraurl="https://sepolia.infura.io/v3/infura-api" hardhatlocalhost="http://127.0.0.1:8545/"
Replace
infura-api
with your Infura API key andmetamaskprivatekey
with your MetaMask private key. -
Clean old build data:
npx hardhat clean
-
Compile the Solidity code:
npx hardhat compile
-
Deploy the contract:
npx hardhat ignition deploy ignition/modules/Chat.js
-
Update the Frontend:
- Copy the JSON file from
hardhat/artifacts/contracts/ChatApp.sol/ChatApp.json
toDecentralized-Discord-Clone/src/scdata
. - Copy the deployed contract address from
hardhat/ignition/deployments/chain-31337/deployed_addresses.json
and replace thecontractAddress
insrc/App.jsx
.
- Copy the JSON file from
This project combines blockchain security with real-time decentralized messaging, making it a future-proof solution for private, peer-to-peer conversations.
- 💬 Secure Messaging: Your chats are forever stored on a public blockchain, ensuring your conversations are immutable and transparent.
- 🔗 Blockchain Integration: Powered by Ethereum and stored securely on the blockchain via MetaMask wallet.
- 📲 Responsive Design: Built using React and Tailwind CSS for a seamless user experience across all devices.
Watch this quick demo to understand how the Decentralized Discord Clone works in action:
Click the image to watch on YouTube, or watch directly here.
Decentralized Discord Clone is a groundbreaking solution for peer-to-peer communication, blending the power of blockchain with real-time messaging. Follow the steps above to explore, modify, and deploy your very own decentralized chat platform!