GMChat is a decentralized, end-to-end encrypted messaging application built with React, WebSocket relay, and IPFS storage. Features enterprise-grade security with ECDH key exchange and zero-knowledge architecture.
- π End-to-End Encryption: AES-256-GCM with unique keys per conversation
- π Secure Key Exchange: ECDH P-256 for cryptographic key derivation
- π Decentralized Storage: IPFS for censorship-resistant message storage
- π‘ P2P Messaging: WebSocket relay for real-time communication
- πΌ Wallet Integration: MetaMask, WalletConnect, Coinbase Wallet
- π‘οΈ Enterprise Security: API keys protected in backend, no client exposure
- π± Responsive Design: Works on desktop and mobile devices
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Client App β β Backend API β β IPFS Network β
β β β β β β
β β’ ECDH Keys βββββΊβ β’ API ProtectionβββββΊβ β’ Pinata Gatewayβ
β β’ AES-256-GCM β β β’ Environment β β β’ Decentralized β
β β’ WebSocket β β β’ Rate Limiting β β β’ Permanent β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β WebSocket Relay β
β β
β β’ Real-time β
β β’ P2P Messaging β
β β’ Message Queue β
βββββββββββββββββββ
- Frontend: React, TypeScript, Tailwind CSS
- Backend: Node.js, Express, Vercel API Routes
- Encryption: Web Crypto API, ECDH, AES-GCM
- Storage: IPFS via Pinata
- Messaging: WebSocket relay server
- Wallets: Wagmi, RainbowKit
- Deployment: Vercel
-
API Key Protection
- Backend proxy prevents client-side exposure
- Environment variables secured on server
- No sensitive data in client code
-
Cryptographic Security
- ECDH P-256 for key exchange
- AES-256-GCM for message encryption
- Unique keys per conversation
- ECDSA signatures for message integrity
-
Privacy Protection
- No metadata stored in IPFS
- Encrypted content only
- Sanitized logging
- Zero-knowledge architecture
-
Network Security
- WebSocket relay for P2P communication
- CORS protection
- Rate limiting ready
- HTTPS enforcement
- Node.js 18+
- npm or yarn
- Git
git clone https://github.com/YOUR_USERNAME/p2p-messaging-app.git
cd p2p-messaging-appnpm install# Copy environment template
cp env.example .env
# Edit .env with your values
REACT_APP_BACKEND_URL=/api# Start all services
npm run dev
# Or start individually
npm run backend # Backend API
npm run relay # WebSocket relay
npm start # Frontend app- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- WebSocket Relay: ws://localhost:9001
- Fork this repository
- Connect to Vercel
- Set environment variables:
PINATA_API_KEY=your_pinata_api_key PINATA_SECRET_KEY=your_pinata_secret_key REACT_APP_BACKEND_URL=/api - Deploy!
# Build for production
npm run build
# Deploy to your preferred platform
# The build folder contains the static filesPINATA_API_KEY=your_pinata_api_key
PINATA_SECRET_KEY=your_pinata_secret_keyREACT_APP_BACKEND_URL=/api
REACT_APP_ALCHEMY_API_KEY=your_alchemy_key
REACT_APP_WALLETCONNECT_PROJECT_ID=your_project_id- Connect Wallet: Use MetaMask, WalletConnect, or Coinbase Wallet
- Add Contacts: Enter wallet addresses of people you want to message
- Send Messages: Type and send encrypted messages
- Real-time: Messages appear instantly via WebSocket relay
- Permanent Storage: Messages stored on IPFS for offline access
- β Use HTTPS for all connections
- β Implement rate limiting
- β Add user authentication if needed
- β Monitor for suspicious activity
- β Regular security audits
- β Key rotation policies
- π’ Production Ready: Enterprise-grade security implemented
- π’ API Protection: Keys never exposed to client
- π’ Encryption: Military-grade AES-256-GCM
- π’ Privacy: Zero-knowledge architecture
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- IPFS for decentralized storage
- Pinata for IPFS pinning service
- Vercel for deployment platform
- Wagmi for wallet integration
- RainbowKit for wallet UI
- π§ Email: support@yourdomain.com
- π¬ Discord: Join our community
- π Documentation: Read the docs
- π Issues: GitHub Issues
Built with β€οΈ for a decentralized future π