How churnobyl/churnobyl-blog works
Project type and purpose
• This is a Gatsby-based, TypeScript-powered static site (SSG) that sources content from local MDX files and Supabase. It generates blogs, book summaries, category/tag pages, etc., into a React frontend, and is deployed to Netlify.
File structure
• Top-level configs: gatsby-config.ts, gatsby-node.ts, netlify.toml, package.json, tsconfig.json, tailwind/PostCSS config
• src/gatsby & src/createPages.ts: build-time logic that reads MDX and Supabase data, creates nodes and pages
• src/mdx: custom MDX handlers, components, and parser—local content source
• src/api: runtime/client wrappers around Supabase for dynamic interactions (comments, likes)
• src/components & src/templates & src/pages: React UI (atomic components, layouts, pages, templates)
• src/hooks, src/theme, src/styles: cross-cutting concerns (hooks, theming, CSS)
• supabase/config.toml: local Supabase project config
README insights
• Intended for Netlify one-click deployment
a. Main components
• Content Sources (Local MDX folder + Supabase Database)
• Build Pipeline (Gatsby Core + Node APIs + MDX Generator + GraphQL layer + src/gatsby scripts)
• Static Site Output (pre-rendered HTML/CSS/JS)
• Client-side App (React components in browser + runtime API calls)
• External Service (Supabase)
• Hosting & CDN (Netlify)
b. Relationships & interactions
• Build time:
• Gatsby Core reads MDX files via mdxGenerator.ts → creates Gatsby nodes
• src/gatsby/*.ts functions read nodes & Supabase via getSupabase.ts → build GraphQL schema → create pages with templates
• Output: static assets (HTML, CSS, JS) written to “public” for Netlify
• Runtime (client in browser):
• React components rendered on page load
• src/api/interact.ts & getSupabase.ts make API calls to Supabase for comments, likes, real-time data
• Deployment & delivery:
• Netlify picks up “public” folder, deploys to CDN
• Users request pages; CDN serves static files
c. Architectural patterns & design principles
• Static-Site Generation with Gatsby (SSG)
• Component-driven UI (atomic React components + templates)
• Headless CMS approach: local MDX + Supabase as data sources
• Separation of concerns: build-time vs runtime code in distinct folders (src/gatsby vs src/api)
• Type safety with TypeScript interfaces/types
d. Key technologies/frameworks
• Gatsby (SSG + GraphQL)
• React + TypeScript
• MDX processing (custom mdxGenerator, MDX components)
• Supabase (Postgres + auth)
• Tailwind/PostCSS for styling
• Netlify for hosting