How bmorrisondev/quillmate works
Project Type and Purpose
• Full-stack web application
• Purpose: Collaborative writing with real-time updates, organization support, secure authentication.
File Structure
• Frontend:
– src/app/… (Next.js 15 App Router with public, auth, and protected routes)
– src/components/… (UI components)
– src/hooks & src/lib (client-side utilities, Supabase provider, custom hooks)
• Backend Services:
– Supabase (hosted PostgreSQL with RLS)
– Supabase Edge Functions (supabase/functions) for Clerk webhooks and any custom serverless logic
• Config & Deployment:
– next.config.mjs, tailwind.config.ts, tsconfig.json
– supabase/config.toml, migrations under supabase/migrations/
Key Architecture Insights from README
• Next.js 15 (App Router) powers both server-rendered and client-side UI.
• Clerk provides user/org authentication, integrated into Supabase.
• Supabase handles data storage, real-time subscriptions, and edge functions.
Main Components & Interactions
a. Client (Browser)
– Next.js React app (routing via src/app)
– UI components (src/components/ui) & Editor
– Clerk JS SDK for sign-in/up
– Supabase JS client for queries & real-time channels
b. Next.js Server
– SSR/SSG on protected routes
– Middleware (src/middleware.ts) to gate access based on Clerk session
– API proxies (if any) to Supabase or Edge Functions
c. Authentication Service
– Clerk (external) for sign-in/up, JWT issuance, org management
– Webhook listener in Supabase Edge Function for user/org sync
d. Data Layer
– Supabase PostgreSQL with RLS (tables created via migrations)
– Supabase Realtime (broadcasts live updates to clients)
– Edge Functions (supabase/functions) for custom endpoints (e.g., clerk-webhooks)
Architectural Patterns & Design Principles
• Separation of concerns:
– Presentation (Next.js + React)
– Auth (Clerk)
– Data (Supabase DB & Realtime)
– Business logic (Edge Functions)
• Real-time collaboration: Supabase subscriptions
• Middleware for auth enforcement (Next.js middleware)