A real-time bookmark manager built with Next.js and Supabase.
This project allows users to securely save and manage their personal bookmarks using Google login, with real-time syncing across tabs and devices.
- Google OAuth authentication (no email/password)
- Private bookmarks per user
- Add and delete bookmarks
- Real-time sync across multiple tabs
- Row Level Security (RLS) enabled
- Clean modern UI
- Deployed on Vercel
- Next.js (App Router)
- Supabase (Auth, Database, Realtime)
- Tailwind CSS
- Vercel (Deployment)
https://smart-bookmark-six-peach.vercel.app
https://github.com/rehmnjr/smart-bookmark
At first, I kept getting 404 errors while inserting bookmarks. The issue was caused by a mismatch between the table name in Supabase and the one used in the frontend.
I solved it by:
- Double-checking the exact table name
- Ensuring the table exists in the public schema
- Rewriting the Supabase queries from scratch
Even after setting environment variables, Supabase was throwing API key errors.
Root cause:
- Incorrect environment variable naming and caching issues.
Fix:
- Used NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY correctly
- Restarted the dev server
- Replaced all Supabase client code to avoid stale config
Initially, bookmarks weren’t inserting due to RLS blocking access.
What helped:
- Understanding how auth.uid() works
- Creating separate policies for SELECT, INSERT, DELETE
- Matching user_id with auth.uid()
This was a big learning moment about real-world database security.
Setting up Google login was harder than expected.
Problems faced:
- Google Cloud requiring 2FA
- OAuth consent screen confusion
- Redirect URL mismatch between localhost and production
Fix:
- Added both localhost and Vercel domains in Google OAuth settings
- Updated Supabase Auth redirect URLs
- Verified callback URLs carefully
At one point, the UI looked completely broken even though Tailwind was installed.
Issue:
- Incorrect layout setup in Next.js App Router
Fix:
- Rebuilt layout.js properly
- Ensured globals.css was imported correctly
- Verified Tailwind config
Realtime updates initially didn’t work across tabs.
Reason:
- Realtime not enabled on the table in Supabase
Solution:
- Enabled realtime in Supabase dashboard
- Subscribed to postgres_changes channel correctly
- Refetched data on INSERT and DELETE events
This made bookmarks sync instantly across tabs.
During deployment, I hit prerender errors like: "default export is not a React Component"
Fix:
- Removed unused routes
- Cleaned folder structure
- Ensured App Router conventions were followed
Login worked locally but failed on Vercel.
Cause:
- Missing production redirect URLs in Supabase and Google Cloud
Fix:
-
Added Vercel domain to:
- Supabase redirect URLs
- Google OAuth authorized origins
After this, authentication worked perfectly in production.
This project taught me a lot about:
- Real-world authentication flows
- Database security using RLS
- Environment variables across environments
- Debugging deployment issues
- Realtime systems with Supabase
- Production-ready Next.js apps
It was a great hands-on experience building and deploying a full-stack real-time app from scratch.
If I continue this project, I would add:
- Edit bookmarks
- Dark mode
- Bookmark categories/tags
- Link previews
- Analytics dashboard
Fahim Rehman https://github.com/rehmnjr