π¦ Twitter DApp (Decentralized Application) A Twitter-like decentralized application (DApp) built on Ethereum that allows users to:
Connect their MetaMask wallet
Post tweets stored on the blockchain
Like tweets
View tweets associated with their address
This project demonstrates how blockchain and Web3 can be used to create social media experiences where data is decentralized and transparent.
π Features β Connect MetaMask wallet
π Create and publish tweets
β€οΈ Like other tweets
π Real-time tweet updates from smart contract
π Data is stored on the Ethereum blockchain via a smart contract
π§ Tech Stack Solidity β Smart contract development
Remix IDE β Contract deployment and testing
Web3.js β JavaScript library for Ethereum interactions
MetaMask β Ethereum wallet integration
HTML/CSS/JS β Frontend user interface
Cloud IDE β Hosted with CodeSandbox for frontend
π¦ Smart Contract Overview Smart contract includes:
createTweet(string _tweet) β Post a new tweet
getAllTweets(address _owner) β Fetch all tweets of a user
likeTweet(address author, uint256 id) β Like a tweet by ID
unlikeTweet(address author, uint256 id) β Remove a like from a tweet
getTweet(uint256 _i) β Fetch a single tweet
changeTweetLength(uint16 newTweetLength) β Admin control (optional)
Each tweet contains:
id
author
content
timestamp
likes
π Setup Instructions
- Clone the repository
Copy Edit git clone https://github.com/devloperaziz1280/twitter-dapp.git cd twitter-dapp
- Install dependencies
Copy Edit npm install
- Install dependencies
Copy Edit npm install
- Connect MetaMask Install MetaMask browser extension if not already installed.
Connect your MetaMask wallet to the app.
Make sure to use the same Ethereum network where your contract is deployed (e.g., Goerli/Testnet or Localhost).
- Deploy Smart Contract (Optional if already deployed) Use Remix IDE to:
Paste your contract code
Compile and deploy it
Copy the contract address and ABI
- Update Frontend Config Edit the following in the JS file:
js Copy Edit const contractAddress = "YOUR_CONTRACT_ADDRESS"; import contractABI from "./abi.json";
πΈ Screenshots Wallet Connection Post Tweet Like Tweet
π License This project is open-sourced under the MIT License.
π Acknowledgements Web3.js Documentation β https://web3js.readthedocs.io/
Solidity Language Docs β https://docs.soliditylang.org/
MetaMask Docs β https://docs.metamask.io/
π¬ Contact If you want to learn more or collaborate, feel free to reach out!
Developer: Aziz Ur Rehman Email: devloperaziz1280@example.com