# xiaolai/1000-hours architecture

> Architecture diagram of the GitHub repository xiaolai/1000-hours, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xiaolai/1000-hours
- Repository: https://github.com/xiaolai/1000-hours

## Overview

##### Project type and purpose
- This is a static documentation / learning site built with VitePress (a Vue-powered static site generator).
- Its purpose is to present English learning materials (markdown lessons, audio/video assets, Jupyter notebooks) as a browsable website.

##### File structure
- Top-level config and theme:
- `.vitepress/config.mts` – site configuration (routes, plugins, head tags)
- `.vitepress/theme/…` – custom Vue components, styles and layouts
- Content directories (all markdown):
- `in-the-brain/`, `self-training/`, `sounds-of-english/`, `training-tasks/`, `why/` – lesson modules
- Public assets served verbatim:
- `public/audios/`, `public/videos/`, `public/fonts/`, `public/images/`, `public/jupyter-notebooks/`
- Standard Node/JavaScript tooling:
- `package.json` + `package-lock.json` – dependencies (vite, vitepress, vue)
- `index.md`, `intro.md`, `README.md` – landing pages

##### README
- Indicates the repo is archived and points to a canonical URL.
- No further architectural notes, so we infer architecture entirely from file structure.

##### Detailed but focused view
- On the left, cluster all source content (`.vitepress`, markdown dirs).
- In the center, show the Vite/VitePress build step.
- On the right, show deployment to CDN and consumption by the browser.
- “public” folder as a pass-through for static assets.
- Theme components as the presentation layer.
- Don’t over-fragment: group related markdown directories under “Content”.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        direction TB
        pkg["package.json"]:::storage
        lock["package-lock.json"]:::storage
        gi[".gitignore"]:::storage
    end

    %% Source Configuration
    subgraph "Source Configuration"
        direction TB
        cfg[".vitepress/config.mts"]:::config
        themeIndex[".vitepress/theme/index.ts"]:::config
        styleScss[".vitepress/theme/style.scss"]:::config
        fontScss[".vitepress/theme/font.scss"]:::config
    end

    %% Theme Components
    subgraph "Theme Components (Presentation Layer)"
        direction TB
        comp1["SpeakWord.vue"]:::component
        comp2["SpeakWordInlineConverter.vue"]:::component
        comp3["SpeakWord.scss"]:::component
        icon1["PlayCircleOutline.vue"]:::component
        iconIndex["icons/index.ts"]:::component
        layout["layouts/index.vue"]:::component
        dataFile["data/index.js"]:::component
    end

    %% Content
    subgraph "Content (Markdown Lessons)"
        direction TB
        idx["index.md"]:::doc
        intro["intro.md"]:::doc
        readme["README.md"]:::doc
        brain["in-the-brain/*.md"]:::doc
        self["self-training/*.md"]:::doc
        sounds["sounds-of-english/*.md"]:::doc
        tasks["training-tasks/*.md"]:::doc
        whyDir["why/*.md"]:::doc
    end

    %% Public Assets
    subgraph "Public Assets (Static Media)"
        direction TB
        audios["public/audios/**"]:::asset
        videos["public/videos/**"]:::asset
        images["public/images/**"]:::asset
        fonts["public/fonts/**"]:::asset
        jup["public/jupyter-notebooks/**"]:::asset
    end

    %% Build Pipeline
    build["Build Pipeline\n(Vite & VitePress SSG)"]:::process

    %% Deployment
    cdn["Static Host / CDN\n(GitHub Pages, Netlify)"]:::endpoint

    %% Client Browser
    browser["Client Browser\n(HTML/CSS/JS runtime,\nVue hydration)"]:::endpoint

    %% Relationships
    pkg -->|commits/pushes source| cfg
    lock --> cfg
    gi --> cfg

    cfg --> build
    themeIndex --> build
    styleScss --> build
    fontScss --> build

    idx --> build
    intro --> build
    readme --> build
    brain --> build
    self --> build
    sounds --> build
    tasks --> build
    whyDir --> build

    audios --> cdn
    videos --> cdn
    images --> cdn
    fonts --> cdn
    jup --> cdn

    build -->|deploys static site| cdn
    cdn -->|serves files| browser
    browser -->|hydrates| comp1
    browser --> comp2
    browser --> layout

    %% Click Events
    click pkg "https://github.com/xiaolai/1000-hours/blob/main/package.json"
    click lock "https://github.com/xiaolai/1000-hours/blob/main/package-lock.json"
    click gi "https://github.com/xiaolai/1000-hours/blob/main/.gitignore"
    click cfg "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/config.mts"
    click themeIndex "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/index.ts"
    click styleScss "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/style.scss"
    click fontScss "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/font.scss"
    click comp1 "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/components/SpeakWord.vue"
    click comp2 "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/components/SpeakWordInlineConverter.vue"
    click comp3 "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/components/SpeakWord.scss"
    click icon1 "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/components/icons/PlayCircleOutline.vue"
    click iconIndex "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/components/icons/index.ts"
    click layout "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/layouts/index.vue"
    click dataFile "https://github.com/xiaolai/1000-hours/blob/main/.vitepress/theme/data/index.js"
    click idx "https://github.com/xiaolai/1000-hours/blob/main/index.md"
    click intro "https://github.com/xiaolai/1000-hours/blob/main/intro.md"
    click readme "https://github.com/xiaolai/1000-hours/blob/main/README.md"
    click brain "https://github.com/xiaolai/1000-hours/tree/main/in-the-brain/"
    click self "https://github.com/xiaolai/1000-hours/tree/main/self-training/"
    click sounds "https://github.com/xiaolai/1000-hours/tree/main/sounds-of-english/"
    click tasks "https://github.com/xiaolai/1000-hours/tree/main/training-tasks/"
    click whyDir "https://github.com/xiaolai/1000-hours/tree/main/why/"

    %% Styles
    classDef process fill:#D6E9C6,stroke:#3C763D,stroke-width:2px
    classDef storage fill:#FCF8E3,stroke:#8A6D3B,stroke-width:2px
    classDef config fill:#D9EDF7,stroke:#31708F,stroke-width:2px
    classDef component fill:#F2DEDE,stroke:#A94442,stroke-width:2px
    classDef doc fill:#EEE,stroke:#999,stroke-width:1px,stroke-dasharray: 2 2
    classDef asset fill:#F5F5F5,stroke:#CCC,stroke-width:1px
    classDef endpoint fill:#D9EDF7,stroke:#31708F,stroke-width:2px,stroke-dasharray: 5 5
```
