P2P Gists is a modern, privacy-focused alternative to traditional code sharing platforms. Instead of storing your code on centralized servers, it uses cutting-edge peer-to-peer technology to share encrypted code snippets directly between users.
Instead of sending your code to a central server (like GitHub or Pastebin), P2P technology allows users to share data directly with each other. Think of it like passing a note directly to someone instead of putting it in a shared mailbox.
Your data lives on your device first. The app works offline, syncs when online, and you maintain control over your information. No dependency on external servers for basic functionality.
Your code is encrypted before it leaves your device and can only be decrypted by recipients who have the proper keys. Even if someone intercepts the data, they can't read it without the decryption key.
- π End-to-end encrypted code sharing
- π Peer-to-peer distribution using Waku network
- πΎ Local-first - works offline and syncs when online
- π¨ Syntax highlighting for 20+ programming languages
- π Dark/Light theme support
- π± Responsive design - works on desktop and mobile
- π No registration required - truly anonymous
- β‘ Fast and lightweight - built with modern web technologies
- Frontend: React 18 + Vite
- Styling: Tailwind CSS
- P2P Network: Waku - Ethereum's messaging protocol
- Database: Dexie (IndexedDB wrapper)
- Encryption: Built-in Web Crypto API
- Syntax Highlighting: PrismJS
- Routing: React Router
Visit the live application: https://weboko.github.io/p2p-gists/
- Node.js 18+ installed
- npm or yarn package manager
# Clone the repository
git clone https://github.com/weboko/p2p-gists.git
cd p2p-gists
# Install dependencies
npm install
# Start development server
npm run devThe app will be available at http://localhost:3000
# Build the application
npm run build
# Preview the build
npm run preview- Open the app in your browser
- Write or paste your code in the editor
- Select the programming language from the dropdown
- Add a title (optional)
- Click "Share" to generate an encrypted link
- Copy the link and share it with others
- Click on a P2P Gists link you received
- The app will automatically decrypt the code (if you have access)
- View the syntax-highlighted code in your browser
- Copy the code or save it locally if needed
- No accounts required - completely anonymous
- No server storage - code is shared directly between peers
- Automatic encryption - your code is encrypted before leaving your device
- Ephemeral sharing - snippets exist only as long as peers are sharing them
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Your Device β β Waku Network β β Peer's Device β
β β β β β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β β Encrypt β βββββΆβ β Relay β βββββΆβ β Decrypt β β
β β Code β β β β Messages β β β β Code β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β β β β β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β β Local Store β β β β P2P Network β β β β Local Store β β
β β (IndexedDB) β β β β (Libp2p) β β β β (IndexedDB) β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Code is encrypted on your device using Web Crypto API
- Encrypted data is shared via Waku's P2P network
- Peers receive and decrypt the code using the shared key
- Local storage keeps your snippets available offline
src/
βββ components/ # React components
β βββ CreateSnippet.jsx
β βββ ViewSnippet.jsx
β βββ ...
βββ hooks/ # Custom React hooks
β βββ useIdentity.js
β βββ useTheme.js
βββ lib/ # Core utilities
β βββ crypto.js # Encryption/decryption
β βββ database.js # Local storage
β βββ waku.js # P2P networking
β βββ utils.js
βββ ...
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintThe app automatically detects the environment:
- Development: No configuration needed
- GitHub Pages: Automatically configured for deployment
We welcome contributions! Here's how you can help:
Want to dive deep into P2P technology? We have exciting implementation challenges:
- Peer Sharing Module - Implement real-time P2P snippet sharing
- Collaborative Editing - Add CRDT-based collaborative editing
π View All Challenges & Get Started β
- Check existing issues
- Create a new issue with detailed description
- Open an issue to discuss your idea
- Fork the repo and create a pull request
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test thoroughly
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a pull request
- β End-to-end encryption for all code snippets
- β No server-side storage of your code
- β No tracking or analytics
- β Open source - audit the code yourself
- β No data collection - we don't know what you share
- β No user accounts - completely anonymous
- β No server logs - no central storage of any kind
- Links contain encryption keys - only share with trusted recipients
- Snippets are ephemeral - they exist only while peers are online
- Use responsibly - don't share sensitive credentials or personal data
- Waku Protocol - Decentralized messaging
- Libp2p - P2P networking stack
- IndexedDB - Browser storage
- Web Crypto API - Browser encryption
- IPFS - Distributed file system
- Secure Scuttlebutt - P2P social network
- Dat Protocol - Distributed data sharing
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this project useful:
- β Star the repository
- π¦ Share on social media
- π€ Contribute to the code
- π Report bugs or suggest features
Made with β€οΈ for the decentralized web
Demo β’ Issues β’ Discussions