# josseth-arroyo-dev/puntolocal-ve-uneti architecture

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

- Interactive diagram: https://gitdiagram.com/josseth-arroyo-dev/puntolocal-ve-uneti
- Repository: https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti

## Overview

PuntoLocal VE is a full-stack point-of-sale and inventory application for small Venezuelan retailers. Staff use the React app to sign in, manage the catalog and stock, record mixed-currency sales, print receipts, and review sales and inventory reports; the Express API applies authentication and role controls and persists operational data in MySQL. BCV rate synchronization and offline/local operation are also major capabilities. The graph follows documented capabilities and shown route/controller/service references; some frontend-to-API and unsampled subsystem links are left unverified rather than inferred.

Main entry points: [`frontend/src/App.tsx`](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/App.tsx) (React application), [`frontend/src/services/httpClient.ts`](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/services/httpClient.ts) (HTTP client), [`backend/src/config/database.ts`](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/config/database.ts) (MySQL / MariaDB), [`frontend/src/pages/PosPage.tsx`](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/PosPage.tsx) (Point of sale)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Storefront"]
  node_app["React application<br/>[App.tsx]"]
  node_authctx["Auth context<br/>[AuthContext.tsx]"]
  node_catalogui["Catalog management<br/>[CatalogPage.tsx]"]
  node_posui["Point of sale<br/>[PosPage.tsx]"]
  node_paymentui["Payment capture"]
  node_receipt["Printable receipt"]
  node_inventoryui["Inventory view<br/>[InventoryPage.tsx]"]
  node_reportsui["Reports and reprints<br/>[ReportsPage.tsx]"]
  node_salesui["Sales history"]
  node_usersui["User administration<br/>[UsersPage.tsx]"]
  node_http["HTTP client<br/>[httpClient.ts]"]
end

subgraph group_api["REST API"]
  node_api["Versioned API<br/>[app.ts]"]
  node_productroutes["Product routes<br/>[product.routes.ts]"]
  node_productctrl["Product controller"]
  node_salectrl["Sales controller<br/>[sale.controller.ts]"]
end

subgraph group_domain["Business services"]
  node_catalogsvc["Catalog services<br/>[product.service.ts]"]
  node_salesvc["Sales processing<br/>[sale.service.ts]"]
  node_inventorysvc["Inventory operations"]
  node_reportsvc["Reporting<br/>[report.service.ts]"]
  node_ratesvc["BCV rate sync"]
end

subgraph group_persistence["Persistence"]
  node_database[("MySQL / MariaDB<br/>[database.ts]")]
  node_salerepo["Sales repository<br/>[sale.repository.ts]"]
  node_productrepo["Product repository"]
end

subgraph group_runtime["Runtime and integrations"]
  node_scheduler["Rate scheduler"]
  node_uploads["Local product images"]
end

node_staff(("Store staff"))
node_bcv["BCV rate service"]

node_staff -.->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"routes to"| node_catalogui
node_app -->|"routes to"| node_posui
node_app -->|"routes to"| node_inventoryui
node_app -->|"routes to"| node_reportsui
node_app -->|"routes to"| node_salesui
node_app -->|"routes to"| node_usersui
node_posui -.->|"collects payment"| node_paymentui
node_reportsui -->|"renders receipt"| node_receipt
node_reportsui -->|"requests data"| node_http
node_catalogui -.->|"requests data"| node_http
node_posui -.->|"submits sale"| node_http
node_http -.->|"calls REST API"| node_api
node_api -->|"mounts routes"| node_productroutes
node_productroutes -->|"dispatches"| node_productctrl
node_productctrl -->|"calls"| node_catalogsvc
node_salectrl -->|"calls"| node_salesvc
node_catalogsvc -->|"uses"| node_productrepo
node_salesvc -->|"uses"| node_salerepo
node_inventorysvc -.->|"accesses"| node_database
node_reportsvc -.->|"accesses"| node_database
node_salerepo -->|"queries"| node_database
node_productrepo -.->|"accesses"| node_database
node_scheduler -.->|"schedules sync"| node_ratesvc
node_ratesvc -.->|"fetches rate"| node_bcv
node_catalogsvc -->|"handles images"| node_uploads

