How jmustiola/share-it-blog works
Project type and purpose
• This is a static, content-driven blog built with the Astro framework. It pulls Markdown and YAML content (articles, authors, tags, resources) at build time, applies layout and component templates, and produces a purely static site.
• It includes a CI/CD pipeline (GitHub Actions) to build a Docker image and publish it, and uses Nginx (inside the Docker container) to serve the generated static files.
File structure
• Top-level:
• Dockerfile & .dockerignore → container build
• .github/workflows/docker-publish.yml → CI/CD pipeline
• .nginx/nginx.conf → production web server config
• astro.config.mjs, package.json, pnpm-lock.yaml, tsconfig.json → build tool and language configuration
• src/
• content/ (articles, authors, catalogs) → data sources (Markdown/YAML)
• layouts/ (Layout.astro) → page shells
• components/ (.astro, JSX, CSS) → UI building blocks
• pages/ (.astro + dynamic routes) → URL-to-page mapping
• public/ → static files copied verbatim (images, favicon)
README for additional insights
• Confirms key features (articles, tags, search, contributors), local dev commands, and project structure overview.
• Mentions deployment via npm run build → dist/ folder, served on localhost:4321 in dev.
Main components in the system design
a. Content Sources
– Markdown files (src/content/articles), YAML catalogs (src/content/catalogs), author metadata (src/content/authors).
b. Presentation Layer
– Astro pages (src/pages), layouts (src/layouts/Layout.astro), and UI components (src/components).
c. Build System
– Astro CLI + Node.js (driven by astro.config.mjs, package.json scripts, pnpm).
d. Static Assets
– public/, src/assets, src/styles.
e. CI/CD Pipeline
– GitHub Actions workflow (.github/workflows/docker-publish.yml) that builds a Docker image (Dockerfile) and pushes it to a registry.
f. Runtime / Hosting
– Docker container running Nginx (.nginx/nginx.conf), serving the dist/ directory produced by npm run build.
Relationships and interactions
• Developer → push to GitHub → triggers GitHub Actions
• GitHub Actions → run build (npm run build) → generate dist/
• Build step → Dockerfile builds an image with static files + Nginx config
• CI → pushes Docker image to registry
• Hosting → container pulls image, Nginx serves static site
• At runtime → client browsers request HTML/CSS/JS via Nginx; no dynamic backend calls
Architectural patterns & principles
• Static Site Generation (SSG)
• Component-based UI (Astro-based .astro and React/JSX components)
• Content-as-data (Markdown/YAML pipelines)
• Twelve-factor app style containerization for deployment