# marcombo/programacion-en-go architecture

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

- Interactive diagram: https://gitdiagram.com/marcombo/programacion-en-go
- Repository: https://github.com/marcombo/programacion-en-go

## Overview

##### Project Type and Purpose
- This isn’t a single production application, but rather a structured collection of independent code examples and tutorials.
- “ejemplos-libro” is organized by topics (e.g., “02-sintaxis-basica”, “03-control-de-flujo”, etc.) that illustrate different language features.
- “wasm-tutorial” offers working examples of WebAssembly programs (with web assets, a Go-based HTTP server, and WASM binaries).

##### Analysis of the File Structure
- At the top level, you have the README, a fe-de-erratas markdown file, and two main directories: “ejemplos-libro” and “wasm-tutorial”.
- Within “ejemplos-libro”, each numbered folder represents a dedicated set of examples covering topics from Go basics to more advanced subjects like concurrency, error handling, and testing.
- In “wasm-tutorial”, there are separate examples (e.g., “ejemplo-canvas” and “ejemplo”) that show how to set up a WebAssembly project using Go. Each of them has its own go.mod file, server code, web assets (HTML, WASM binaries, JS shim), and source code.

a. Main Components:
- Component 1: Educational Examples (ejemplos-libro)
- Treat each folder (like “02-sintaxis-basica”, “03-control-de-flujo”, etc.) as a module that illustrates key Go features.
- Sub-components are the individual Go files demonstrating specific code samples.
- Component 2: WebAssembly Tutorials (wasm-tutorial)
- Tutorial example (“ejemplo-canvas”, “ejemplo”) as a distinct module.
- Within each module, separate the server (backend) elements and the client/web assets (frontend) elements that are involved in serving and interacting with the WASM application.
- Other Elements:
- README, configuration files (like go.mod/go.sum), and supporting documentation (fe-de-erratas).

b. Relationships and Interactions:
- Branch the repository into two main segments: Educational Examples and WASM Tutorials.

c. Architectural Patterns/Design Principles:
- Modularity: Each chapter or tutorial is independent and self-explanatory.
- Separation of Concerns: Distinguish clearly between backend logic (Go server in the wasm examples) and the client presentation layers (HTML, WASM, JS).
- Use of Go Modules: Represent modules like go.mod files that ensure dependency management in separate sub-projects.

d. Technologies, Frameworks, or Libraries:
- Go (Golang): Central language used in all modules.
- WebAssembly components: When drawing the “wasm-tutorial” part, include client-side web technologies (HTML, wasm_exec.js) and highlight how Go compiles to WASM.
- Standard Libraries: For networking (HTTP server in the wasm tutorials) and file IO (illustrated in the examples on I/O).

## Diagram (Mermaid)

