Skip to main content

Installation Guide

This guide will help you set up ClipSync locally for development. The project uses Bun as the JavaScript runtime and package manager.

Prerequisites

1

Install Bun

ClipSync requires Bun to be installed on your system.
Verify the installation:
2

Set up Supabase

ClipSync uses Supabase for backend services. You’ll need:
  1. A Supabase account (free tier works fine)
  2. A new Supabase project
  3. Your project’s URL and anon key
Get your credentials from your Supabase project dashboard under Settings > API.

Clone the Repository

1

Clone the repo

Replace <repository-url> with the actual repository URL.

Environment Configuration

1

Create environment file

Create a .env file in the client directory:
2

Add environment variables

Add the following variables to your .env file:
.env
Never commit your .env file to version control. It’s already included in .gitignore.
Example:

Database Setup

1

Create database tables

In your Supabase project, create the following tables:Sessions table:
Clipboard table:
Counter table (for visitor tracking):
2

Set up Storage bucket

Create a storage bucket named clipboard in your Supabase Storage:
  1. Go to Storage in your Supabase dashboard
  2. Click New bucket
  3. Name it clipboard
  4. Set it to Public for file access
  5. Configure bucket policies for public read access
3

Enable Realtime

Enable real-time for the clipboard table:
  1. Go to Database > Replication
  2. Enable replication for the clipboard table
Real-time subscriptions are used to sync clipboard content across devices instantly.

Install Dependencies

1

Install packages

Install all required dependencies:
This will install:
  • React 19 and React DOM
  • Supabase client library
  • TanStack Query for data fetching
  • Lucide React for icons
  • Tailwind CSS for styling
  • Vite PWA plugin for Progressive Web App features
  • And other dependencies listed in package.json

Run Development Server

1

Start the dev server

The application will be available at http://localhost:5173 (default Vite port).
2

Verify installation

Open your browser and navigate to http://localhost:5173. You should see:
  • The ClipSync interface
  • Session code input field
  • Clipboard textarea
  • File upload buttons
Try creating a session and syncing content to ensure everything is working correctly.

Project Structure

The ClipSync client follows this structure:

Configuration Files

Vite Configuration

The vite.config.js configures the PWA manifest:
vite.config.js

Supabase Client

The Supabase client is configured in src/config/supabase.js:
src/config/supabase.js

Development Scripts

Available scripts in package.json:

Troubleshooting

  • Ensure your .env file is in the client root directory
  • Restart the development server after adding environment variables
  • Verify variables are prefixed with VITE_
  • Verify your Supabase URL and anon key are correct
  • Check that your Supabase project is active
  • Ensure your IP is not blocked by Supabase
  • Verify real-time is enabled for the clipboard table
  • Check browser console for WebSocket connection errors
  • Ensure you’re using the correct session code
  • Confirm the clipboard storage bucket exists and is public
  • Check file size is under 10MB
  • Verify storage bucket policies allow uploads

Next Steps

Quick Start

Learn how to use ClipSync

GitHub Repository

View the source code
For production deployment, consider using platforms like Cloudflare Pages, Vercel, or Netlify that support Vite applications.