A private, real-time bookmark manager built with Next.js and Supabase.
- Framework: Next.js 15 (App Router)
- Auth & DB: Supabase (PostgreSQL + RLS)
- Styling: Tailwind CSS + Radix UI
- Realtime: Supabase Realtime
- Clone & Install
git clone https://github.com/ChrisDc777/getmarkd.git cd getmarkd npm install - Setup Supabase
- Create a project at supabase.com.
- Run the SQL in
supabase/schema.sql. - Enable Google OAuth in Authentication settings.
- Configure Environment
- Create a
.env.localfile:NEXT_PUBLIC_SUPABASE_URL=your_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
- Create a
- Run Dev
npm run dev
- Problem: Users were getting logged out unexpectedly in Server Components.
- Solution: Switched from
getSession()togetUser()in server-side logic to ensure the session is always validated against the Supabase Auth server.
- Problem: Optimistic updates and Realtime events caused bookmarks to appear twice.
- Solution: Added logic to the Realtime listener to skip incoming rows that matched existing optimistic IDs, ensuring a smooth single-item display.
- Problem: Protecting dashboard routes while maintaining performance.
- Solution: Implemented a lightweight
middleware.tsusing@supabase/ssrto handle session refreshes and redirects before the request reaches the server components.