# franciscobdev/gestion-inventario-confiteria architecture

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

- Interactive diagram: https://gitdiagram.com/franciscobdev/gestion-inventario-confiteria
- Repository: https://github.com/franciscobdev/gestion-inventario-confiteria

## Overview

Arteconfi is a confectionery inventory and shop-management application with a Django backend and React frontend. Owners sign in to manage stock, sales, orders, suppliers, finances, and reports; customers browse the shop and manage pickup orders. The frontend context coordinates authentication and operational state, with mock data and backend API support indicated by its imports. Backend domain modules cover the corresponding business areas, and the README identifies MariaDB as the database. Backend request-to-model wiring was not sampled, so those links are left unasserted.

Main entry points: [`frontend/src/context/AppContext.jsx`](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/context/AppContext.jsx) (App State), [`frontend/src/App.jsx`](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/App.jsx) (App Routing), [`frontend/src/components/Layout.jsx`](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/components/Layout.jsx) (Admin Layout), [`frontend/src/clientes/clienteApi.js`](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/clientes/clienteApi.js) (Customer API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["App Routing<br/>[App.jsx]"]
  node_layout["Admin Layout<br/>[Layout.jsx]"]
  node_state["App State<br/>[AppContext.jsx]"]
  node_api["API Client<br/>[api.js]"]
  node_mock["Mock Data<br/>[mockData.js]"]
  node_login["Login<br/>[LoginPage.jsx]"]
end

subgraph group_inventory["Inventory Operations"]
  node_inventory_ui["Inventory UI<br/>[InventarioPage.jsx]"]
  node_stock_ui["Stock Exits"]
end

subgraph group_commerce["Commerce"]
  node_orders_ui["Orders UI<br/>[EncargosPage.jsx]"]
  node_store_ui["Public Shop<br/>[TiendaPage.jsx]"]
  node_client_portal["Customer Portal<br/>[ClientePortal.jsx]"]
  node_client_pages["Customer Pages<br/>[ClientePages.jsx]"]
  node_client_api["Customer API<br/>[clienteApi.js]"]
  node_suppliers_ui["Suppliers UI"]
end

subgraph group_insights["Finance and Insights"]
  node_finance_ui["Finance UI<br/>[FinanzasPage.jsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_reports_ui["Reports UI<br/>[ReportesPage.jsx]"]
  node_system_ui["System Settings"]
end

subgraph group_backend["Django Backend"]
  node_products["Product and Lot Management<br/>[models.py]"]
  node_stock_service["Stock Service<br/>[services.py]"]
  node_purchases["Purchases<br/>[views.py]"]
  node_orders["Order Management<br/>[views.py]"]
  node_customers["Customer Accounts<br/>[views.py]"]
  node_suppliers["Purchasing Domain<br/>[views.py]"]
  node_finance["Finance Domain<br/>[views.py]"]
  node_reports["Reports<br/>[views.py]"]
  node_backend_urls["API Routes<br/>[urls.py]"]
  node_database_config["Database Configuration<br/>[settings.py]"]
end

node_owner(("Owner"))
node_customer(("Customer"))
node_mariadb[("MariaDB")]

node_owner -->|"opens"| node_app
node_customer -->|"opens"| node_app
node_app -->|"provides state"| node_state
node_app -->|"routes admin"| node_layout
node_app -->|"routes shop"| node_store_ui
node_app -->|"routes login"| node_login
node_app -->|"routes portal"| node_client_portal
node_layout -.->|"renders route"| node_inventory_ui
node_layout -->|"reads state"| node_state
node_state -->|"calls"| node_api
node_state -->|"loads data"| node_mock
node_login -->|"authenticates via"| node_state
node_client_portal -->|"renders"| node_client_pages
node_client_pages -->|"uses"| node_client_api
node_client_api -.->|"HTTP requests"| node_customers
node_client_api -.->|"HTTP requests"| node_orders
node_state -.->|"backend operations"| node_products
node_state -.->|"backend operations"| node_purchases
node_inventory_ui -->|"reads and updates"| node_state
node_stock_ui -->|"uses state"| node_state
node_orders_ui -->|"uses state"| node_state
node_store_ui -->|"uses state"| node_state
node_suppliers_ui -->|"uses state"| node_state
node_finance_ui -->|"uses state"| node_state
node_dashboard -->|"reads data"| node_state
node_reports_ui -->|"reads data"| node_state
node_state -.->|"stock actions"| node_stock_service
node_stock_service -->|"updates lots and stock"| node_products
node_database_config -->|"configures connection"| node_mariadb
node_backend_urls -.->|"routes requests"| node_products

click node_app "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/App.jsx"
click node_layout "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/components/Layout.jsx"
click node_state "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/context/AppContext.jsx"
click node_api "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/services/api.js"
click node_mock "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/data/mockData.js"
click node_login "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/LoginPage.jsx"
click node_inventory_ui "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/InventarioPage.jsx"
click node_stock_ui "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/SalidasStockPage.jsx"
click node_products "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/gestion/models.py"
click node_stock_service "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/gestion/services.py"
click node_purchases "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/compras/views.py"
click node_orders_ui "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/EncargosPage.jsx"
click node_store_ui "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/TiendaPage.jsx"
click node_client_portal "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/clientes/ClientePortal.jsx"
click node_client_pages "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/clientes/ClientePages.jsx"
click node_client_api "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/clientes/clienteApi.js"
click node_orders "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/encargos/views.py"
click node_customers "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/clientes/views.py"
click node_suppliers_ui "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/ProveedoresPage.jsx"
click node_suppliers "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/compras/views.py"
click node_finance_ui "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/FinanzasPage.jsx"
click node_finance "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/finanzas/views.py"
click node_dashboard "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_reports_ui "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/ReportesPage.jsx"
click node_reports "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/reportes/views.py"
click node_system_ui "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/RespaldosConfigPage.jsx"
click node_backend_urls "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/config/urls.py"
click node_database_config "https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/config/settings.py"

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_layout,node_state,node_api,node_mock,node_login toneBlue
class node_inventory_ui,node_stock_ui,node_mariadb toneAmber
class node_orders_ui,node_store_ui,node_client_portal,node_client_pages,node_client_api,node_suppliers_ui toneMint
class node_finance_ui,node_dashboard,node_reports_ui,node_system_ui toneRose
class node_products,node_stock_service,node_purchases,node_orders,node_customers,node_suppliers,node_finance,node_reports,node_backend_urls,node_database_config,node_owner,node_customer toneIndigo
```

## Components

### Frontend

- [App Routing](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Admin Layout](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/components/Layout.jsx): `frontend/src/components/Layout.jsx`
- [App State](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/context/AppContext.jsx): `frontend/src/context/AppContext.jsx`
- [API Client](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Mock Data](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/data/mockData.js): `frontend/src/data/mockData.js`
- [Login](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/LoginPage.jsx): `frontend/src/pages/LoginPage.jsx`

### Inventory Operations

- [Inventory UI](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/InventarioPage.jsx): `frontend/src/pages/InventarioPage.jsx`
- [Stock Exits](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/SalidasStockPage.jsx): `frontend/src/pages/SalidasStockPage.jsx`

### Commerce

- [Orders UI](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/EncargosPage.jsx): `frontend/src/pages/EncargosPage.jsx`
- [Public Shop](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/TiendaPage.jsx): `frontend/src/pages/TiendaPage.jsx`
- [Customer Portal](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/clientes/ClientePortal.jsx): `frontend/src/clientes/ClientePortal.jsx`
- [Customer Pages](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/clientes/ClientePages.jsx): `frontend/src/clientes/ClientePages.jsx`
- [Customer API](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/clientes/clienteApi.js): `frontend/src/clientes/clienteApi.js`
- [Suppliers UI](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/ProveedoresPage.jsx): `frontend/src/pages/ProveedoresPage.jsx`

### Finance and Insights

- [Finance UI](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/FinanzasPage.jsx): `frontend/src/pages/FinanzasPage.jsx`
- [Dashboard](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Reports UI](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/ReportesPage.jsx): `frontend/src/pages/ReportesPage.jsx`
- [System Settings](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/frontend/src/pages/RespaldosConfigPage.jsx): `frontend/src/pages/RespaldosConfigPage.jsx`

### Django Backend

- [Product and Lot Management](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/gestion/models.py): `backend/apps/gestion/models.py`
- [Stock Service](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/gestion/services.py): `backend/apps/gestion/services.py`
- [Purchases](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/compras/views.py): `backend/apps/compras/views.py`
- [Order Management](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/encargos/views.py): `backend/apps/encargos/views.py`
- [Customer Accounts](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/clientes/views.py): `backend/apps/clientes/views.py`
- [Purchasing Domain](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/compras/views.py): `backend/apps/compras/views.py`
- [Finance Domain](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/finanzas/views.py): `backend/apps/finanzas/views.py`
- [Reports](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/apps/reportes/views.py): `backend/apps/reportes/views.py`
- [API Routes](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/config/urls.py): `backend/config/urls.py`
- [Database Configuration](https://github.com/franciscobdev/gestion-inventario-confiteria/blob/main/backend/config/settings.py): `backend/config/settings.py`

### Other components

- **Owner**
- **Customer**
- **MariaDB**

## Connections

- Owner → App Routing: opens (evidence: `frontend/src/App.jsx`)
- Customer → App Routing: opens (evidence: `frontend/src/App.jsx`)
- App Routing → App State: provides state (evidence: `frontend/src/App.jsx`)
- App Routing → Admin Layout: routes admin (evidence: `frontend/src/App.jsx`)
- App Routing → Public Shop: routes shop (evidence: `frontend/src/App.jsx`)
- App Routing → Login: routes login (evidence: `frontend/src/App.jsx`)
- App Routing → Customer Portal: routes portal (evidence: `frontend/src/App.jsx`)
- Admin Layout → Inventory UI: renders route
- Admin Layout → App State: reads state (evidence: `frontend/src/components/Layout.jsx`)
- App State → API Client: calls (evidence: `frontend/src/context/AppContext.jsx`)
- App State → Mock Data: loads data (evidence: `frontend/src/context/AppContext.jsx`)
- Login → App State: authenticates via (evidence: `frontend/src/pages/LoginPage.jsx`)
- Customer Portal → Customer Pages: renders (evidence: `frontend/src/clientes/ClientePortal.jsx`)
- Customer Pages → Customer API: uses (evidence: `frontend/src/clientes/ClientePages.jsx`)
- Customer API → Customer Accounts: HTTP requests
- Customer API → Order Management: HTTP requests
- App State → Product and Lot Management: backend operations
- App State → Purchases: backend operations
- Inventory UI → App State: reads and updates (evidence: `frontend/src/pages/InventarioPage.jsx`)
- Stock Exits → App State: uses state (evidence: `frontend/src/pages/SalidasStockPage.jsx`)
- Orders UI → App State: uses state (evidence: `frontend/src/pages/EncargosPage.jsx`)
- Public Shop → App State: uses state (evidence: `frontend/src/pages/TiendaPage.jsx`)
- Suppliers UI → App State: uses state (evidence: `frontend/src/pages/ProveedoresPage.jsx`)
- Finance UI → App State: uses state (evidence: `frontend/src/pages/FinanzasPage.jsx`)
- Dashboard → App State: reads data (evidence: `frontend/src/pages/DashboardPage.jsx`)
- Reports UI → App State: reads data (evidence: `frontend/src/pages/ReportesPage.jsx`)
- App State → Stock Service: stock actions
- Stock Service → Product and Lot Management: updates lots and stock (evidence: `backend/apps/gestion/services.py`)
- Database Configuration → MariaDB: configures connection
- API Routes → Product and Lot Management: routes requests