```mermaid
graph TD
    Repo["Repository"]:::repo

    %% Educational Examples Subgraph
    subgraph "Educational Examples"
        Edu["Ejemplos Libro"]:::edu
        T02["02-sintaxis-basica"]:::edu
        T03["03-control-de-flujo"]:::edu
        T04["04-apuntadores"]:::edu
        T05["05-funciones"]:::edu
        T06["06-arrays-slices"]:::edu
        T07["07-strings"]:::edu
        T08["08-diccionarios"]:::edu
        T09["09-organizacion-codigo"]:::edu
        T10["10-tipos"]:::edu
        T11["11-tipos-estructurados"]:::edu
        T12["12-interfaces"]:::edu
        T13["13-errores"]:::edu
        T14["14-entrada-salida"]:::edu
        T15["15-paralelismo-concurrencia"]:::edu
        T16["16-canales"]:::edu
        T17["17-servicios-web"]:::edu
        T18["18-serializacion-datos"]:::edu
        T19["19-bases-datos"]:::edu
        T20["20-testing"]:::edu

        Edu -->|"example-module"| T02
        Edu -->|"example-module"| T03
        Edu -->|"example-module"| T04
        Edu -->|"example-module"| T05
        Edu -->|"example-module"| T06
        Edu -->|"example-module"| T07
        Edu -->|"example-module"| T08
        Edu -->|"example-module"| T09
        Edu -->|"example-module"| T10
        Edu -->|"example-module"| T11
        Edu -->|"example-module"| T12
        Edu -->|"example-module"| T13
        Edu -->|"example-module"| T14
        Edu -->|"example-module"| T15
        Edu -->|"example-module"| T16
        Edu -->|"example-module"| T17
        Edu -->|"example-module"| T18
        Edu -->|"example-module"| T19
        Edu -->|"example-module"| T20
    end

    %% WASM Tutorials Subgraph
    subgraph "Wasm Tutorials"
        Wasm["Wasm Tutorial"]:::wasm
        subgraph "ejemplo-canvas"
            EjcServer["Server"]:::server
            EjcAssets["Web Assets"]:::client
            EjcSource["Source Code"]:::wasm
            EjcServer -->|"toAssets"| EjcAssets
            EjcAssets -->|"toSource"| EjcSource
        end
        subgraph "ejemplo"
            EjSvr["Server"]:::server
            EjAssets["Web Assets"]:::client
            EjSource["Source Code"]:::wasm
            EjSvr -->|"toAssets"| EjAssets
            EjAssets -->|"toSource"| EjSource
        end
        Wasm -->|"init-canvas"| EjcServer
        Wasm -->|"init-example"| EjSvr
        EjcServer -->|"serves"| Browser["Browser/Client"]:::client
        EjSvr -->|"serves"| Browser
    end

    %% Supporting Documentation Subgraph
    subgraph "Supporting Documentation"
        README["README.md"]:::doc
        Erratas["fe-de-erratas.md"]:::doc
    end

    Repo --> Edu
    Repo --> Wasm
    Repo --> README
    Repo --> Erratas

    %% Click Events for Educational Examples
    click Edu "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro"
    click T02 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/02-sintaxis-basica"
    click T03 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/03-control-de-flujo"
    click T04 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/04-apuntadores"
    click T05 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/05-funciones"
    click T06 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/06-arrays-slices"
    click T07 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/07-strings"
    click T08 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/08-diccionarios"
    click T09 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/09-organizacion-codigo"
    click T10 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/10-tipos"
    click T11 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/11-tipos-estructurados"
    click T12 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/12-interfaces"
    click T13 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/13-errores"
    click T14 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/14-entrada-salida"
    click T15 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/15-paralelismo-concurrencia"
    click T16 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/16-canales"
    click T17 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/17-servicios-web"
    click T18 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/18-serializacion-datos"
    click T19 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/19-bases-datos"
    click T20 "https://github.com/marcombo/programacion-en-go/tree/main/ejemplos-libro/20-testing"

    %% Click Events for WASM Tutorials
    click Wasm "https://github.com/marcombo/programacion-en-go/tree/main/wasm-tutorial"
    click EjcServer "https://github.com/marcombo/programacion-en-go/blob/main/wasm-tutorial/ejemplo-canvas/server.go"
    click EjcAssets "https://github.com/marcombo/programacion-en-go/tree/main/wasm-tutorial/ejemplo-canvas/site"
    click EjcSource "https://github.com/marcombo/programacion-en-go/blob/main/wasm-tutorial/ejemplo-canvas/src/main.go"
    click EjSvr "https://github.com/marcombo/programacion-en-go/blob/main/wasm-tutorial/ejemplo/server.go"
    click EjAssets "https://github.com/marcombo/programacion-en-go/tree/main/wasm-tutorial/ejemplo/site"
    click EjSource "https://github.com/marcombo/programacion-en-go/blob/main/wasm-tutorial/ejemplo/src/main.go"

    %% Click Events for Documentation
    click README "https://github.com/marcombo/programacion-en-go/blob/main/README.md"
    click Erratas "https://github.com/marcombo/programacion-en-go/blob/main/fe-de-erratas.md"

    %% Styles
    classDef edu fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef wasm fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef server fill:#ffcc80,stroke:#f57c00,stroke-width:2px;
    classDef client fill:#d1c4e9,stroke:#673ab7,stroke-width:2px;
    classDef doc fill:#eeeeee,stroke:#555,stroke-width:2px;
    classDef repo fill:#ffe0b2,stroke:#fb8c00,stroke-width:2px;
```
