# luke2905/sistema-avivar architecture

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

- Interactive diagram: https://gitdiagram.com/luke2905/sistema-avivar
- Repository: https://github.com/luke2905/sistema-avivar

## Overview

Avivar is a browser-based operations and management interface for orders, products, inventory, production, purchasing, finance, and Shopee integration. Users sign in, enter a protected workspace, and use routed pages to manage these workflows; pages call a shared authenticated API client. The excerpts show specific order, purchasing, and product-specification actions, while the source index documents additional page-to-API and page-to-modal dependencies. The README is a generic Vite template, so product capabilities are inferred from the source tree; backend behavior is not shown.

Main entry points: [`src/App.tsx`](https://github.com/luke2905/sistema-avivar/blob/main/src/App.tsx) (Route manager), [`src/services/api.ts`](https://github.com/luke2905/sistema-avivar/blob/main/src/services/api.ts) (Authenticated API client), [`src/pages/PedidosLista.tsx`](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/PedidosLista.tsx) (Order list), [`src/pages/Dashboard.tsx`](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Dashboard.tsx) (Operations dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and orders"]
  node_app["Route manager<br/>[App.tsx]"]
  node_login["Sign in<br/>[Login.tsx]"]
  node_home["Home<br/>[Home.tsx]"]
  node_dashboard["Operations dashboard<br/>[Dashboard.tsx]"]
  node_orders["Order list<br/>[PedidosLista.tsx]"]
  node_neworder["Order editor"]
  node_orderdetails["Order details"]
  node_print["Printable order<br/>[ImpressoPedido.tsx]"]
  node_artwork["Order artwork manager"]
end

subgraph group_inventory["Inventory and production"]
  node_products["Products<br/>[Produtos.tsx]"]
  node_stock["Inventory<br/>[Estoque.tsx]"]
  node_kardex["Stock movements<br/>[Kardex.tsx]"]
  node_production["Production<br/>[ProducaoGerar.tsx]"]
  node_scanner["Production scanner"]
  node_spec["Product recipe"]
  node_predictions["Predictions<br/>[Predicoes.tsx]"]
end

subgraph group_finance["Finance and purchasing"]
  node_purchases["Purchases<br/>[Compras.tsx]"]
  node_invoices["Supplier invoices<br/>[NotasFiscais.tsx]"]
  node_expenses["Expenses<br/>[Despesas.tsx]"]
  node_financepage["Finance<br/>[Financeiro.tsx]"]
  node_cashflow["Cash flow<br/>[FluxoCaixa.tsx]"]
  node_purchasemodal["Purchase editor"]
end

subgraph group_marketplace["Shopee integration"]
  node_shopeeconfig["Shopee settings"]
  node_shopeesync["Shopee sync monitor"]
end

subgraph group_shared["Shared services"]
  node_api["Authenticated API client<br/>[api.ts]"]
  node_export["Report exports<br/>[exportUtils.ts]"]
end

node_user(("User"))
node_backend["Avivar backend"]

node_user -->|"signs in"| node_login
node_user -->|"opens workspace"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_orders
node_app -->|"routes to"| node_products
node_app -->|"routes to"| node_stock
node_app -->|"routes to"| node_kardex
node_app -->|"routes to"| node_production
node_app -->|"routes to"| node_scanner
node_app -->|"routes to"| node_predictions
node_app -->|"routes to"| node_purchases
node_app -->|"routes to"| node_invoices
node_app -->|"routes to"| node_expenses
node_app -->|"routes to"| node_financepage
node_app -->|"routes to"| node_cashflow
node_app -->|"routes to"| node_shopeeconfig
node_app -->|"routes to"| node_shopeesync
node_orders -->|"opens editor"| node_neworder
node_orders -->|"opens details"| node_orderdetails
node_dashboard -->|"opens editor"| node_neworder
node_dashboard -->|"opens details"| node_orderdetails
node_orderdetails -->|"renders for printing"| node_print
node_orderdetails -->|"renders manager"| node_artwork
node_orders -->|"requests data"| node_api
node_neworder -->|"saves order"| node_api
node_dashboard -->|"loads data"| node_api
node_products -->|"requests data"| node_api
node_stock -->|"requests data"| node_api
node_kardex -->|"requests data"| node_api
node_production -->|"requests data"| node_api
node_scanner -->|"requests data"| node_api
node_spec -->|"reads and updates"| node_api
node_purchases -->|"requests data"| node_api
node_invoices -->|"requests data"| node_api
node_purchasemodal -->|"saves purchase"| node_api
node_expenses -->|"requests data"| node_api
node_financepage -->|"requests data"| node_api
node_cashflow -->|"requests data"| node_api
node_predictions -->|"requests data"| node_api
node_shopeeconfig -->|"requests data"| node_api
node_shopeesync -->|"requests data"| node_api
node_login -->|"authenticates"| node_api
node_api -->|"sends API requests"| node_backend
node_financepage -->|"exports reports"| node_export
node_orders -->|"exports orders"| node_export
node_purchases -->|"opens editor"| node_purchasemodal

click node_app "https://github.com/luke2905/sistema-avivar/blob/main/src/App.tsx"
click node_login "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Login.tsx"
click node_home "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Home.tsx"
click node_dashboard "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Dashboard.tsx"
click node_orders "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/PedidosLista.tsx"
click node_neworder "https://github.com/luke2905/sistema-avivar/blob/main/src/components/ModalNovoPedido.tsx"
click node_orderdetails "https://github.com/luke2905/sistema-avivar/blob/main/src/components/ModalDetalhesPedido.tsx"
click node_products "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Produtos.tsx"
click node_stock "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Estoque.tsx"
click node_kardex "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Kardex.tsx"
click node_production "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/ProducaoGerar.tsx"
click node_scanner "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/ProducaoScanner.tsx"
click node_spec "https://github.com/luke2905/sistema-avivar/blob/main/src/components/ModalFichaTecnica.tsx"
click node_purchases "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Compras.tsx"
click node_invoices "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/NotasFiscais.tsx"
click node_expenses "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Despesas.tsx"
click node_financepage "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Financeiro.tsx"
click node_cashflow "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/FluxoCaixa.tsx"
click node_predictions "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Predicoes.tsx"
click node_shopeeconfig "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/ConfiguracaoShopee.tsx"
click node_shopeesync "https://github.com/luke2905/sistema-avivar/blob/main/src/pages/SincronizacaoShopee.tsx"
click node_api "https://github.com/luke2905/sistema-avivar/blob/main/src/services/api.ts"
click node_export "https://github.com/luke2905/sistema-avivar/blob/main/src/utils/exportUtils.ts"
click node_print "https://github.com/luke2905/sistema-avivar/blob/main/src/components/ImpressoPedido.tsx"
click node_artwork "https://github.com/luke2905/sistema-avivar/blob/main/src/components/GerenciadorArtes.tsx"
click node_purchasemodal "https://github.com/luke2905/sistema-avivar/blob/main/src/components/ModalNovaCompra.tsx"

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_app,node_login,node_home,node_dashboard,node_orders,node_neworder,node_orderdetails,node_print,node_artwork,node_user toneBlue
class node_products,node_stock,node_kardex,node_production,node_scanner,node_spec,node_predictions toneAmber
class node_purchases,node_invoices,node_expenses,node_financepage,node_cashflow,node_purchasemodal toneMint
class node_shopeeconfig,node_shopeesync toneRose
class node_api,node_export,node_backend toneIndigo
```

## Components

### Access and orders

- [Route manager](https://github.com/luke2905/sistema-avivar/blob/main/src/App.tsx): `src/App.tsx`
- [Sign in](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Home](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Operations dashboard](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Order list](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/PedidosLista.tsx): `src/pages/PedidosLista.tsx`
- [Order editor](https://github.com/luke2905/sistema-avivar/blob/main/src/components/ModalNovoPedido.tsx): `src/components/ModalNovoPedido.tsx`
- [Order details](https://github.com/luke2905/sistema-avivar/blob/main/src/components/ModalDetalhesPedido.tsx): `src/components/ModalDetalhesPedido.tsx`
- [Printable order](https://github.com/luke2905/sistema-avivar/blob/main/src/components/ImpressoPedido.tsx): `src/components/ImpressoPedido.tsx`
- [Order artwork manager](https://github.com/luke2905/sistema-avivar/blob/main/src/components/GerenciadorArtes.tsx): `src/components/GerenciadorArtes.tsx`

### Inventory and production

- [Products](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Produtos.tsx): `src/pages/Produtos.tsx`
- [Inventory](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Estoque.tsx): `src/pages/Estoque.tsx`
- [Stock movements](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Kardex.tsx): `src/pages/Kardex.tsx`
- [Production](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/ProducaoGerar.tsx): `src/pages/ProducaoGerar.tsx`
- [Production scanner](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/ProducaoScanner.tsx): `src/pages/ProducaoScanner.tsx`
- [Product recipe](https://github.com/luke2905/sistema-avivar/blob/main/src/components/ModalFichaTecnica.tsx): `src/components/ModalFichaTecnica.tsx`
- [Predictions](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Predicoes.tsx): `src/pages/Predicoes.tsx`

### Finance and purchasing

- [Purchases](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Compras.tsx): `src/pages/Compras.tsx`
- [Supplier invoices](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/NotasFiscais.tsx): `src/pages/NotasFiscais.tsx`
- [Expenses](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Despesas.tsx): `src/pages/Despesas.tsx`
- [Finance](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/Financeiro.tsx): `src/pages/Financeiro.tsx`
- [Cash flow](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/FluxoCaixa.tsx): `src/pages/FluxoCaixa.tsx`
- [Purchase editor](https://github.com/luke2905/sistema-avivar/blob/main/src/components/ModalNovaCompra.tsx): `src/components/ModalNovaCompra.tsx`

### Shopee integration

- [Shopee settings](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/ConfiguracaoShopee.tsx): `src/pages/ConfiguracaoShopee.tsx`
- [Shopee sync monitor](https://github.com/luke2905/sistema-avivar/blob/main/src/pages/SincronizacaoShopee.tsx): `src/pages/SincronizacaoShopee.tsx`

### Shared services

- [Authenticated API client](https://github.com/luke2905/sistema-avivar/blob/main/src/services/api.ts): `src/services/api.ts`
- [Report exports](https://github.com/luke2905/sistema-avivar/blob/main/src/utils/exportUtils.ts): `src/utils/exportUtils.ts`

### Other components

- **User**
- **Avivar backend**

## Connections

- User → Sign in: signs in
- User → Route manager: opens workspace (evidence: `src/App.tsx`)
- Route manager → Sign in: routes to (evidence: `src/App.tsx`)
- Route manager → Home: routes to (evidence: `src/App.tsx`)
- Route manager → Operations dashboard: routes to (evidence: `src/App.tsx`)
- Route manager → Order list: routes to (evidence: `src/App.tsx`)
- Route manager → Products: routes to (evidence: `src/App.tsx`)
- Route manager → Inventory: routes to (evidence: `src/App.tsx`)
- Route manager → Stock movements: routes to (evidence: `src/App.tsx`)
- Route manager → Production: routes to (evidence: `src/App.tsx`)
- Route manager → Production scanner: routes to (evidence: `src/App.tsx`)
- Route manager → Predictions: routes to (evidence: `src/App.tsx`)
- Route manager → Purchases: routes to (evidence: `src/App.tsx`)
- Route manager → Supplier invoices: routes to (evidence: `src/App.tsx`)
- Route manager → Expenses: routes to (evidence: `src/App.tsx`)
- Route manager → Finance: routes to (evidence: `src/App.tsx`)
- Route manager → Cash flow: routes to (evidence: `src/App.tsx`)
- Route manager → Shopee settings: routes to (evidence: `src/App.tsx`)
- Route manager → Shopee sync monitor: routes to (evidence: `src/App.tsx`)
- Order list → Order editor: opens editor (evidence: `src/pages/PedidosLista.tsx`)
- Order list → Order details: opens details (evidence: `src/pages/PedidosLista.tsx`)
- Operations dashboard → Order editor: opens editor (evidence: `src/pages/Dashboard.tsx`)
- Operations dashboard → Order details: opens details (evidence: `src/pages/Dashboard.tsx`)
- Order details → Printable order: renders for printing (evidence: `src/components/ModalDetalhesPedido.tsx`)
- Order details → Order artwork manager: renders manager (evidence: `src/components/ModalDetalhesPedido.tsx`)
- Order list → Authenticated API client: requests data (evidence: `src/pages/PedidosLista.tsx`)
- Order editor → Authenticated API client: saves order (evidence: `src/components/ModalNovoPedido.tsx`)
- Operations dashboard → Authenticated API client: loads data (evidence: `src/pages/Dashboard.tsx`)
- Products → Authenticated API client: requests data (evidence: `src/pages/Produtos.tsx`)
- Inventory → Authenticated API client: requests data (evidence: `src/pages/Estoque.tsx`)
- Stock movements → Authenticated API client: requests data (evidence: `src/pages/Kardex.tsx`)
- Production → Authenticated API client: requests data (evidence: `src/pages/ProducaoGerar.tsx`)
- Production scanner → Authenticated API client: requests data (evidence: `src/pages/ProducaoScanner.tsx`)
- Product recipe → Authenticated API client: reads and updates (evidence: `src/components/ModalFichaTecnica.tsx`)
- Purchases → Authenticated API client: requests data (evidence: `src/pages/Compras.tsx`)
- Supplier invoices → Authenticated API client: requests data (evidence: `src/pages/NotasFiscais.tsx`)
- Purchase editor → Authenticated API client: saves purchase (evidence: `src/components/ModalNovaCompra.tsx`)
- Expenses → Authenticated API client: requests data (evidence: `src/pages/Despesas.tsx`)
- Finance → Authenticated API client: requests data (evidence: `src/pages/Financeiro.tsx`)
- Cash flow → Authenticated API client: requests data (evidence: `src/pages/FluxoCaixa.tsx`)
- Predictions → Authenticated API client: requests data (evidence: `src/pages/Predicoes.tsx`)
- Shopee settings → Authenticated API client: requests data (evidence: `src/pages/ConfiguracaoShopee.tsx`)
- Shopee sync monitor → Authenticated API client: requests data (evidence: `src/pages/SincronizacaoShopee.tsx`)
- Sign in → Authenticated API client: authenticates (evidence: `src/pages/Login.tsx`)
- Authenticated API client → Avivar backend: sends API requests (evidence: `src/services/api.ts`)
- Finance → Report exports: exports reports (evidence: `src/pages/Financeiro.tsx`)
- Order list → Report exports: exports orders (evidence: `src/pages/PedidosLista.tsx`)
- Purchases → Purchase editor: opens editor (evidence: `src/pages/Compras.tsx`)
