# chungpv/go-advanced architecture

> Architecture diagram of the GitHub repository chungpv/go-advanced, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chungpv/go-advanced
- Repository: https://github.com/chungpv/go-advanced

## Overview

##### Main components
- Documentation Content – the chapters that form the curriculum. Represent these with nodes for each major chapter (e.g., "ch1-basic", "ch2-cgo", "ch3-rpc", "ch4-web", "ch5-distributed-system", "ch6-best-practices").
- Documentation Build and Formatting – the “docs”, “docs/gitbook”, and "SUMMARY.md" files that are used to generate HTML, PDF, and possibly other static outputs. Indicate the workflow from markdown source to HTML output via GitBook.
- Code Examples – the “examples”, “docs/examples” directories (and deeper nested directories) that provide runnable code samples for each chapter. Separate these from the textual content but show the integration (for instance, “Examples” often accompany the respective chapter).

##### Relationships and data flows
- Examples directories with the corresponding chapter nodes to show that practical code samples support the academic content.
- Directional flows from the GitHub contribution module (issue templates in .github and repository metadata) to the overall project, indicating how community feedback or contributions are integrated.
- External resources like the official Golang website or external courses used as references (listed in the README) as ancillary components.

##### Architectural patterns and design principles
- Modularity: Each chapter is self-contained, forming a module within the overall learning path.
- Separation of Concerns: The project cleanly separates “content” (tutorial chapters and documentation) from “code examples” and “static build assets” (docs, images, pdfs, GitBook).
- Extensibility: The presence of multiple nested directories and a clear GitHub contribution workflow shows the design anticipates community extension and updates.

##### Relevant technologies
- Golang: The examples are written in Go and illustrate advanced programming topics.
- GitBook: Used for converting markdown documentation into styled websites and PDF outputs.
- Git and GitHub: For version control, issues, and managing contributions.
- Supporting frameworks or libraries may be indirectly referenced through example code (CGO, RPC, Web programming, distributed systems patterns).

- Labels for each major folder and functional area: “Content Modules (ch1-basic, ch2-cgo, …)”, “Documentation Outputs (docs, GitBook)”, “Examples”, “Assets (images, resource)”, and “Contribution Infrastructure (.github, README)” etc.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Documentation Content"
        ch1["ch1-basic"]:::content
        ch2["ch2-cgo"]:::content
        ch3["ch3-rpc"]:::content
        ch4["ch4-web"]:::content
        ch5["ch5-distributed-system"]:::content
        ch6["ch6-best-practices"]:::content
    end

    cm["Content Markdown"]:::content

    ch1 -->|"source"| cm
    ch2 -->|"source"| cm
    ch3 -->|"source"| cm
    ch4 -->|"source"| cm
    ch5 -->|"source"| cm
    ch6 -->|"source"| cm

    subgraph "GitHub & Contribution"
        gh1[".github"]:::github
        gh2["README.md"]:::github
    end

    gh1 -->|"contributes"| cm
    gh2 -->|"contributes"| cm

    subgraph "Documentation Build"
        summary["SUMMARY.md"]:::build
        gitbook["docs/gitbook"]:::build
        docs["docs"]:::build
        output["HTML/PDF Output"]:::build
    end

    cm -->|"buildsFrom"| summary
    summary -->|"convertsTo"| gitbook
    gitbook -->|"generates"| docs
    docs -->|"outputs"| output

    subgraph "Code Examples"
        ex1["examples"]:::examples
        ex2["docs/examples"]:::examples
    end

    cm -->|"supportedBy"| ex1
    cm -->|"supportedBy"| ex2

    subgraph "Supporting Assets"
        images["images"]:::assets
        resource["resource"]:::assets
    end

    images -->|"integratedIn"| docs
    resource -->|"integratedIn"| docs

    %% Click Events
    click ch1 "https://github.com/chungpv/go-advanced/tree/master/ch1-basic"
    click ch2 "https://github.com/chungpv/go-advanced/tree/master/ch2-cgo"
    click ch3 "https://github.com/chungpv/go-advanced/tree/master/ch3-rpc"
    click ch4 "https://github.com/chungpv/go-advanced/tree/master/ch4-web"
    click ch5 "https://github.com/chungpv/go-advanced/tree/master/ch5-distributed-system"
    click ch6 "https://github.com/chungpv/go-advanced/tree/master/ch6-best-practices"

    click summary "https://github.com/chungpv/go-advanced/blob/master/SUMMARY.md"
    click gitbook "https://github.com/chungpv/go-advanced/tree/master/docs/gitbook"
    click docs "https://github.com/chungpv/go-advanced/tree/master/docs"

    click ex1 "https://github.com/chungpv/go-advanced/tree/master/examples"
    click ex2 "https://github.com/chungpv/go-advanced/tree/master/docs/examples"

    click images "https://github.com/chungpv/go-advanced/tree/master/images"
    click resource "https://github.com/chungpv/go-advanced/tree/master/resource"

    click gh1 "https://github.com/chungpv/go-advanced/blob/master/.github"
    click gh2 "https://github.com/chungpv/go-advanced/blob/master/README.md"

    %% Styles
    classDef content fill:#ffcccc,stroke:#660000,stroke-width:2px;
    classDef build fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef examples fill:#ccccff,stroke:#000066,stroke-width:2px;
    classDef assets fill:#ffe6cc,stroke:#ff6600,stroke-width:2px;
    classDef github fill:#cfe2ff,stroke:#003366,stroke-width:2px;
```
