How kelvince01/quillert works
Project Type and Purpose
• This is a full-stack, content-driven web application built with Next.js (App Router) and TypeScript.
• It serves as a blog/CMS with public pages (posts, categories, tags), account management (login, registration), an admin dashboard (CRUD on posts, categories, tags, comments), file uploads, and dynamic OG image generation.
• Data is stored in a Supabase (PostgreSQL) backend; file uploads use UploadThing; user auth integrates with Supabase and GitHub OAuth.
Core Directory Analysis
• src/app: Next.js routing hierarchy
• /(main): public-facing pages and posts
• /accounts: login & register flows
• /admin: protected dashboard for content management
• /api: serverless endpoints (increment-view, og image, uploadthing)
• components: UI building blocks organized by feature (admin, posts, comments, UI primitives)
• lib, utils, hooks: shared logic (auth helpers, Supabase client, utilities)
• supabase/: local Supabase config and seed scripts
• worker/: background task runner (e.g., scheduled jobs)
• config, constants, styles: site configuration, CSS (Tailwind + PostCSS)
• next.config.js, tailwind.config.ts, tsconfig.json: build tooling and lint/prettier configs
Main System Components
A. Client (Browser)
• React pages (App Router)
• Static assets from /public
B. Next.js Server
• SSR/SSG rendering on Vercel (or Node)
• API Routes:
• /api/increment-view → updates post view count
• /api/og → dynamic OG image generation
• /api/uploadthing → file upload handling
• Middleware for auth, routing, redirects
C. Supabase Backend
• PostgreSQL database (tables: posts, categories, tags, comments, users)
• Auth service (JWT sessions, OAuth with GitHub)
• Storage (optional for file assets)
• Edge functions or triggers (optional)
D. External Services
• GitHub OAuth provider
• UploadThing (hosted file storage or S3)
• Vercel CDN / Edge network
E. Worker Process
• worker/index.ts → background tasks (e.g., batch processing, scheduled jobs)
Relationships and Data Flows
• Client → Next.js Server: page requests, form submissions, API calls
• Next.js Server → Supabase:
• Queries for public pages (posts, authors, categories)
• Mutations for admin actions (create/update/delete)
• Auth flows (session management)
• Next.js Server → External OAuth: user login redirects and callbacks
• Next.js API Routes → UploadThing service for file storage
• Supabase Triggers → Worker or edge functions (if configured)
Architectural Patterns and Principles
• Feature-folder structure: groups code by domain (accounts, admin, posts)
• Component-driven UI: reusable primitives in components/ui
• Serverless functions for micro-endpoints (increment-view, og, uploadthing)
• Separation of concerns: UI vs data layer (lib/supabase, utils)
• SSR/SSG where appropriate (Public pages), CSR for admin modals/forms