How big-ouden/blog-astro works
Project type and purpose
This is a static-site personal blog built on Astro. Markdown files under src/blog/* provide content, Astro (.astro) components and layouts render that content at build time, and the resulting static files are served via Nginx inside a Docker container. CI/CD (GitHub Actions) automates build and deployment.
Main components
• Source code repository (GitHub)
• CI/CD pipeline (GitHub Actions workflow)
• Build environment (Node.js, NPM, Astro, TypeScript, ESLint)
• Content layer (Markdown posts, images, localization in src/blog and src/i18n)
• Component layer (Astro, UI components, layouts in src/components and src/layouts)
• Output artifacts (static files in ./dist)
• Containerization (Dockerfile, docker-compose.yaml)
• Web server (Nginx with nginx.conf)
• Deployment orchestration (redeploy.sh, Traefik labels via docker-compose)
• End user (web browser)
Component relationships & flow
1. Developer pushes code to GitHub.
2. GitHub Actions trigger on main branch, install dependencies (npm install), lint, run npm run build.
3. Astro reads Markdown + .astro templates, generates static HTML/CSS/JS in ./dist.
4. CI job builds a Docker image: base = node (build stage) → copy dist → Nginx stage.
5. Docker image is tagged and published to the deployment host (or registry).
6. redeploy.sh (or docker-compose up) pulls the new image, starts container behind Traefik.
7. Nginx serves static files to the end user’s browser over HTTP(S).
Architectural patterns & design principles
• Static site generation (SSG) for speed, SEO, and simplicity.
• “Infrastructure as code” for deployment (Docker, docker-compose).
• CI/CD pipeline ensures consistency & repeatability.
• Single Responsibility: Markdown only for content, components/layouts only for UI.
• Localization (i18n folder, subfolders in src/pages and src/blog/posts).
Technologies, frameworks, key libraries
• Astro (static site generator)
• Node.js & NPM (build environment)
• TypeScript (type safety & config via tsconfig.json)
• ESLint (code quality)
• Docker & Docker-Compose (containerization)
• Nginx (static file server)
• GitHub Actions (CI/CD)
• Traefik or your reverse proxy (labels in docker-compose)