# h5bp/html5-boilerplate architecture

> Architecture diagram of the GitHub repository h5bp/html5-boilerplate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/h5bp/html5-boilerplate
- Repository: https://github.com/h5bp/html5-boilerplate

## Overview

1. **What this repository is**
   - This is the authoring repo for **HTML5 Boilerplate**, a static front-end starter template.
   - The real deliverable is the contents of **`/dist`**; the rest of the repo exists to build, validate, document, and publish that deliverable.

2. **Primary architectural boundary: authoring vs published output**
   - **`src/`** contains the editable source template.
   - **`dist/`** contains the distributable package that end users install or copy into their projects.
   - In practice, the architecture is “source files in `src` → build pipeline → packaged assets in `dist`”.

3. **Published asset set**
   - The template is mostly static site assets:
     - **`index.html`**, **`404.html`**
     - **`css/style.css`**
     - **`js/app.js`**
     - **`img/`**
     - **`robots.txt`**
     - **`site.webmanifest`**
   - These files form the baseline site shell and are intentionally framework-agnostic.

4. **JavaScript and CSS structure**
   - The repo does not impose an application framework or SPA architecture.
   - **`src/js/app.js`** is the application entry point for starter scripts.
   - **`src/css`** is not present as a separate tree in the file list, which signals that the CSS is authored primarily in the template stylesheet and shipped as a minimal default.
   - The project emphasizes progressive enhancement and “delete-key friendly” customization rather than complex internal layering.

5. **Build and packaging pipeline**
   - Build orchestration is handled by **`gulpfile.mjs`** and **Webpack configs** in both `src/` and `dist/`.
   - The build system produces the publishable assets in `dist/`, likely bundling/minifying front-end resources and preparing a package that can be consumed via npm or copied directly.
   - The presence of separate dev/prod webpack configs indicates distinct development and production build modes.

6. **Distribution packaging**
   - The `dist/` folder includes its own **`package.json`**, which indicates the published artifact is itself an npm-distributable package.
   - This repo therefore serves both as a template source tree and as the build source for a packaged distribution artifact.

7. **Documentation subsystem**
   - The **`docs/`** directory contains the main project documentation, split into topics such as:
     - HTML
     - CSS
     - JavaScript
     - usage
     - extension guidance
     - FAQ and miscellany
   - The docs are part of the repository’s product surface because the template is intended to be modified and extended by consumers.

8. **Validation and tests**
   - The **`test/`** directory contains checks like:
     - content verification
     - file existence verification
   - This suggests the repo’s quality gate is centered on ensuring the generated template contains the expected baseline files and text, rather than testing runtime business logic.

9. **Continuous integration and release flow**
   - GitHub Actions workflows cover build, test, dependency review, CodeQL, spellcheck, scorecard, and publish tasks.
   - The release pipeline is important because this repo’s architecture includes a formal “build and publish the template” path, not just local development.

10. **Project conventions and maintainability**
   - Tooling files such as **ESLint**, **Prettier**, **cspell**, and editor configs are used to keep the template and documentation consistent.
   - These do not affect runtime behavior, but they matter for understanding how the repository is maintained and how changes are validated.

11. **How to diagram the system**
   - Draw three main areas:
     - **Authoring source**: `src/`, `docs/`, `test/`, and build scripts
     - **Build/CI layer**: Gulp, Webpack, GitHub Actions
     - **Published artifact**: `dist/`
   - The only significant data flow is from source/template files through the build pipeline into the distributable static site package.

12. **Overall architectural summary**
   - This is not a server-side application or a multi-service system.
   - It is a **static template repository** with a clearly separated source tree, build tooling, and packaged output, designed to produce a reusable front-end boilerplate rather than run as a live application itself.

