Welcome to the Chat dApp! This Solidity smart contract powers a chat application on the Binance Smart Chain (BSC). The contract provides mechanisms to define users, friends, and messages, and leverages mappings for efficient data storage of user profiles, friend data, and message exchanges.
In addition to the functionalities of user account creation, friend management, and message exchange, the contract now allows:
- Storing of IPFS hashes for user profile pictures.
- Deleting sent messages.
- Retrieving all app users' information.
- Reading conversations between friends.
This dapp is developed using a combination of Next.js, Tailwind CSS, Solidity, Hardhat, Ethers.js, IPFS, and RainbowKit. It is deployed on the Binance Smart Chain Testnet and hosted on Vercel.
This project utilizes the following technologies to deliver a high-quality user experience:
- NextJS
- TailwindCSS
- Solidity
- Hardhat
- Ethers.js
- RainbowKit
- Wagmi
- IPFS
- BscScan
- BNBChain Testnet
- Vercel
For a live, click the badge below:
Follow these instructions to set up and run this application on your local machine:
Ensure you have the following installed on your system:
- Node.js
- NPM or Yarn
- Hardhat
Having knowledge of Wallet Connect Modals and React Hooks is advantageous:
-
Clone the repository:
git clone https://github.com/ahmetenesdur/chat-dapp.git
-
Install required packages:
npm install
or
yarn install
-
Set up environment variables in
.env.local
:RPC_URL="" NEXT_PUBLIC_RPC_URL="" NEXT_PUBLIC_WALLET_CONNECT_ID="" METAMASK_PRIVATE_KEY="" BSCSCAN_API_KEY="" NEXT_PUBLIC_WEB3_STORAGE_TOKEN=""
-
Compile the smart contract (Comprehensive contract details are provided with explanatory comments):
npx hardhat compile
-
(Optional) Test the smart contract:
npx hardhat test
-
Deploy the smart contract:
npx hardhat run scripts/deploy.js --network testnet
-
(Optional) Verify the smart contract:
npx hardhat run scripts/verify.js --network testnet
-
Start the app:
npm run dev
or
yarn dev
-
Open the app in your browser:
http://localhost:3000
With the Chat dApp, users can:
- Create an account with their desired username and an IPFS hash of their profile picture.
- Add friends using their public addresses and see friends' profile images.
- Send messages to friends and read previous messages.
- Delete specific messages sent.
- Retrieve a list of all users registered on the app.
- Explore friend lists.
- Search friends by username.
- Read entire conversations between friends.
Explore the dApp's visual appeal through these screenshots:
Distributed under the MIT License. See LICENSE
for more information.