How fxpby/myblog works
Project type and purpose
• This is a JAMstack‐style static documentation and blog website built with Docusaurus.
• Purpose: serve docs (in /docs), blog posts (in /blog), custom React pages (in /src/pages), and custom interactive widgets (in /src/components) as a static site.
File structure
• Top‐level config: docusaurus.config.ts, sidebars.ts, package.json, tsconfig.json.
• Content directories:
• /docs – Markdown/MDX docs organized by category (coding, dishes, etc.).
• /blog – MDX posts plus authors.yml and tags.yml for metadata.
• /src/components – React components (DrawGift, FoodsCalories, WorkoutCycleCalc, HomepageFeatures, PostBlogs) used on custom pages.
• /src/pages – custom pages (index.tsx, markdown‐page.md).
• /static – images and static assets.
• CI/CD: .github/workflows/ci.yml (lint/build/test), host.yml (deploy to gh-pages).
• Build scripts: yarn start, yarn build, yarn deploy.
README for additional insights
• Confirms Docusaurus static site generator.
• Local dev uses a live‐reload dev server.
• Build outputs to /build; deploys via GitHub Pages.
• No runtime server or database; purely static hosting.
Main components and interactions
a. Components
• Developer Workstation (IDE, Git)
• GitHub Repository (code + content)
• CI/CD Pipeline (GitHub Actions)
• Docusaurus Build Process (Node.js + Yarn)
• Build Artifacts (/build directory)
• Static Hosting (GitHub Pages or CDN)
• End‐User Browser
b. Relationships & Data Flow
1. Developer pushes code/content → GitHub repo.
2. GitHub Actions CI (ci.yml) triggers: install, lint, test, build.
3. On success, host.yml deploys /build artifacts → gh-pages branch → GitHub Pages.
4. End‐User’s browser requests pages → served by GitHub Pages/CDN → loads static HTML/CSS/JS and assets from /static.
5. Components loaded in browser: React code from /src/components renders interactive widgets.
c. Architectural patterns & principles
• JAMstack: Pre‐build at deploy, serve static assets via CDN.
• File‐based routing (Docusaurus reads /docs and /blog).
• Component‐based UI (React in /src/components).
• CI/CD automation for build & deploy.
d. Key technologies/frameworks
• Docusaurus (static site generator)
• React & JSX/TSX components
• Markdown/MDX
• Node.js & Yarn/npm
• GitHub Actions (CI/CD)
• GitHub Pages (static hosting)