Overview
This guide covers everything you need to self-host the Bookmarks application, including local development setup, environment configuration, and Supabase backend deployment.The application requires Node.js 16+ and a Supabase account (free tier available).
Prerequisites
Before you begin, ensure you have:- Node.js 16.x or higher (download)
- npm or yarn package manager
- Git for version control
- Supabase account (sign up free)
Quick Start
Install Dependencies
Install all required packages using npm or yarn:
Key Dependencies
The application uses these core libraries:package.json:12-24
- @supabase/supabase-js: Supabase client for authentication and database
- cmdk: Command menu component for fast search
- zustand: Lightweight state management
- sonner: Toast notifications
- iconoir-react: Icon library
Configure Supabase
Create a Supabase Project
- Go to supabase.com and sign in
- Click New Project
- Enter project details and create
- Wait for the database to provision (2-3 minutes)
Get Your Credentials
From your Supabase project dashboard:- Go to Settings > API
- Copy the Project URL
- Copy the anon public key
Create the Database Schema
Navigate to SQL Editor and run:Configure Authentication Providers
Enable Magic Link (Email)
- Go to Authentication > Providers
- Enable Email provider
- Configure email templates (optional)
Enable GitHub OAuth
- Create a GitHub OAuth App:
- Go to GitHub Settings > Developer settings > OAuth Apps
- Click New OAuth App
- Set Authorization callback URL to:
https://<your-project-ref>.supabase.co/auth/v1/callback
- Copy the Client ID and Client Secret
- In Supabase, go to Authentication > Providers > GitHub
- Enable GitHub and paste your credentials
Environment Variables
Create a Add your Supabase credentials:The application uses these variables to initialize the Supabase client:
.env file in the project root:.env
supabase.ts:1-8
Start Development Server
Run the development server with Vite:The application will start at
http://localhost:5173Available Scripts
package.json:6-10
npm run dev- Start development server with hot reloadnpm run build- Build for production (includes TypeScript check)npm run lint- Run ESLint for code qualitynpm run preview- Preview production build locally
Production Deployment
Build for Production
Create an optimized production build:- Runs TypeScript compiler to check types
- Builds optimized bundles with Vite
- Outputs to the
dist/directory
Deploy to Vercel
Deploy to Netlify
- Connect your GitHub repository
- Set build command:
npm run build - Set publish directory:
dist - Add environment variables in site settings
Project Structure
Configuration Files
Vite Configuration
vite.config.ts:1-9
TypeScript Configuration
The project uses strict TypeScript settings for type safety:- Strict mode enabled
- No implicit any
- Strict null checks
- ES2020 target with ESNext module resolution
State Management
The application uses Zustand for efficient state management:Bookmark Store
Manages all bookmark CRUD operations:BookmarkStore.ts:24-44
Auth Store
Handles authentication state and Supabase auth methods.Modal Store
Tracks which modals are open for proper UI layering.Troubleshooting
Common Issues
Build fails with TypeScript errors
Build fails with TypeScript errors
Run
npm run lint to identify type errors. Make sure all components are properly typed.Supabase connection fails
Supabase connection fails
Verify your
.env file has the correct VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY. Restart the dev server after changing environment variables.Authentication not working
Authentication not working
Check that:
- Email provider is enabled in Supabase
- GitHub OAuth is properly configured with correct callback URLs
- RLS policies are created on the bookmarks table
Metadata not fetching for URLs
Metadata not fetching for URLs
Some websites block metadata scraping. This is expected behavior - the bookmark will save with minimal information (just the URL and domain).
Development Tips
The application uses Tailwind CSS with a custom design system. All colors, spacing, and typography follow the zinc color palette for consistent dark mode theming.
Next Steps
Quick Start Guide
Learn how to use the application features
GitHub Repository
Star the project and contribute