How willismax/my-site works
Project type and purpose
• This is a static website built with Docusaurus 2. It’s not a full-stack app with a dynamic backend; rather, it’s a static site generator that transforms Markdown/MDX content (blog posts, docs, pages) plus React components into plain HTML/CSS/JS and deploys it, typically to GitHub Pages.
File structure
• Top-level files:
• package.json, yarn.lock, babel.config.js – define Node.js-based dev/build environment
• docusaurus.config.js, sidebars.js – configure site metadata, navigation, theme
• .github/workflows/deploy.yml – CI/CD pipeline
• Content directories:
• /blog and /docs – Markdown/MDX source for blog posts and documentation
• /src/pages, /src/components – custom React pages and reusable UI parts
• /static – static assets (images, robots.txt, etc.) served as-is
• Output:
• build (generated after yarn build) – static HTML/CSS/JS ready for hosting
README for insights
• Key commands:
• yarn start → launches a local development server with hot reload
• yarn build → compiles everything into the build folder
• yarn deploy → runs build and pushes build output to gh-pages branch via SSH/GitHub Pages
Main components & interactions
a. Developer environment
• Local machine running Node.js
• Code editor saving Markdown/MDX and React JSX in /blog, /docs, /src
• yarn start → local dev server (Webpack + Docusaurus) serves live preview
b. Version control & CI/CD
• GitHub repo stores all source files + config
• Push to main branch triggers GitHub Actions (deploy.yml)
c. Build process
• Actions runner checks out code → installs deps (yarn) → runs yarn build
• Docusaurus parses content directories, applies React components, plugins, theme → outputs build/
d. Hosting
• build/ assets are published to gh-pages branch → served by GitHub Pages at CNAME domain
Architectural patterns & design principles
• Single‐page‐app shell blended with statically generated routes
• Separation of concerns:
• Content (Markdown)
• Presentation (React components + CSS modules)
• Configuration (docusaurus.config.js, sidebars.js)
• CI/CD-as-code: GitHub Actions fully automates build & deploy
How
• Contains: /blog, /docs, /src, config files, package.json, .github/workflows
• Trigger: commit to main
• Steps: checkout → yarn install → yarn build → yarn deploy
• Outputs → build artifacts into gh-pages branch
• Serves static content from gh-pages
• HTTP GET → GitHub Pages → HTML/CSS/JS
• Dev → GitHub repo (commit/push)
• Repo → GitHub Actions (webhook trigger)
• Actions → Docusaurus Build → build/
• Actions → Deploy → gh-pages
• Browser ← GitHub Pages
Be detailed but concise
• Architectural element: source files, build config, build output, CI pipeline, hosting layer.
• Interactions and data transformations (Markdown/MDX + React → static HTML/CSS/JS).
• Don’t over-segment: grouping by logical role (content, build, deploy, serve) is sufficient.