# leoncetos/tb2 architecture

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

- Interactive diagram: https://gitdiagram.com/leoncetos/tb2
- Repository: https://github.com/leoncetos/tb2

## Overview

This is a C++ console-based collaborative messaging system. Users choose workspace and activity actions from a menu; the SlackSistema controller handles those operations, including channel and message workflows, and offers user, thread, notification, edit-history, activity, sorting, summary, and file save/load features. Domain entities model users, channels, messages, and related concepts; generic data structures and sorting algorithms form an internal support layer. The repository contains duplicate source trees; this map uses the primary SlackVersion0.1/SlackVersion0.1 files. Some feature links rely on README descriptions because their implementation excerpts were not shown.

Main entry points: [`SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp`](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp) (Slack controller), [`SlackVersion0.1/SlackVersion0.1/main.cpp`](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/main.cpp) (Interactive menu), [`SlackVersion0.1/SlackVersion0.1/Usuario.h`](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Usuario.h) (Users and roles), [`SlackVersion0.1/SlackVersion0.1/Canal.h`](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Canal.h) (Channels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Console entry"]
  node_menu["Interactive menu<br/>[main.cpp]"]
  node_controller["Slack controller<br/>[SlackSistema.cpp]"]
end

subgraph group_domain["Messaging domain"]
  node_users["Users and roles<br/>[Usuario.h]"]
  node_channels["Channels<br/>[Canal.h]"]
  node_messages["Messages<br/>[Mensaje.h]"]
  node_threads["Conversation threads<br/>[Hilo.h]"]
  node_content["Message content<br/>[ContenidoMensaje.h]"]
  node_friendships["Friend connections<br/>[Amistad.h]"]
  node_notifications["Notifications<br/>[Notificacion.h]"]
  node_activity["Activity log"]
  node_edit_history["Edit history<br/>[SlackSistema.cpp]"]
end

subgraph group_support["Runtime support"]
  node_structures["Generic structures<br/>[Estructuras.h]"]
  node_algorithms["Sorting algorithms<br/>[Algoritmos.h]"]
end

subgraph group_persistence["Persistence"]
  node_files[("Local data files")]
end

node_operator(("Console user"))

node_operator -->|"selects actions"| node_menu
node_menu -->|"dispatches menus"| node_controller
node_controller -->|"creates channels"| node_channels
node_controller -->|"queues notices"| node_notifications
node_controller -->|"records actions"| node_activity
node_controller -->|"creates content"| node_content
node_controller -->|"reads and writes"| node_files
node_controller -.->|"manages users"| node_users
node_controller -.->|"manages messages"| node_messages
node_controller -.->|"organizes replies"| node_threads
node_controller -.->|"manages friends"| node_friendships
node_controller -.->|"tracks edits"| node_edit_history
node_controller -->|"uses collections"| node_structures
node_controller -->|"uses sorting"| node_algorithms

click node_menu "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/main.cpp"
click node_controller "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp"
click node_users "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Usuario.h"
click node_channels "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Canal.h"
click node_messages "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Mensaje.h"
click node_threads "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Hilo.h"
click node_content "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/ContenidoMensaje.h"
click node_friendships "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Amistad.h"
click node_notifications "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Notificacion.h"
click node_activity "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/RegistroActividad.h"
click node_edit_history "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp"
click node_structures "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Estructuras.h"
click node_algorithms "https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Algoritmos.h"

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_menu,node_controller,node_operator toneBlue
class node_users,node_channels,node_messages,node_threads,node_content,node_friendships,node_notifications,node_activity,node_edit_history toneAmber
class node_structures,node_algorithms toneMint
class node_files toneRose
```

## Components

### Console entry

- [Interactive menu](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/main.cpp): `SlackVersion0.1/SlackVersion0.1/main.cpp`
- [Slack controller](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp): `SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp`

### Messaging domain

- [Users and roles](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Usuario.h): `SlackVersion0.1/SlackVersion0.1/Usuario.h`
- [Channels](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Canal.h): `SlackVersion0.1/SlackVersion0.1/Canal.h`
- [Messages](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Mensaje.h): `SlackVersion0.1/SlackVersion0.1/Mensaje.h`
- [Conversation threads](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Hilo.h): `SlackVersion0.1/SlackVersion0.1/Hilo.h`
- [Message content](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/ContenidoMensaje.h): `SlackVersion0.1/SlackVersion0.1/ContenidoMensaje.h`
- [Friend connections](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Amistad.h): `SlackVersion0.1/SlackVersion0.1/Amistad.h`
- [Notifications](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Notificacion.h): `SlackVersion0.1/SlackVersion0.1/Notificacion.h`
- [Activity log](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/RegistroActividad.h): `SlackVersion0.1/SlackVersion0.1/RegistroActividad.h`
- [Edit history](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp): `SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp`

### Runtime support

- [Generic structures](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Estructuras.h): `SlackVersion0.1/SlackVersion0.1/Estructuras.h`
- [Sorting algorithms](https://github.com/leoncetos/tb2/blob/main/SlackVersion0.1/SlackVersion0.1/Algoritmos.h): `SlackVersion0.1/SlackVersion0.1/Algoritmos.h`

### Persistence

- **Local data files**

### Other components

- **Console user**

## Connections

- Console user → Interactive menu: selects actions (evidence: `SlackVersion0.1/SlackVersion0.1/main.cpp`)
- Interactive menu → Slack controller: dispatches menus (evidence: `SlackVersion0.1/SlackVersion0.1/main.cpp`)
- Slack controller → Channels: creates channels (evidence: `SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp`)
- Slack controller → Notifications: queues notices (evidence: `SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp`)
- Slack controller → Activity log: records actions (evidence: `SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp`)
- Slack controller → Message content: creates content (evidence: `SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp`)
- Slack controller → Local data files: reads and writes (evidence: `SlackVersion0.1/SlackVersion0.1/SlackSistema.cpp`)
- Slack controller → Users and roles: manages users (evidence: `README.md`)
- Slack controller → Messages: manages messages (evidence: `README.md`)
- Slack controller → Conversation threads: organizes replies (evidence: `README.md`)
- Slack controller → Friend connections: manages friends (evidence: `README.md`)
- Slack controller → Edit history: tracks edits (evidence: `README.md`)
- Slack controller → Generic structures: uses collections
- Slack controller → Sorting algorithms: uses sorting
