Chat Safe is a secure decentralized chat application built on Ethereum blockchain. It allows users to create accounts, add friends, and send encrypted messages to each other, ensuring privacy and security.
- Account Creation: Users can create accounts with a username and password.
- Friend Management: Add friends using their usernames.
- Messaging: Send and receive messages with friends securely.
- Account Management: Update or delete your account.
- Username Display: Usernames are displayed alongside public addresses for better readability.
- Solidity: Smart contract development.
- React: Frontend development.
- Web3.js: Interaction with Ethereum blockchain.
- Truffle: Development environment for Ethereum.
- MetaMask: Ethereum wallet and browser extension.
- Material-UI: UI components.
- Node.js
- Truffle
- MetaMask extension in your browser
- Ethereum client (Ganache, Infura, etc.)
-
Clone the repository
git clone https://github.com/Priyanshrai/Dapp_Chat_Safe.git cd chat-safe
-
Install dependencies
cd truffle npm install cd ../client npm install
-
Compile the smart contracts
cd truffle truffle compile
-
Deploy the smart contracts
truffle migrate
-
Run the frontend application
cd ../client npm start
- Open MetaMask and connect to your Ethereum network.
- Access the application at
http:https://localhost:8080
. - Create your account by entering a username and password.
- Add friends by entering their usernames.
- Select a friend from your friend list and start chatting!
The smart contract handles user account creation, friend management, and messaging. It ensures that messages are securely stored and can only be accessed by the sender and receiver. ndAddress != address(0), "User not found");
Contributions are welcome! Please submit a pull request or open an issue to discuss changes.