# juaneem-cmyk/mypproyecto1 architecture

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

- Interactive diagram: https://gitdiagram.com/juaneem-cmyk/mypproyecto1
- Repository: https://github.com/juaneem-cmyk/mypproyecto1

## Overview

This repository implements a small TCP client/server application with JSON-based client identification. The visible workflow is: a user enters a username, the client builds and sends an IDENTIFY message, the server parses it and replies with a RESPONSE, and the client displays the response. The server excerpt shows newline-delimited input buffering and identification handling, but does not establish general chat broadcasting. The README documents no additional capabilities, and server source excerpts are partial.

Main entry points: [`cliente/cliente.cpp`](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/cliente.cpp) (TCP client), [`servidor/main.c`](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/servidor/main.c) (TCP server), [`cliente/main.cpp`](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/main.cpp) (Client entry), [`cliente/controlador.cpp`](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/controlador.cpp) (Message controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_client_entry["Client entry<br/>[main.cpp]"]
  node_client_control["Message controller<br/>[controlador.cpp]"]
  node_tcp_client["TCP client<br/>[cliente.cpp]"]
end

subgraph group_server["Server"]
  node_server_app["TCP server<br/>[main.c]"]
end

subgraph group_protocol["JSON protocol"]
  node_server_protocol["Identification protocol<br/>[protocolo.c]"]
end

node_user(("User"))

node_user -->|"enters username"| node_client_entry
node_client_entry -->|"builds identification"| node_client_control
node_client_entry -->|"connects and sends"| node_tcp_client
node_tcp_client -->|"sends messages"| node_server_app
node_server_app -->|"parses identification"| node_server_protocol
node_server_protocol -->|"returns response JSON"| node_server_app
node_server_app -->|"sends response"| node_tcp_client
node_tcp_client -->|"dispatches received message"| node_client_control
node_client_control -->|"displays response"| node_user

click node_client_entry "https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/main.cpp"
click node_client_control "https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/controlador.cpp"
click node_tcp_client "https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/cliente.cpp"
click node_server_app "https://github.com/juaneem-cmyk/mypproyecto1/blob/main/servidor/main.c"
click node_server_protocol "https://github.com/juaneem-cmyk/mypproyecto1/blob/main/servidor/protocolo.c"

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_client_entry,node_client_control,node_tcp_client,node_user toneBlue
class node_server_app toneAmber
class node_server_protocol toneMint
```

## Components

### Client

- [Client entry](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/main.cpp): `cliente/main.cpp`
- [Message controller](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/controlador.cpp): `cliente/controlador.cpp`
- [TCP client](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/cliente/cliente.cpp): `cliente/cliente.cpp`

### Server

- [TCP server](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/servidor/main.c): `servidor/main.c`

### JSON protocol

- [Identification protocol](https://github.com/juaneem-cmyk/mypproyecto1/blob/main/servidor/protocolo.c): `servidor/protocolo.c`

### Other components

- **User**

## Connections

- User → Client entry: enters username
- Client entry → Message controller: builds identification
- Client entry → TCP client: connects and sends
- TCP client → TCP server: sends messages
- TCP server → Identification protocol: parses identification
- Identification protocol → TCP server: returns response JSON
- TCP server → TCP client: sends response
- TCP client → Message controller: dispatches received message
- Message controller → User: displays response
