How thanhlv-com/thanhlv-blog works
This project is a personal blog repository where the author shares insights, studies, and technical knowledge. The repository is structured as a monorepo managed by pnpm and contains at least two main packages:
• The “apps” package – which holds the blog’s content, deployment configurations, and tooling. This package includes the source for blog posts (organized under src/blog, src/short-blog, src/study, etc.), public assets (found in src/public), scripts for processing or generating content, and configuration files for both Vuepress and Vitepress.
Main Components
• Repository (monorepo) with two primary modules:
○ Blog Application (packages/apps)
§ Content Source: Contains markdown files for blog posts, short blogs, study notes, public pages, and assets.
§ Build & Scripts: Makefile, deployment scripts, Docker Compose configuration, and various Node.js scripts for content management.
○ Theme Library (packages/libs/theme)
§ Core Vue/Vitepress Components: UI components, styles, and theme configuration used by the blog application.
• CI/CD Pipeline:
○ GitHub Actions workflows (files in .github/workflows) that orchestrate tasks such as testing, building, and deploying the site.
• Deployment & Hosting:
○ GitHub Pages for hosting the built site.
○ Docker (docker-compose.yml) for local development and potentially containerized builds.
• Local Development:
○ “make dev” command defined in the Makefile to locally run the development server, likely using Vitepress or Vuepress.
Relationships and Interactions
• The content written in markdown (located in packages/apps/src) is processed and rendered using Vuepress/Vitepress, with the custom theme from packages/libs/theme providing the UI look and feel.
• During development, the “make dev” command triggers a local server that renders content dynamically.
• In the CI/CD pipeline, GitHub Actions fetch the latest changes, build the static site (using configurations found in vitepress and vuepress directories), and deploy the output to GitHub Pages.
• The Docker Compose configuration may be integrated to simulate a local production environment.
• Scripts in packages/apps/script help automate tasks such as generating summaries, handling blogs, or managing study content.
Important Architectural Patterns and Design Principles
• Modular Monorepo Architecture: Separation of concerns between content (apps) and presentation/theme (libs/theme).
• Static Site Generation: Using Vuepress/Vitepress to convert markdown content into a static, deployable website.
• CI/CD Automation: Automated building, testing, and deployment via GitHub Actions.
• Extensibility: Use of a theme library and clear separation of content, allowing easy updates or modifications to the UI without affecting the content.
Relevant Technologies and Frameworks
• Frontend/Static Site Generators: Vuepress and Vitepress.
• Version Control & CI: GitHub with GitHub Actions workflows.
• Containerization (for local simulation): Docker (docker-compose.yml).
• Package Management: pnpm (monorepo management and workspace definitions).
Detail and Clarity
• Component names exactly as used in the project (e.g., “packages/apps”, “packages/libs/theme”, “.github/workflows”).
• External integrations (GitHub Pages for deployment, Docker for local testing).