# antfu/vitesse architecture

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

- Interactive diagram: https://gitdiagram.com/antfu/vitesse
- Repository: https://github.com/antfu/vitesse

## Overview

Vitesse is a Vue-based starter template. The principal runtime path is a visitor entering the SSG-created Vue app, which presents file-based pages through layouts; the app also installs feature modules for localization, Pinia state, and PWA registration. The README documents additional template capabilities such as Markdown pages, component/API auto-imports, and styling. Some page-to-component and state-consumer links are omitted because those source excerpts were not provided.

Main entry points: [`src/main.ts`](https://github.com/antfu/vitesse/blob/main/src/main.ts) (App bootstrap), [`src/App.vue`](https://github.com/antfu/vitesse/blob/main/src/App.vue) (Root app), [`src/components`](https://github.com/antfu/vitesse/tree/main/src/components) (Auto-imported components), [`src/components/TheFooter.vue`](https://github.com/antfu/vitesse/blob/main/src/components/TheFooter.vue) (Footer controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_bootstrap["App bootstrap<br/>[main.ts]"]
  node_app["Root app<br/>[App.vue]"]
end

subgraph group_features["App features"]
  node_dark["Dark mode<br/>[dark.ts]"]
  node_i18n["Localization<br/>[i18n.ts]"]
  node_locales["Locale messages"]
  node_pinia["State integration<br/>[pinia.ts]"]
  node_userstore["User state<br/>[user.ts]"]
  node_pwa["PWA registration<br/>[pwa.ts]"]
  node_nprogress["Route progress<br/>[nprogress.ts]"]
  node_apis["Auto-imported APIs"]
end

subgraph group_ui["UI and content"]
  node_pages["File-based pages"]
  node_layouts["Page layouts"]
  node_markdown["Markdown pages<br/>[about.md]"]
  node_counter["Counter UI<br/>[TheCounter.vue]"]
  node_input["Input UI<br/>[TheInput.vue]"]
  node_footer["Footer controls<br/>[TheFooter.vue]"]
  node_components["Auto-imported components"]
  node_styling["UnoCSS and icons<br/>[uno.config.ts]"]
  node_preview["Component preview"]
end

subgraph group_delivery["Rendered output"]
  node_ssg["Static rendering<br/>[main.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_bootstrap -->|"creates app"| node_app
node_bootstrap -->|"loads routes"| node_pages
node_bootstrap -->|"sets up"| node_layouts
node_app -->|"renders route"| node_pages
node_pages -.->|"includes"| node_markdown
node_bootstrap -->|"renders statically"| node_ssg
node_bootstrap -->|"installs"| node_i18n
node_bootstrap -->|"installs"| node_pinia
node_bootstrap -->|"installs"| node_pwa
node_bootstrap -.->|"installs"| node_nprogress
node_i18n -->|"loads messages"| node_locales
node_footer -->|"changes locale"| node_i18n
node_app -->|"reads theme"| node_dark
node_footer -->|"toggles theme"| node_dark
node_components -.->|"provides"| node_counter
node_components -.->|"provides"| node_input
node_components -.->|"provides"| node_footer
node_pinia -.->|"hosts store"| node_userstore
node_apis -.->|"supports auto-imports"| node_counter
node_styling -.->|"styles interface"| node_app
node_preview -.->|"previews"| node_components

click node_bootstrap "https://github.com/antfu/vitesse/blob/main/src/main.ts"
click node_app "https://github.com/antfu/vitesse/blob/main/src/App.vue"
click node_pages "https://github.com/antfu/vitesse/tree/main/src/pages"
click node_layouts "https://github.com/antfu/vitesse/tree/main/src/layouts"
click node_markdown "https://github.com/antfu/vitesse/blob/main/src/pages/about.md"
click node_counter "https://github.com/antfu/vitesse/blob/main/src/components/TheCounter.vue"
click node_input "https://github.com/antfu/vitesse/blob/main/src/components/TheInput.vue"
click node_footer "https://github.com/antfu/vitesse/blob/main/src/components/TheFooter.vue"
click node_dark "https://github.com/antfu/vitesse/blob/main/src/composables/dark.ts"
click node_i18n "https://github.com/antfu/vitesse/blob/main/src/modules/i18n.ts"
click node_locales "https://github.com/antfu/vitesse/tree/main/locales"
click node_pinia "https://github.com/antfu/vitesse/blob/main/src/modules/pinia.ts"
click node_userstore "https://github.com/antfu/vitesse/blob/main/src/stores/user.ts"
click node_pwa "https://github.com/antfu/vitesse/blob/main/src/modules/pwa.ts"
click node_nprogress "https://github.com/antfu/vitesse/blob/main/src/modules/nprogress.ts"
click node_ssg "https://github.com/antfu/vitesse/blob/main/src/main.ts"
click node_components "https://github.com/antfu/vitesse/tree/main/src/components"
click node_apis "https://github.com/antfu/vitesse/tree/main/src"
click node_styling "https://github.com/antfu/vitesse/blob/main/uno.config.ts"
click node_preview "https://github.com/antfu/vitesse/tree/main/src"

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_bootstrap,node_app toneBlue
class node_dark,node_i18n,node_locales,node_pinia,node_userstore,node_pwa,node_nprogress,node_apis toneAmber
class node_pages,node_layouts,node_markdown,node_counter,node_input,node_footer,node_components,node_styling,node_preview toneMint
class node_ssg toneRose
class node_visitor toneIndigo
```

## Components

### App runtime

- [App bootstrap](https://github.com/antfu/vitesse/blob/main/src/main.ts): `src/main.ts`
- [Root app](https://github.com/antfu/vitesse/blob/main/src/App.vue): `src/App.vue`

### App features

- [Dark mode](https://github.com/antfu/vitesse/blob/main/src/composables/dark.ts): `src/composables/dark.ts`
- [Localization](https://github.com/antfu/vitesse/blob/main/src/modules/i18n.ts): `src/modules/i18n.ts`
- [Locale messages](https://github.com/antfu/vitesse/tree/main/locales): `locales`
- [State integration](https://github.com/antfu/vitesse/blob/main/src/modules/pinia.ts): `src/modules/pinia.ts`
- [User state](https://github.com/antfu/vitesse/blob/main/src/stores/user.ts): `src/stores/user.ts`
- [PWA registration](https://github.com/antfu/vitesse/blob/main/src/modules/pwa.ts): `src/modules/pwa.ts`
- [Route progress](https://github.com/antfu/vitesse/blob/main/src/modules/nprogress.ts): `src/modules/nprogress.ts`
- [Auto-imported APIs](https://github.com/antfu/vitesse/tree/main/src): `src`

### UI and content

- [File-based pages](https://github.com/antfu/vitesse/tree/main/src/pages): `src/pages`
- [Page layouts](https://github.com/antfu/vitesse/tree/main/src/layouts): `src/layouts`
- [Markdown pages](https://github.com/antfu/vitesse/blob/main/src/pages/about.md): `src/pages/about.md`
- [Counter UI](https://github.com/antfu/vitesse/blob/main/src/components/TheCounter.vue): `src/components/TheCounter.vue`
- [Input UI](https://github.com/antfu/vitesse/blob/main/src/components/TheInput.vue): `src/components/TheInput.vue`
- [Footer controls](https://github.com/antfu/vitesse/blob/main/src/components/TheFooter.vue): `src/components/TheFooter.vue`
- [Auto-imported components](https://github.com/antfu/vitesse/tree/main/src/components): `src/components`
- [UnoCSS and icons](https://github.com/antfu/vitesse/blob/main/uno.config.ts): `uno.config.ts`
- [Component preview](https://github.com/antfu/vitesse/tree/main/src): `src`

### Rendered output

- [Static rendering](https://github.com/antfu/vitesse/blob/main/src/main.ts): `src/main.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Root app: opens (evidence: `README.md`)
- App bootstrap → Root app: creates app (evidence: `src/main.ts`)
- App bootstrap → File-based pages: loads routes (evidence: `src/main.ts`)
- App bootstrap → Page layouts: sets up (evidence: `src/main.ts`)
- Root app → File-based pages: renders route (evidence: `src/App.vue`)
- File-based pages → Markdown pages: includes (evidence: `README.md`)
- App bootstrap → Static rendering: renders statically (evidence: `src/main.ts`)
- App bootstrap → Localization: installs (evidence: `src/main.ts`)
- App bootstrap → State integration: installs (evidence: `src/main.ts`)
- App bootstrap → PWA registration: installs (evidence: `src/main.ts`)
- App bootstrap → Route progress: installs
- Localization → Locale messages: loads messages (evidence: `src/modules/i18n.ts`)
- Footer controls → Localization: changes locale (evidence: `src/components/TheFooter.vue`)
- Root app → Dark mode: reads theme (evidence: `src/App.vue`)
- Footer controls → Dark mode: toggles theme (evidence: `src/components/TheFooter.vue`)
- Auto-imported components → Counter UI: provides (evidence: `README.md`)
- Auto-imported components → Input UI: provides (evidence: `README.md`)
- Auto-imported components → Footer controls: provides (evidence: `README.md`)
- State integration → User state: hosts store (evidence: `README.md`)
- Auto-imported APIs → Counter UI: supports auto-imports (evidence: `README.md`)
- UnoCSS and icons → Root app: styles interface (evidence: `README.md`)
- Component preview → Auto-imported components: previews (evidence: `README.md`)