click node_app "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/App.tsx"
click node_authctx "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/context/AuthContext.tsx"
click node_catalogui "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/CatalogPage.tsx"
click node_posui "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/PosPage.tsx"
click node_paymentui "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/components/pos/ProcessPaymentModal.tsx"
click node_receipt "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/components/receipts/SaleReceiptPrint.tsx"
click node_inventoryui "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/InventoryPage.tsx"
click node_reportsui "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/ReportsPage.tsx"
click node_salesui "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/SalesHistoryPage.tsx"
click node_usersui "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/UsersPage.tsx"
click node_http "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/services/httpClient.ts"
click node_api "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/app.ts"
click node_productroutes "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/routes/product.routes.ts"
click node_productctrl "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/controllers/product.controller.ts"
click node_salectrl "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/controllers/sale.controller.ts"
click node_catalogsvc "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/product.service.ts"
click node_salesvc "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/sale.service.ts"
click node_inventorysvc "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/inventory.service.ts"
click node_reportsvc "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/report.service.ts"
click node_ratesvc "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/exchangeRateSync.service.ts"
click node_database "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/config/database.ts"
click node_salerepo "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/repositories/sale.repository.ts"
click node_productrepo "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/repositories/product.repository.ts"
click node_scheduler "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/jobs/exchangeRateScheduler.ts"
click node_uploads "https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/middlewares/upload.middleware.ts"

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_authctx,node_catalogui,node_posui,node_paymentui,node_receipt,node_inventoryui,node_reportsui,node_salesui,node_usersui,node_http toneBlue
class node_api,node_productroutes,node_productctrl,node_salectrl toneAmber
class node_catalogsvc,node_salesvc,node_inventorysvc,node_reportsvc,node_ratesvc toneMint
class node_database,node_salerepo,node_productrepo toneRose
class node_scheduler,node_uploads,node_staff,node_bcv toneIndigo
```

## Components

### Storefront

- [React application](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth context](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Catalog management](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/CatalogPage.tsx): `frontend/src/pages/CatalogPage.tsx`
- [Point of sale](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/PosPage.tsx): `frontend/src/pages/PosPage.tsx`
- [Payment capture](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/components/pos/ProcessPaymentModal.tsx): `frontend/src/components/pos/ProcessPaymentModal.tsx`
- [Printable receipt](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/components/receipts/SaleReceiptPrint.tsx): `frontend/src/components/receipts/SaleReceiptPrint.tsx`
- [Inventory view](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/InventoryPage.tsx): `frontend/src/pages/InventoryPage.tsx`
- [Reports and reprints](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/ReportsPage.tsx): `frontend/src/pages/ReportsPage.tsx`
- [Sales history](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/SalesHistoryPage.tsx): `frontend/src/pages/SalesHistoryPage.tsx`
- [User administration](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/pages/UsersPage.tsx): `frontend/src/pages/UsersPage.tsx`
- [HTTP client](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/frontend/src/services/httpClient.ts): `frontend/src/services/httpClient.ts`

### REST API

- [Versioned API](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Product routes](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/routes/product.routes.ts): `backend/src/routes/product.routes.ts`
- [Product controller](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/controllers/product.controller.ts): `backend/src/controllers/product.controller.ts`
- [Sales controller](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/controllers/sale.controller.ts): `backend/src/controllers/sale.controller.ts`

### Business services

- [Catalog services](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/product.service.ts): `backend/src/services/product.service.ts`
- [Sales processing](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/sale.service.ts): `backend/src/services/sale.service.ts`
- [Inventory operations](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/inventory.service.ts): `backend/src/services/inventory.service.ts`
- [Reporting](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/report.service.ts): `backend/src/services/report.service.ts`
- [BCV rate sync](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/services/exchangeRateSync.service.ts): `backend/src/services/exchangeRateSync.service.ts`

### Persistence

- [MySQL / MariaDB](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/config/database.ts): `backend/src/config/database.ts`
- [Sales repository](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/repositories/sale.repository.ts): `backend/src/repositories/sale.repository.ts`
- [Product repository](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/repositories/product.repository.ts): `backend/src/repositories/product.repository.ts`

### Runtime and integrations

- [Rate scheduler](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/jobs/exchangeRateScheduler.ts): `backend/src/jobs/exchangeRateScheduler.ts`
- [Local product images](https://github.com/josseth-arroyo-dev/puntolocal-ve-uneti/blob/main/backend/src/middlewares/upload.middleware.ts): `backend/src/middlewares/upload.middleware.ts`

### Other components

- **Store staff**
- **BCV rate service**

## Connections

- Store staff → React application: uses
- React application → Auth context: provides auth (evidence: `frontend/src/App.tsx`)
- React application → Catalog management: routes to (evidence: `frontend/src/App.tsx`)
- React application → Point of sale: routes to (evidence: `frontend/src/App.tsx`)
- React application → Inventory view: routes to (evidence: `frontend/src/App.tsx`)
- React application → Reports and reprints: routes to (evidence: `frontend/src/App.tsx`)
- React application → Sales history: routes to (evidence: `frontend/src/App.tsx`)
- React application → User administration: routes to (evidence: `frontend/src/App.tsx`)
- Point of sale → Payment capture: collects payment
- Reports and reprints → Printable receipt: renders receipt (evidence: `frontend/src/pages/ReportsPage.tsx`)
- Reports and reprints → HTTP client: requests data (evidence: `frontend/src/pages/ReportsPage.tsx`)
- Catalog management → HTTP client: requests data
- Point of sale → HTTP client: submits sale
- HTTP client → Versioned API: calls REST API
- Versioned API → Product routes: mounts routes (evidence: `backend/src/app.ts`)
- Product routes → Product controller: dispatches (evidence: `backend/src/routes/product.routes.ts`)
- Product controller → Catalog services: calls (evidence: `backend/src/controllers/product.controller.ts`)
- Sales controller → Sales processing: calls (evidence: `backend/src/controllers/sale.controller.ts`)
- Catalog services → Product repository: uses (evidence: `backend/src/services/product.service.ts`)
- Sales processing → Sales repository: uses (evidence: `backend/src/repositories/sale.repository.ts`)
- Inventory operations → MySQL / MariaDB: accesses
- Reporting → MySQL / MariaDB: accesses
- Sales repository → MySQL / MariaDB: queries (evidence: `backend/src/repositories/sale.repository.ts`)
- Product repository → MySQL / MariaDB: accesses
- Rate scheduler → BCV rate sync: schedules sync
- BCV rate sync → BCV rate service: fetches rate
- Catalog services → Local product images: handles images (evidence: `backend/src/services/product.service.ts`)
