Skip to content

Zero-knowledge encrypted code sharing platform. Share code snippets securely with client-side encryption, self-expiring pastes, and one-time views. Built with Next.js and Cloudflare Workers.

License

Notifications You must be signed in to change notification settings

nullcoder/ghostpaste

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

71 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GhostPaste Logo

GhostPaste

Zero-knowledge encrypted code sharing platform where your secrets stay secret

License: MIT Built with Next.js Deployed on Cloudflare

Live Demo β€’ Report Bug β€’ Request Feature


πŸ” What is GhostPaste?

GhostPaste is a privacy-focused code sharing platform that ensures your code snippets remain completely private through client-side encryption. Unlike traditional code sharing services, our servers never have access to your plaintext content - everything is encrypted in your browser before being uploaded.

✨ Key Features

  • πŸ”’ Zero-Knowledge Encryption - Your code is encrypted locally using AES-GCM before leaving your browser
  • πŸ‘€ No Account Required - Share code instantly without signing up
  • ✏️ Password-Protected Editing - Set a password to allow editing your snippets later
  • πŸ“ Multi-File Support - Share multiple files in a single gist
  • 🎨 Syntax Highlighting - Beautiful code display with CodeMirror 6
  • πŸ“‹ One-Click Copy - Copy code or share links instantly
  • πŸŒ“ Dark/Light Mode - Easy on the eyes, day or night
  • ⌨️ Keyboard Shortcuts - Power user friendly with full keyboard support
  • πŸ“± Responsive Design - Works perfectly on all devices
  • πŸš€ Global Edge Deployment - Fast access from anywhere in the world

🚧 Coming Soon

  • ⏱️ Self-Expiring Content - Set snippets to auto-delete after a specified time
  • πŸ‘οΈ One-Time View - Create snippets that disappear after being viewed once
  • πŸ“ Version History - Track changes with automatic versioning (storage ready)

πŸš€ Quick Start

Sharing Code

  1. Visit ghostpaste.dev
  2. Paste or write your code
  3. Add multiple files if needed (click "Add File")
  4. Set an optional password for editing
  5. Click "Create Gist" and share the generated link

Viewing Shared Code

Simply open the shared link - the decryption key is in the URL fragment (#key=...) and never sent to our servers.

Keyboard Shortcuts

  • Cmd/Ctrl + S - Save gist
  • Cmd/Ctrl + Enter - Create/update gist
  • Cmd/Ctrl + ? - Show all shortcuts
  • Escape - Close dialogs

πŸ›‘οΈ Security & Privacy

  • Client-Side Encryption: All encryption/decryption happens in your browser using the Web Crypto API
  • Zero-Knowledge: Servers only store encrypted blobs - we can't read your content even if we wanted to
  • No Tracking: No analytics, no cookies, no user tracking
  • Open Source: Verify our security claims by reviewing the code

πŸ› οΈ Technical Stack

  • Framework: Next.js 15 with React 19
  • Runtime: Cloudflare Workers (Edge)
  • UI Components: shadcn/ui with Radix UI
  • Code Editor: CodeMirror 6
  • Encryption: Web Crypto API (AES-GCM)
  • Storage: Cloudflare R2 with versioning
  • Styling: Tailwind CSS with CSS variables
  • Testing: Vitest with React Testing Library

πŸ“Š Limits

Resource Limit Why?
File size 500 KB Covers 99% of code files
Total size 5 MB Enough for ~10-20 typical files
Files per paste 20 Keeps the UI responsive
Versions kept 50 Balances history with storage

πŸ“ Project Structure

ghostpaste/ β”œβ”€β”€ app/ # Next.js app router β”‚ β”œβ”€β”€ api/ # API routes β”‚ β”œβ”€β”€ create/ # Gist creation page β”‚ β”œβ”€β”€ g/[id]/ # Gist viewing page β”‚ └── demo/ # Component demos β”œβ”€β”€ components/ # React components β”‚ β”œβ”€β”€ ui/ # Reusable UI components β”‚ └── *.tsx # Feature components β”œβ”€β”€ lib/ # Core utilities β”‚ β”œβ”€β”€ storage.ts # R2 storage client β”‚ β”œβ”€β”€ crypto.ts # Encryption utilities β”‚ β”œβ”€β”€ binary.ts # Binary encoding β”‚ └── ... # Other utilities β”œβ”€β”€ types/ # TypeScript types β”œβ”€β”€ docs/ # Documentation └── public/ # Static assets 

πŸ”§ Development

Prerequisites

  • Node.js 20+
  • npm or yarn
  • Git

Quick Start

# Clone the repository git clone https://github.com/nullcoder/ghostpaste.git cd ghostpaste # Install dependencies npm install # Start development server npm run dev # Next.js development (hot reload) # OR npm run preview # Full Cloudflare Workers simulation

See our Local Development Guide for detailed setup instructions.

Configuration

Create a wrangler.toml file:

name = "ghostpaste" compatibility_date = "2024-12-01" [[r2_buckets]] binding = "GHOSTPASTE_BUCKET" bucket_name = "ghostpaste-bucket" [vars] NEXT_PUBLIC_APP_URL = "https://ghostpaste.dev"

For local development secrets, create .dev.vars:

# Any additional secrets go here 

Deployment

# Build for Cloudflare Workers npm run build # Deploy to production npm run deploy

πŸ“ˆ Development Status

GhostPaste is actively being developed. Here's what's completed and what's in progress:

βœ… Completed

  • Core encryption/decryption system
  • Multi-file editor with syntax highlighting
  • Password-protected editing
  • Responsive UI with dark/light mode
  • Copy-to-clipboard functionality
  • Keyboard shortcuts
  • Error handling and boundaries
  • R2 storage with versioning support
  • 100% of UI components (Phase 4)

🚧 In Progress

  • API endpoints (Phase 5 - Storage foundation complete)
  • Self-expiring gists
  • One-time view functionality
  • Version history UI

πŸ“… Upcoming

  • Full API implementation
  • Deployment to production
  • Performance optimizations
  • Additional features based on user feedback

πŸ“– Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for detailed information on how to contribute to this project.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ€– Built with Claude Code

GhostPaste is a testament to the power of AI-assisted development. This entire project was built through a collaborative dialogue between human creativity and Claude's technical expertise. From architecture decisions to implementation details, every line of code emerged from thoughtful conversation.

The Collaboration Story

What started as an idea for a privacy-focused code sharing platform evolved through hundreds of interactions with Claude Code. Together, we:

  • Architected a zero-knowledge encryption system that keeps data private
  • Designed a clean, intuitive UI using modern React patterns
  • Implemented edge-compatible code for global performance
  • Solved complex challenges like versioning and binary encoding
  • Refined the user experience through iterative improvements

This project demonstrates that AI can be more than just a coding assistant - it can be a true development partner that helps bring ideas to life while maintaining high standards for security, performance, and user experience.

Key Achievements

  • 100% AI-Paired Development: Every component built through human-AI collaboration
  • Production-Ready Code: Comprehensive testing, error handling, and documentation
  • Security-First Design: Encryption implementation guided by best practices
  • Modern Architecture: Leveraging cutting-edge web technologies

A collaborative creation
Built through the synergy of human vision and AI capability
Powered by Claude Code + Human Creativity

Visit GhostPaste β€’ Report Bug β€’ Request Feature


GhostPaste
Share code. Keep secrets. Stay ghosted. πŸ‘»

About

Zero-knowledge encrypted code sharing platform. Share code snippets securely with client-side encryption, self-expiring pastes, and one-time views. Built with Next.js and Cloudflare Workers.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages