# joaovitoralbernaz/farmasic_system architecture

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

- Interactive diagram: https://gitdiagram.com/joaovitoralbernaz/farmasic_system
- Repository: https://github.com/joaovitoralbernaz/farmasic_system

## Overview

Farmasic System is a browser-based pharmacy management application served by an Express/SQLite backend. Users manage customers, employees, suppliers and products, record sales, and view reports; the sampled UI code calls JSON endpoints, while the server owns request handling and database operations. Movement-form controls are also present, but their persistence behavior is not evidenced. README and excerpts are sparse, so unsampled backend capabilities are included only where the visible UI suggests them, and uncertain connections are omitted.

Main entry points: [`public`](https://github.com/joaovitoralbernaz/farmasic_system/tree/main/public) (Static web pages), [`index.js`](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js) (Express server and routes), [`public/js/vendas.js`](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/vendas.js) (Sales and cart UI), [`public/js/cliente.js`](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/cliente.js) (Customer records UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser interface"]
  node_web["Static web pages"]
  node_navigation["Mobile navigation<br/>[index.js]"]
  node_customerui["Customer records UI<br/>[cliente.js]"]
  node_employeeui["Employee records UI<br/>[funcionario.js]"]
  node_supplierui["Supplier records UI<br/>[fornecedor.js]"]
  node_productui["Product records UI<br/>[produto.js]"]
  node_salesui["Sales and cart UI<br/>[vendas.js]"]
  node_movementui["Movement form controls<br/>[movimento.js]"]
  node_reportui["Report selection UI<br/>[relatorio.js]"]
end

subgraph group_api["Application API"]
  node_server["Express server and routes<br/>[index.js]"]
  node_customerapi["Customer operations<br/>[index.js]"]
  node_employeeapi["Employee operations<br/>[index.js]"]
  node_supplierapi["Supplier operations<br/>[index.js]"]
  node_productapi["Product operations<br/>[index.js]"]
  node_salesapi["Sales operations<br/>[index.js]"]
  node_reportapi["Report queries<br/>[index.js]"]
end

subgraph group_data["SQLite data"]
  node_sqlite[("SQLite database<br/>[index.js]")]
end

node_user(("Pharmacy staff"))

node_user -->|"uses"| node_web
node_web -.->|"loads script"| node_navigation
node_web -.->|"loads script"| node_customerui
node_web -.->|"loads script"| node_employeeui
node_web -.->|"loads script"| node_supplierui
node_web -.->|"loads script"| node_productui
node_web -.->|"loads script"| node_salesui
node_web -.->|"loads script"| node_movementui
node_web -.->|"loads script"| node_reportui
node_customerui -->|"HTTP requests"| node_customerapi
node_employeeui -->|"HTTP requests"| node_employeeapi
node_supplierui -->|"HTTP requests"| node_supplierapi
node_productui -->|"HTTP requests"| node_productapi
node_salesui -->|"submits sale"| node_salesapi
node_salesui -->|"looks up customer"| node_customerapi
node_salesui -->|"looks up products"| node_productapi
node_salesui -->|"requests report"| node_reportapi
node_reportui -.->|"requests report"| node_reportapi
node_server -->|"routes requests"| node_customerapi
node_server -->|"routes requests"| node_employeeapi
node_server -->|"routes requests"| node_supplierapi
node_server -->|"routes requests"| node_productapi
node_server -.->|"routes requests"| node_salesapi
node_server -.->|"routes requests"| node_reportapi
node_customerapi -->|"reads and writes"| node_sqlite
node_employeeapi -->|"reads and writes"| node_sqlite
node_supplierapi -->|"reads and writes"| node_sqlite
node_productapi -->|"reads and writes"| node_sqlite
node_salesapi -.->|"reads and writes"| node_sqlite
node_reportapi -.->|"queries records"| node_sqlite

click node_web "https://github.com/joaovitoralbernaz/farmasic_system/tree/main/public"
click node_navigation "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/index.js"
click node_customerui "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/cliente.js"
click node_employeeui "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/funcionario.js"
click node_supplierui "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/fornecedor.js"
click node_productui "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/produto.js"
click node_salesui "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/vendas.js"
click node_movementui "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/movimento.js"
click node_reportui "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/relatorio.js"
click node_server "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js"
click node_customerapi "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js"
click node_employeeapi "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js"
click node_supplierapi "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js"
click node_productapi "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js"
click node_salesapi "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js"
click node_reportapi "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js"
click node_sqlite "https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js"

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_web,node_navigation,node_customerui,node_employeeui,node_supplierui,node_productui,node_salesui,node_movementui,node_reportui toneBlue
class node_server,node_customerapi,node_employeeapi,node_supplierapi,node_productapi,node_salesapi,node_reportapi toneAmber
class node_sqlite toneMint
class node_user toneIndigo
```

## Components

### Browser interface

- [Static web pages](https://github.com/joaovitoralbernaz/farmasic_system/tree/main/public): `public`
- [Mobile navigation](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/index.js): `public/js/index.js`
- [Customer records UI](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/cliente.js): `public/js/cliente.js`
- [Employee records UI](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/funcionario.js): `public/js/funcionario.js`
- [Supplier records UI](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/fornecedor.js): `public/js/fornecedor.js`
- [Product records UI](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/produto.js): `public/js/produto.js`
- [Sales and cart UI](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/vendas.js): `public/js/vendas.js`
- [Movement form controls](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/movimento.js): `public/js/movimento.js`
- [Report selection UI](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/public/js/relatorio.js): `public/js/relatorio.js`

### Application API

- [Express server and routes](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js): `index.js`
- [Customer operations](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js): `index.js`
- [Employee operations](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js): `index.js`
- [Supplier operations](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js): `index.js`
- [Product operations](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js): `index.js`
- [Sales operations](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js): `index.js`
- [Report queries](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js): `index.js`

### SQLite data

- [SQLite database](https://github.com/joaovitoralbernaz/farmasic_system/blob/main/index.js): `index.js`

### Other components

- **Pharmacy staff**

## Connections

- Pharmacy staff → Static web pages: uses
- Static web pages → Mobile navigation: loads script
- Static web pages → Customer records UI: loads script
- Static web pages → Employee records UI: loads script
- Static web pages → Supplier records UI: loads script
- Static web pages → Product records UI: loads script
- Static web pages → Sales and cart UI: loads script
- Static web pages → Movement form controls: loads script
- Static web pages → Report selection UI: loads script
- Customer records UI → Customer operations: HTTP requests (evidence: `public/js/cliente.js`)
- Employee records UI → Employee operations: HTTP requests (evidence: `public/js/funcionario.js`)
- Supplier records UI → Supplier operations: HTTP requests (evidence: `public/js/fornecedor.js`)
- Product records UI → Product operations: HTTP requests (evidence: `public/js/produto.js`)
- Sales and cart UI → Sales operations: submits sale (evidence: `public/js/vendas.js`)
- Sales and cart UI → Customer operations: looks up customer (evidence: `public/js/vendas.js`)
- Sales and cart UI → Product operations: looks up products (evidence: `public/js/vendas.js`)
- Sales and cart UI → Report queries: requests report (evidence: `public/js/vendas.js`)
- Report selection UI → Report queries: requests report
- Express server and routes → Customer operations: routes requests (evidence: `index.js`)
- Express server and routes → Employee operations: routes requests (evidence: `index.js`)
- Express server and routes → Supplier operations: routes requests (evidence: `index.js`)
- Express server and routes → Product operations: routes requests (evidence: `index.js`)
- Express server and routes → Sales operations: routes requests (evidence: `index.js`)
- Express server and routes → Report queries: routes requests (evidence: `index.js`)
- Customer operations → SQLite database: reads and writes (evidence: `index.js`)
- Employee operations → SQLite database: reads and writes (evidence: `index.js`)
- Supplier operations → SQLite database: reads and writes (evidence: `index.js`)
- Product operations → SQLite database: reads and writes (evidence: `index.js`)
- Sales operations → SQLite database: reads and writes (evidence: `index.js`)
- Report queries → SQLite database: queries records (evidence: `index.js`)
