# mssoaress/sistema-mercado-cpp architecture

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

- Interactive diagram: https://gitdiagram.com/mssoaress/sistema-mercado-cpp
- Repository: https://github.com/mssoaress/sistema-mercado-cpp

## Overview

This is a small interactive C market-management program. A user navigates the console menu in `main.c` to manage products or employees; each module keeps records in a fixed-size in-memory array and provides create, list, search, edit, and remove operations. Both modules use `entrada.c` for validated console input. No persistent storage or implemented supplier, inventory, or sales behavior is evident in the sampled files; those files are empty. Edges reflect calls visible in the excerpts.

Main entry points: [`main.c`](https://github.com/mssoaress/sistema-mercado-cpp/blob/main/main.c) (Menu and dispatch), [`entrada.c`](https://github.com/mssoaress/sistema-mercado-cpp/blob/main/entrada.c) (Input validation), [`produtos.c`](https://github.com/mssoaress/sistema-mercado-cpp/blob/main/produtos.c) (Product records), [`funcionarios.c`](https://github.com/mssoaress/sistema-mercado-cpp/blob/main/funcionarios.c) (Employee records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Console application"]
  node_menu["Menu and dispatch<br/>[main.c]"]
end

subgraph group_domains["Record management"]
  node_products["Product records<br/>[produtos.c]"]
  node_employees["Employee records<br/>[funcionarios.c]"]
end

subgraph group_input["Console input"]
  node_input_helpers["Input validation<br/>[entrada.c]"]
end

node_user(("Market operator"))

node_user -->|"chooses options"| node_menu
node_menu -->|"reads choices"| node_input_helpers
node_menu -->|"dispatches product actions"| node_products
node_menu -->|"dispatches employee actions"| node_employees
node_products -->|"reads fields"| node_input_helpers
node_employees -->|"reads fields"| node_input_helpers

click node_menu "https://github.com/mssoaress/sistema-mercado-cpp/blob/main/main.c"
click node_products "https://github.com/mssoaress/sistema-mercado-cpp/blob/main/produtos.c"
click node_employees "https://github.com/mssoaress/sistema-mercado-cpp/blob/main/funcionarios.c"
click node_input_helpers "https://github.com/mssoaress/sistema-mercado-cpp/blob/main/entrada.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_menu toneBlue
class node_products,node_employees toneAmber
class node_input_helpers toneMint
class node_user toneIndigo
```

## Components

### Console application

- [Menu and dispatch](https://github.com/mssoaress/sistema-mercado-cpp/blob/main/main.c): `main.c`

### Record management

- [Product records](https://github.com/mssoaress/sistema-mercado-cpp/blob/main/produtos.c): `produtos.c`
- [Employee records](https://github.com/mssoaress/sistema-mercado-cpp/blob/main/funcionarios.c): `funcionarios.c`

### Console input

- [Input validation](https://github.com/mssoaress/sistema-mercado-cpp/blob/main/entrada.c): `entrada.c`

### Other components

- **Market operator**

## Connections

- Market operator → Menu and dispatch: chooses options (evidence: `main.c`)
- Menu and dispatch → Input validation: reads choices (evidence: `main.c`)
- Menu and dispatch → Product records: dispatches product actions (evidence: `main.c`)
- Menu and dispatch → Employee records: dispatches employee actions (evidence: `main.c`)
- Product records → Input validation: reads fields (evidence: `produtos.c`)
- Employee records → Input validation: reads fields (evidence: `funcionarios.c`)
