--- title: Clip emoji: πŸ‘€ colorFrom: indigo colorTo: purple sdk: docker pinned: false --- # MyClipboard.online

MyClipboard.online Logo

A real-time shared clipboard application that allows users to easily share text snippets and files across devices. **Live Demo**: [https://myclipboard.online](https://myclipboard.online) ## πŸš€ Features - **Real-time Synchronization**: All clipboard entries are instantly synced across all connected devices - **Room-based Sharing**: Create or join rooms with simple 4-character codes - **Password Protection**: Optionally secure your clipboard rooms with passwords - **File Sharing**: Upload and share files up to 10MB in size - **Expiration**: Clipboards automatically expire after 24 hours of inactivity - **User-friendly Interface**: Clean, responsive design that works on all devices - **No Registration Required**: Start sharing instantly without creating an account ## πŸš€ Installation Currently only docker is supported. - Clone the repository ```bash git clone git@github.com:bilodev7/myclipboard.online.git cd myclipboard.online ``` - Start Development Server ```bash docker compose up ``` - Start Production Server ```bash docker compose -f docker-compose.prod.yml up ``` ## πŸš€ Deploying to Hugging Face Spaces The repository includes a `Dockerfile` tailored for the **Container** runtime in Hugging Face Spaces. It builds both the Next.js frontend and the NestJS backend, bundles an internal Redis instance, and uses Nginx to proxy Socket.IO traffic on the public port. 1. Create a new **Container Space** and select this repository as the source. 2. No custom `run` command is requiredβ€”the Space will execute `deploy/hf/start.sh` defined in the Dockerfile. 3. Optional environment variables (set them in **Settings β†’ Variables and secrets** in your Space): - `ADMIN_TOKEN` β€” token for the admin dashboard (defaults to `admin-token`). - `PUBLIC_SOCKET_URL` β€” override the default of using the current origin for WebSocket connections. - `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD`, or `REDIS_URL` β€” point the app at an external Redis instance. When these are set, the Space skips starting the in-container Redis and will wait for the provided endpoint to be ready before launching the app. - Example external Redis configuration (Zeabur): ``` REDIS_HOST= REDIS_PORT= REDIS_PASSWORD= ADMIN_TOKEN= ``` 4. Files uploaded through the app are stored inside the Space container; if the Space restarts, uploads are cleared. For persistence, mount external storage. ## πŸ› οΈ Admin management An admin surface is available to inspect and manage clipboards. - **Authentication**: backend admin routes require the `ADMIN_TOKEN` environment variable (defaults to `admin-token` if unset). Supply the token via the `x-admin-token` header or a `Bearer` token. - **API endpoints**: - `GET /admin/clipboards` β€” list clipboards with entry/file counts, password flag, and TTL. - `GET /admin/clipboards/:roomCode` β€” fetch clipboard details including files and TTL. - `POST /admin/clipboards/:roomCode/password` β€” set or clear a room password with `{ "password": "new" }` or `{ "password": null }`. - `POST /admin/clipboards/:roomCode/ttl` β€” set or clear expiration in seconds with `{ "ttl": 3600 }` or `{ "ttl": null }`. - `DELETE /admin/clipboards/:roomCode` β€” delete a clipboard and its files. - **Admin UI**: visit `/admin` in the frontend, enter the admin token once, then browse clipboards and perform updates from the dashboard and detail pages.