Main entry points: [`dist`](https://github.com/h5bp/html5-boilerplate/tree/main/dist) (Distribution tree), [`src`](https://github.com/h5bp/html5-boilerplate/tree/main/src) (Source tree), [`gulpfile.mjs`](https://github.com/h5bp/html5-boilerplate/blob/main/gulpfile.mjs) (Gulp build), [`.github/workflows/build-dist.yml`](https://github.com/h5bp/html5-boilerplate/blob/main/.github/workflows/build-dist.yml) (GitHub Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring source"]
  node_src["Source tree<br/>template source"]
  node_src_html["HTML shell<br/>template markup<br/>[index.html]"]
  node_src_js["Starter JS<br/>entry script<br/>[app.js]"]
  node_src_assets[("Static assets")]
  node_src_pkg["Source package<br/>package metadata<br/>[package.json]"]
  node_docs["Docs<br/>documentation"]
  node_test["Checks<br/>validation"]
end

subgraph group_pipeline["Build and CI"]
  node_gulp["Gulp build<br/>orchestrator<br/>[gulpfile.mjs]"]
  node_webpack_src["Source webpack<br/>bundle config<br/>[webpack.common.js]"]
  node_webpack_dist["Dist webpack<br/>bundle config<br/>[webpack.common.js]"]
  node_ci["GitHub Actions<br/>ci/release<br/>[build-dist.yml]"]
end

subgraph group_published["Published artifact"]
  node_dist["Distribution tree<br/>published package"]
  node_dist_html["Published HTML<br/>site shell<br/>[index.html]"]
  node_dist_css["Published CSS<br/>stylesheet<br/>[style.css]"]
  node_dist_js["Published JS<br/>script bundle<br/>[app.js]"]
  node_dist_assets[("Published assets<br/>static assets")]
  node_dist_pkg["Dist package<br/>package metadata<br/>[package.json]"]
end

node_src -->|"contains"| node_src_html
node_src -->|"contains"| node_src_js
node_src -->|"contains"| node_src_assets
node_src -->|"packages"| node_src_pkg
node_src -->|"configured by"| node_webpack_src
node_docs -->|"guides"| node_src
node_test -->|"verifies"| node_src
node_gulp -->|"builds"| node_dist
node_gulp -->|"reads"| node_src
node_gulp -->|"uses"| node_webpack_src
node_dist -->|"contains"| node_dist_html
node_dist -->|"contains"| node_dist_css
node_dist -->|"contains"| node_dist_js
node_dist -->|"contains"| node_dist_assets
node_dist -->|"packages"| node_dist_pkg
node_dist -->|"configured by"| node_webpack_dist
node_src -->|"publishes to"| node_dist
node_ci -->|"runs"| node_gulp
node_ci -->|"runs"| node_test
node_ci -->|"releases"| node_dist

click node_src "https://github.com/h5bp/html5-boilerplate/tree/main/src"
click node_src_html "https://github.com/h5bp/html5-boilerplate/blob/main/src/index.html"
click node_src_js "https://github.com/h5bp/html5-boilerplate/blob/main/src/js/app.js"
click node_src_assets "https://github.com/h5bp/html5-boilerplate/tree/main/src"
click node_src_pkg "https://github.com/h5bp/html5-boilerplate/blob/main/src/package.json"
click node_docs "https://github.com/h5bp/html5-boilerplate/tree/main/docs"
click node_test "https://github.com/h5bp/html5-boilerplate/tree/main/test"
click node_dist "https://github.com/h5bp/html5-boilerplate/tree/main/dist"
click node_dist_html "https://github.com/h5bp/html5-boilerplate/blob/main/dist/index.html"
click node_dist_css "https://github.com/h5bp/html5-boilerplate/blob/main/dist/css/style.css"
click node_dist_js "https://github.com/h5bp/html5-boilerplate/blob/main/dist/js/app.js"
click node_dist_assets "https://github.com/h5bp/html5-boilerplate/tree/main/dist"
click node_dist_pkg "https://github.com/h5bp/html5-boilerplate/blob/main/dist/package.json"
click node_gulp "https://github.com/h5bp/html5-boilerplate/blob/main/gulpfile.mjs"
click node_webpack_src "https://github.com/h5bp/html5-boilerplate/blob/main/src/webpack.common.js"
click node_webpack_dist "https://github.com/h5bp/html5-boilerplate/blob/main/dist/webpack.common.js"
click node_ci "https://github.com/h5bp/html5-boilerplate/blob/main/.github/workflows/build-dist.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_src,node_src_html,node_src_js,node_src_assets,node_src_pkg,node_docs,node_test toneBlue
class node_gulp,node_webpack_src,node_webpack_dist,node_ci toneAmber
class node_dist,node_dist_html,node_dist_css,node_dist_js,node_dist_assets,node_dist_pkg toneMint
```

## Components

### Authoring source

Editable template, docs, and validation

- [Source tree](https://github.com/h5bp/html5-boilerplate/tree/main/src): template source · Editable starter template and package source · `src`
- [HTML shell](https://github.com/h5bp/html5-boilerplate/blob/main/src/index.html): template markup · Primary site shell and fallback page · `src/index.html`
- [Starter JS](https://github.com/h5bp/html5-boilerplate/blob/main/src/js/app.js): entry script · Default script entry point for progressive enhancement · `src/js/app.js`
- [Static assets](https://github.com/h5bp/html5-boilerplate/tree/main/src): assets · Images, robots rules, and web manifest · `src`
- [Source package](https://github.com/h5bp/html5-boilerplate/blob/main/src/package.json): package metadata · Package metadata for the source tree · `src/package.json`
- [Docs](https://github.com/h5bp/html5-boilerplate/tree/main/docs): documentation · Project guidance for HTML, CSS, JS, usage, and extension · `docs`
- [Checks](https://github.com/h5bp/html5-boilerplate/tree/main/test): validation · File-content and file-existence verification · `test`

### Build and CI

Tooling that assembles, checks, and publishes the template

- [Gulp build](https://github.com/h5bp/html5-boilerplate/blob/main/gulpfile.mjs): orchestrator · Build coordination for source-to-dist packaging · `gulpfile.mjs`
- [Source webpack](https://github.com/h5bp/html5-boilerplate/blob/main/src/webpack.common.js): bundle config · Webpack configuration used from the source tree · `src/webpack.common.js`
- [Dist webpack](https://github.com/h5bp/html5-boilerplate/blob/main/dist/webpack.common.js): bundle config · Webpack configuration shipped with the distributable package · `dist/webpack.common.js`
- [GitHub Actions](https://github.com/h5bp/html5-boilerplate/blob/main/.github/workflows/build-dist.yml): ci/release · Build, test, analysis, spellcheck, and publish workflows · `.github/workflows/build-dist.yml`

### Published artifact

Distributable static starter package

- [Distribution tree](https://github.com/h5bp/html5-boilerplate/tree/main/dist): published package · Build output consumed as the installable boilerplate · `dist`
- [Published HTML](https://github.com/h5bp/html5-boilerplate/blob/main/dist/index.html): site shell · Distributed HTML entry pages · `dist/index.html`
- [Published CSS](https://github.com/h5bp/html5-boilerplate/blob/main/dist/css/style.css): stylesheet · Distributed default styling · `dist/css/style.css`
- [Published JS](https://github.com/h5bp/html5-boilerplate/blob/main/dist/js/app.js): script bundle · Distributed starter script · `dist/js/app.js`
- [Published assets](https://github.com/h5bp/html5-boilerplate/tree/main/dist): static assets · Images, robots rules, and manifest in the packaged output · `dist`
- [Dist package](https://github.com/h5bp/html5-boilerplate/blob/main/dist/package.json): package metadata · npm metadata for the distributable artifact · `dist/package.json`

## Connections

- Source tree → HTML shell: contains · Source tree includes the editable HTML shell
- Source tree → Starter JS: contains · Source tree includes starter JavaScript
- Source tree → Static assets: contains · Source tree includes static assets
- Source tree → Source package: packages · Source tree defines its package metadata
- Source tree → Source webpack: configured by · Source tree is built with webpack config
- Docs → Source tree: guides · Documentation explains how to use and extend the source template
- Checks → Source tree: verifies · Checks validate expected source files and content
- Gulp build → Distribution tree: builds · Gulp orchestrates creation of the distributable package
- Gulp build → Source tree: reads · Build pipeline consumes editable source files
- Gulp build → Source webpack: uses · Build pipeline uses source webpack configuration
- Distribution tree → Published HTML: contains · Distribution includes published HTML
- Distribution tree → Published CSS: contains · Distribution includes published CSS
- Distribution tree → Published JS: contains · Distribution includes published JavaScript
- Distribution tree → Published assets: contains · Distribution includes packaged static assets
- Distribution tree → Dist package: packages · Distribution is itself an npm package
- Distribution tree → Dist webpack: configured by · Published package carries its webpack config
- Source tree → Distribution tree: publishes to · Source template is transformed into the distributable output
- GitHub Actions → Gulp build: runs · CI workflows execute build orchestration
- GitHub Actions → Checks: runs · CI workflows execute repository checks
- GitHub Actions → Distribution tree: releases · Release workflow publishes the distributable artifact
