How queue-ri/til works
Project Type and Purpose
• This is a JAMstack-style static documentation site (“Today I Learned”) built with Docusaurus (React/Node.js SSG).
• Purpose: Collate and render markdown/MDX notes (docs/, md/, dev-note/) into a static website deployed via CI/CD pipelines to Cloudflare Pages (and Netlify preview).
• No custom backend or database—content is rendered at build time; runtime is purely client-side.
File Structure & Architectural Insights
• Top-Level
• docusaurus.config.js, sidebars.js, package.json → site configuration, theming, plugins (Algolia, MDX Crypto).
• docs/, md/, dev-note/ → three content sources (primary docs, dated journals, developer notes).
• src/ → React components and theme overrides (components/, pages/, theme/CodeBlock, theme/DocItem, theme/DocSidebar).
• static/ → static assets (images, manifest).
• prism-custom/ → custom syntax-highlight themes.
• .github/workflows/ → CI/CD definitions (build, preview, update).
• algolia-config.json → search indexing setup.
Key Components
a. Developer Environment
– Local machine: git, Node.js, npm/yarn, Docusaurus CLI
b. Source Repository & CI/CD
– GitHub repo → triggers GitHub Actions workflows (node-js.yml for build/test, pr-deploy-preview.yml for pre-release previews, update-md-and-index.yml for search indexing).
c. Static Site Generator
– Docusaurus (React + MDX + Babel + SCSS) processes content and theme customizations into static HTML/CSS/JS.
– MDX Crypto Plugin: encrypts/decrypts sections of MDX at build time.
d. Hosting & Delivery
– Cloudflare Pages (primary host) with CDN layer. Netlify badge indicates preview usage.
– static assets and JS served from CDN edge.
e. External Services
– Algolia (DocSearch) for client-side full-text search.
– (Optional) any analytics or third-party scripts integrated via Docusaurus config.
Relationships & Data Flows
• Code Commit → GitHub → GitHub Actions
• Actions build site (Docusaurus SSG) → artifact (static bundle) → deploy to Cloudflare Pages → CDN propagation
• End-User HTTP(S) Request → CDN Edge → static site (HTML/CSS/JS) → client-side React hydration
• In-browser search UI → Algolia API queries → search results back to user
Architectural Patterns & Principles
• JAMstack: Pre-render all pages at build time, serve via CDN, client-side enhancements only where needed.
• Component-Based UI: src/components + theme overrides following React best practices.
• Plugin/Extension Points: MDX plugins, custom CodeBlock buttons, search bar component, theming layers.
• CI/CD as Code: .github/workflows define build/test/deploy.