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
2
Set up Supabase
ClipSync uses Supabase for backend services. You’ll need:
- A Supabase account (free tier works fine)
- A new Supabase project
- 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 Example:
.env file:.env
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:- Go to Storage in your Supabase dashboard
- Click New bucket
- Name it
clipboard - Set it to Public for file access
- Configure bucket policies for public read access
3
Enable Realtime
Enable real-time for the clipboard table:
- Go to Database > Replication
- Enable replication for the
clipboardtable
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
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
Project Structure
The ClipSync client follows this structure:Configuration Files
Vite Configuration
Thevite.config.js configures the PWA manifest:
vite.config.js
Supabase Client
The Supabase client is configured insrc/config/supabase.js:
src/config/supabase.js
Development Scripts
Available scripts inpackage.json:
Troubleshooting
Environment variables not loading
Environment variables not loading
- Ensure your
.envfile is in the client root directory - Restart the development server after adding environment variables
- Verify variables are prefixed with
VITE_
Supabase connection errors
Supabase connection errors
- Verify your Supabase URL and anon key are correct
- Check that your Supabase project is active
- Ensure your IP is not blocked by Supabase
Real-time not working
Real-time not working
- Verify real-time is enabled for the clipboard table
- Check browser console for WebSocket connection errors
- Ensure you’re using the correct session code
File upload failing
File upload failing
- Confirm the
clipboardstorage 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.