A modern, real-time clipboard sharing application that lets you instantly share text across devices and with others through shareable rooms. Built with cutting-edge web technologies and deployed on Google Cloud Run.
- Quick Clipboard: Copy, paste, and manage text instantly
- Shared Rooms: Create rooms with unique 6-character invite codes
- Real-time Sync: Changes sync instantly across all connected users
- Easy Sharing: Share via invite codes or direct links
- Modern UI: Clean, responsive interface built with shadcn/ui
- Cloud-Native: Fully Dockerized and optimized for Google Cloud Run
- React 19 - Latest React with modern features
- TanStack Router - Type-safe file-based routing
- TanStack Start - Full-stack React framework with Nitro
- Tailwind CSS 4 - Utility-first styling
- shadcn/ui - High-quality component library
- Lucide Icons - Beautiful icon set
- Convex - Real-time backend with reactive queries
- Real-time subscriptions - Instant updates across all clients
- Serverless database - No infrastructure to manage
- Vite - Lightning-fast build tool
- TypeScript - Type safety throughout
- pnpm - Fast, disk space efficient package manager
- Vitest - Unit testing framework
- ESLint & Prettier - Code quality & formatting
- Docker - Multi-stage optimized builds
- Google Cloud Run - Serverless container deployment
- Nitro - Production-ready server with optimized bundling
- Node.js 20 or later
- pnpm 8 or later
- A Convex account (sign up free)
- Clone the repository:
git clone <your-repo-url>
cd clipboard- Install dependencies:
pnpm install- Set up Convex:
pnpx convex devThis will guide you through creating a Convex project and generate your deployment URL.
- Create a
.env.localfile:
VITE_CONVEX_URL=<your-convex-url>Run both Convex and Vite dev servers concurrently:
pnpm dev:allOr run them separately:
# Terminal 1 - Convex backend
pnpm dev:convex
# Terminal 2 - Vite frontend
pnpm devThe app will be available at http://localhost:3000.
Build the application:
pnpm buildPreview the production build locally:
pnpm previewThe Dockerfile uses a multi-stage build for optimal image size:
docker build \
--build-arg VITE_CONVEX_URL=<your-convex-url> \
-t clipboard-app .docker run -p 3000:3000 clipboard-app- Build and push to Google Container Registry:
# Configure gcloud
gcloud config set project <your-project-id>
# Build and push
gcloud builds submit --tag gcr.io/<your-project-id>/clipboard
# Deploy to Cloud Run
gcloud run deploy clipboard \
--image gcr.io/<your-project-id>/clipboard \
--platform managed \
--region <your-region> \
--allow-unauthenticated \
--set-env-vars VITE_CONVEX_URL=<your-convex-url>- Your app will be live at the URL provided by Cloud Run!
Run the test suite:
pnpm testpnpm lintpnpm formatpnpm checkclipboard/
βββ src/
β βββ routes/ # TanStack Router file-based routes
β β βββ index.tsx # Home page with local clipboard
β β βββ room.$roomId.tsx # Shared room page
β βββ components/ # React components
β β βββ ui/ # shadcn/ui components
β β βββ shadcn-space/ # Custom UI components
β βββ lib/ # Utility functions
β βββ router.tsx # Router configuration
βββ convex/ # Convex backend
β βββ schema.ts # Database schema
β βββ rooms.ts # Room mutations & queries
βββ public/ # Static assets
βββ Dockerfile # Multi-stage Docker build
βββ vite.config.ts # Vite configuration
This project uses TanStack Router with file-based routing. Routes are managed as files in src/routes/.
Create a new file in ./src/routes/ and TanStack Router will automatically generate the route.
- Visit the homepage to use a simple, client-side clipboard
- Copy, paste, and clear text instantly
- No account needed, data stays in your browser
- Create a Room: Click "Create Shared Room" on the homepage
- Get Your Code: Receive a unique 6-character invite code (e.g.,
ABC123) - Share: Send the code or direct link to anyone
- Collaborate: All users in the room see changes in real-time
- Powered by Convex's reactive queries
- Changes sync instantly across all connected clients
- 300ms debounce to prevent excessive updates while typing
- Optimistic UI updates for smooth experience
Create a .env.local file in the project root:
# Convex deployment URL
VITE_CONVEX_URL=https://your-deployment.convex.cloudFor production builds (Docker):
# Build-time variable (baked into the bundle)
VITE_CONVEX_URL=https://your-deployment.convex.cloudrooms: {
inviteCode: string // 6-char uppercase code
content: string // shared clipboard text
createdAt: number // timestamp
}Why Convex?
- Real-time subscriptions out of the box
- Serverless, no infrastructure to manage
- Type-safe queries and mutations
- Automatic caching and reactivity
Why TanStack Router?
- File-based routing for better DX
- Type-safe navigation
- Built-in code splitting
- SEO-friendly with SSR support via TanStack Start
Why Docker + Cloud Run?
- Consistent builds across environments
- Easy horizontal scaling
- Pay-per-use pricing model
- Zero-downtime deployments
- Global CDN integration
Why Nitro?
- Optimized production builds
- Automatic tree-shaking
- Built-in caching layers
- Universal rendering support
- Multi-stage Docker Build: Separates build and runtime dependencies for minimal image size
- Vite Build: Lightning-fast HMR in development, optimized chunks in production
- Debounced Updates: Prevents excessive backend calls while typing
- Tailwind JIT: Only includes CSS classes actually used in the app
- Code Splitting: Automatic route-based code splitting with TanStack Router
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
Built with β€οΈ using modern web technologies