How green-software-foundation/learn works
Project type and purpose
• This is a static documentation website built with Docusaurus (a React-based static site generator).
• Purpose: Serve the “Green Software Training” course content, with multi-language support, custom React components, and CI/CD deployment to a static host.
File structure
• Top-level:
• docs/ – Markdown content (training modules)
• i18n/ – Translation files for each locale
• src/ – React-based UI components and CSS for custom features (HomepageFeatures, Quiz, TeamMember) and theme overrides under src/theme
• static/ – Static assets: images, CNAME for custom domain
• docusaurus.config.js, sidebars.js, babel.config.js, tsconfig.json – site configuration, routing/sidebars, build tooling
• .github/workflows/deploy-main.yml – CI/CD pipeline for building & deploying on main branch
• package.json, yarn.lock – dependencies and scripts
README for additional insights
• Confirms use of Docusaurus for SSG, Node.js and Yarn in local dev.
• Local workflow: yarn install → yarn run docusaurus start → live preview.
• Production build: yarn run docusaurus build → static output → deployed via GitHub Actions.
Main components
a. Content sources
• Markdown docs (docs/)
• Translations (i18n/)
b. Custom UI layer
• React components (src/components/)
• Theme overrides (src/theme/)
c. Configuration layer
• docusaurus.config.js (site metadata, plugins)
• sidebars.js (navigation)
• babel.config.js, tsconfig.json (build tooling)
d. Build system
• Docusaurus CLI & Webpack (bundles React + Markdown into static HTML/CSS/JS)
e. CI/CD pipeline
• GitHub Actions workflow (deploy-main.yml)
• Steps: checkout → yarn install → build → deploy
f. Hosting
• Static site hosting (GitHub Pages or other CDN)
• CNAME file for custom domain
g. End users
• Web browsers requesting pages/assets
Relationships & data flow
• Local dev: edits docs, i18n, React components → Docusaurus start → local server → browser.
• On push to main:
1) GitHub Actions triggers on main branch
2) Checkout code, install dependencies
3) Run docusaurus build → produce static assets in build/
4) Deploy to static host (e.g., GitHub Pages)
• End users’ browsers fetch static assets via CDN/domain
Architectural patterns/design principles
• Jamstack (pre-rendered static assets, CDN distribution)
• Component-based UI (React)
• Markdown-driven content with plugin integration (Docusaurus)
• i18n pipeline (directory per locale, plugin)
Detail
• Docusaurus plugins and config files under “Configuration Layer.”
• Call out the custom React components under “Presentation Layer.”
• GitHub Actions workflow file under “CI/CD.”