Prerequisites
Before you begin, ensure you have the following installed on your system:Node.js
Version: 18.x or higherDownload Node.js
Package Manager
Options: npm, yarn, pnpm, or bunComes with Node.js (npm)
Git
Version: 2.x or higherDownload Git
Code Editor
Recommended: VS CodeDownload VS Code
Verify Installation
Supabase Account Setup
Create Supabase Project
Sign Up for Supabase
- Go to supabase.com
- Click “Start your project”
- Sign up with GitHub or email
Create New Project
- Click “New Project”
- Choose an organization (or create one)
- Fill in project details:
- Name: ClipSync (or any name)
- Database Password: Generate a strong password
- Region: Choose closest to you
- Click “Create new project”
- Wait for project to finish setting up (~2 minutes)
Set Up Database Tables
Set Up Storage Bucket
Create Bucket
- Click “New bucket”
- Name:
clipboard - Public bucket: Toggle ON (files need to be publicly accessible)
- Click “Create bucket”
In a production environment, you would want to add authentication and restrict these policies to authenticated users only.
Project Setup
Clone Repository
Install Dependencies
- npm
- yarn
- pnpm
- bun
package.json:12-38
Environment Configuration
Reference:
src/config/supabase.js:1-7
Verify Configuration
Running Locally
Development Server
Reference:package.json:7
- npm
- yarn
- pnpm
- bun
Open in Browser
Navigate to http://localhost:5173The app should load with the ClipSync interface.
Hot Module Replacement (HMR) is enabled by default. Changes to your code will instantly reflect in the browser without a full reload.
Development Workflow
Build and Preview
Production Build
Reference:package.json:8
- npm
- yarn
- pnpm
- bun
- Runs type checking (if TypeScript is configured)
- Bundles and minifies all assets
- Optimizes images and fonts
- Generates service worker for PWA
- Outputs production-ready files to
dist/
Build output typically includes:
- HTML, CSS, JS files (minified & hashed)
- Service worker
- PWA manifest
- Static assets (images, fonts, icons)
Preview Production Build
Reference:package.json:10
- npm
- yarn
- pnpm
- bun
dist/.
Lint Code
Reference:package.json:9
- npm
- yarn
eslint.config.js:7-38
Development Tips
VS Code Extensions
ESLint
ID:
dbaeumer.vscode-eslintHighlights linting errors in real-timeTailwind CSS IntelliSense
ID:
bradlc.vscode-tailwindcssAutocomplete for Tailwind classesES7+ React Snippets
ID:
dsznajder.es7-react-js-snippetsReact code snippets and shortcutsPrettier
ID:
esbenp.prettier-vscodeCode formatting on saveBrowser DevTools
- React DevTools
- Network Tab
- Application Tab
Install the React DevTools browser extension to:
- Inspect component tree
- View component props and state
- Profile performance
Testing Realtime Sync
Testing Offline Mode
Reference:
src/App.jsx:40-53
Common Development Issues
Port Already in Use
Port Already in Use
Error:
Port 5173 is already in useSolution:Supabase Connection Failed
Supabase Connection Failed
Error: Network errors when loading the appSolution:
- Verify
.envvariables are correct - Check Supabase project is running (not paused)
- Ensure you’re using the correct API URL (not the reference ID)
- Restart the dev server after changing
.env
Realtime Not Working
Realtime Not Working
Error: Changes don’t sync between tabsSolution:
- Verify Realtime is enabled for the
clipboardtable - Check browser console for WebSocket errors
- Ensure both tabs are using the same session code
- Check Supabase realtime quota (free tier has limits)
File Upload Fails
File Upload Fails
Error: File upload returns 403 or 401Solution:
- Verify storage bucket
clipboardexists - Check bucket policies allow public uploads
- Ensure bucket is set to public
- Update hardcoded storage URL in
src/App.jsx:156
Next Steps
Architecture
Learn about the system architecture
Contributing
Guidelines for contributing to ClipSync
Tech Stack
Deep dive into technologies used