# thiagos0/tradefair architecture

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

- Interactive diagram: https://gitdiagram.com/thiagos0/tradefair
- Repository: https://github.com/thiagos0/tradefair

## Overview

TradeFair is a PHP/MySQL system for organizing buyer–supplier product quotations. The documented workflow starts with a client creating a product list, proceeds through supplier invitations and price proposals, and ends with proposal comparison and supplier selection. The graph also preserves the documented client, supplier, product, event/note, dashboard, user, and multilingual capabilities. Several quotation stages are described in the README but their implementation is not clear from the sampled source, so those links are documented rather than inferred from code.

Main entry points: [`includes/menu.php`](https://github.com/thiagos0/tradefair/blob/main/includes/menu.php) (Navigation and language), [`includes/config.php`](https://github.com/thiagos0/tradefair/blob/main/includes/config.php) (MySQL connection), [`lists`](https://github.com/thiagos0/tradefair/tree/main/lists) (Product lists), [`home/index.php`](https://github.com/thiagos0/tradefair/blob/main/home/index.php) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Accounts and dashboard"]
  node_dashboard["Dashboard<br/>[index.php]"]
  node_clients["Client records"]
  node_users["User accounts<br/>[login.php]"]
  node_profile["Profile<br/>[profile.php]"]
end

subgraph group_catalog["Business records"]
  node_suppliers["Suppliers"]
  node_products["Products"]
  node_events["Events and notes"]
end

subgraph group_quotes["Quotation workflow"]
  node_lists["Product lists"]
  node_proposals["Price proposals"]
  node_comparison["Proposal comparison"]
end

subgraph group_shared["Shared services"]
  node_auth["Account helpers<br/>[functions.php]"]
  node_mysqli["MySQL connection<br/>[config.php]"]
  node_pdo["PDO connection<br/>[db.php]"]
  node_navigation["Navigation and language<br/>[menu.php]"]
  node_translations["Language files"]
end

node_buyer(("Client"))
node_supplier(("Participating suppliers"))
node_selection(("Supplier selection"))

node_buyer -->|"creates"| node_lists
node_lists -->|"invites"| node_supplier
node_supplier -->|"submits prices"| node_proposals
node_proposals -->|"compared in"| node_comparison
node_comparison -->|"informs choice"| node_selection
node_dashboard -->|"queries"| node_mysqli
node_clients -->|"queries"| node_mysqli
node_products -->|"queries"| node_mysqli
node_lists -->|"queries"| node_mysqli
node_events -->|"queries"| node_pdo
node_users -->|"authenticates with"| node_auth
node_auth -->|"uses"| node_mysqli
node_dashboard -->|"includes"| node_navigation
node_clients -->|"includes"| node_navigation
node_suppliers -->|"includes"| node_navigation
node_products -->|"includes"| node_navigation
node_lists -->|"includes"| node_navigation
node_events -->|"includes"| node_navigation
node_navigation -.->|"offers languages"| node_translations

click node_dashboard "https://github.com/thiagos0/tradefair/blob/main/home/index.php"
click node_clients "https://github.com/thiagos0/tradefair/tree/main/clients"
click node_users "https://github.com/thiagos0/tradefair/blob/main/login.php"
click node_profile "https://github.com/thiagos0/tradefair/blob/main/home/profile.php"
click node_suppliers "https://github.com/thiagos0/tradefair/tree/main/supplier"
click node_products "https://github.com/thiagos0/tradefair/tree/main/products"
click node_events "https://github.com/thiagos0/tradefair/tree/main/notes"
click node_lists "https://github.com/thiagos0/tradefair/tree/main/lists"
click node_proposals "https://github.com/thiagos0/tradefair/tree/main/lists"
click node_comparison "https://github.com/thiagos0/tradefair/tree/main/lists"
click node_auth "https://github.com/thiagos0/tradefair/blob/main/includes/functions.php"
click node_mysqli "https://github.com/thiagos0/tradefair/blob/main/includes/config.php"
click node_pdo "https://github.com/thiagos0/tradefair/blob/main/includes/db.php"
click node_navigation "https://github.com/thiagos0/tradefair/blob/main/includes/menu.php"
click node_translations "https://github.com/thiagos0/tradefair/tree/main/includes/lang"

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_dashboard,node_clients,node_users,node_profile,node_buyer toneBlue
class node_suppliers,node_products,node_events toneAmber
class node_lists,node_proposals,node_comparison toneMint
class node_auth,node_mysqli,node_pdo,node_navigation,node_translations toneRose
class node_supplier,node_selection toneIndigo
```

## Components

### Accounts and dashboard

- [Dashboard](https://github.com/thiagos0/tradefair/blob/main/home/index.php): `home/index.php`
- [Client records](https://github.com/thiagos0/tradefair/tree/main/clients): `clients`
- [User accounts](https://github.com/thiagos0/tradefair/blob/main/login.php): `login.php`
- [Profile](https://github.com/thiagos0/tradefair/blob/main/home/profile.php): `home/profile.php`

### Business records

- [Suppliers](https://github.com/thiagos0/tradefair/tree/main/supplier): `supplier`
- [Products](https://github.com/thiagos0/tradefair/tree/main/products): `products`
- [Events and notes](https://github.com/thiagos0/tradefair/tree/main/notes): `notes`

### Quotation workflow

- [Product lists](https://github.com/thiagos0/tradefair/tree/main/lists): `lists`
- [Price proposals](https://github.com/thiagos0/tradefair/tree/main/lists): `lists`
- [Proposal comparison](https://github.com/thiagos0/tradefair/tree/main/lists): `lists`

### Shared services

- [Account helpers](https://github.com/thiagos0/tradefair/blob/main/includes/functions.php): `includes/functions.php`
- [MySQL connection](https://github.com/thiagos0/tradefair/blob/main/includes/config.php): `includes/config.php`
- [PDO connection](https://github.com/thiagos0/tradefair/blob/main/includes/db.php): `includes/db.php`
- [Navigation and language](https://github.com/thiagos0/tradefair/blob/main/includes/menu.php): `includes/menu.php`
- [Language files](https://github.com/thiagos0/tradefair/tree/main/includes/lang): `includes/lang`

### Other components

- **Client**
- **Participating suppliers**
- **Supplier selection**

## Connections

- Client → Product lists: creates (evidence: `README.md`)
- Product lists → Participating suppliers: invites (evidence: `README.md`)
- Participating suppliers → Price proposals: submits prices (evidence: `README.md`)
- Price proposals → Proposal comparison: compared in (evidence: `README.md`)
- Proposal comparison → Supplier selection: informs choice (evidence: `README.md`)
- Dashboard → MySQL connection: queries (evidence: `home/index.php`)
- Client records → MySQL connection: queries (evidence: `clients/listagem_cliente.php`)
- Products → MySQL connection: queries (evidence: `products/index.php`)
- Product lists → MySQL connection: queries (evidence: `lists/index.php`)
- Events and notes → PDO connection: queries (evidence: `notes/index.php`)
- User accounts → Account helpers: authenticates with (evidence: `login.php`)
- Account helpers → MySQL connection: uses (evidence: `includes/functions.php`)
- Dashboard → Navigation and language: includes (evidence: `home/index.php`)
- Client records → Navigation and language: includes (evidence: `clients/listagem_cliente.php`)
- Suppliers → Navigation and language: includes (evidence: `supplier/index.php`)
- Products → Navigation and language: includes (evidence: `products/index.php`)
- Product lists → Navigation and language: includes (evidence: `lists/index.php`)
- Events and notes → Navigation and language: includes (evidence: `notes/index.php`)
- Navigation and language → Language files: offers languages
