# anton10-ar/proyecto-optica architecture

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

- Interactive diagram: https://gitdiagram.com/anton10-ar/proyecto-optica
- Repository: https://github.com/anton10-ar/proyecto-optica

## Overview

Ópticas Casimiro is a Django system for optical-shop sales, inventory, cash operations, staff attendance, and administration. A typical staff workflow enters through the web application, then uses the relevant module to record or manage a business operation; sales can draw on inventory and cash services. The README documents the product capabilities, while sampled sources show selected service and view calls. Several module routes and parts of their implementation were not sampled, so the graph omits unverified links rather than inferring them.

Main entry points: [`config/views.py`](https://github.com/anton10-ar/proyecto-optica/blob/main/config/views.py) (Role-aware dashboard), [`inventario/views.py`](https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/views.py) (Inventory operations), [`ventas/views.py`](https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/views.py) (Sales and orders), [`asistencia/views.py`](https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/views.py) (Attendance operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform and administration"]
  node_web["Django web entry<br/>[urls.py]"]
  node_home["Role-aware dashboard<br/>[views.py]"]
  node_accounts["Users and branches<br/>[models.py]"]
  node_account_views["Account administration<br/>[views.py]"]
  node_account_forms["Account forms<br/>[forms.py]"]
  node_rbac["Role permissions<br/>[roles.py]"]
  node_audit["Activity audit<br/>[auditoria.py]"]
end

subgraph group_inventory["Inventory"]
  node_inventory_views["Inventory operations<br/>[views.py]"]
  node_inventory_forms["Inventory forms<br/>[forms.py]"]
  node_inventory_services["Stock movements<br/>[servicios.py]"]
  node_inventory_models["Catalog and stock<br/>[models.py]"]
  node_inventory_reports["Inventory reports<br/>[reportes.py]"]
end

subgraph group_sales["Sales and cash"]
  node_sales_views["Sales and orders<br/>[views.py]"]
  node_sales_forms["Sales forms<br/>[forms.py]"]
  node_sales_services["Sale processing<br/>[servicios.py]"]
  node_sales_models["Customers and sales<br/>[models.py]"]
  node_sales_reports["Sales reports<br/>[reportes.py]"]
  node_cash_views["Cash operations<br/>[views.py]"]
  node_cash_services["Cash session service<br/>[servicios.py]"]
  node_cash_models["Cash sessions<br/>[models.py]"]
end

subgraph group_attendance["Attendance"]
  node_attendance_views["Attendance operations<br/>[views.py]"]
  node_attendance_forms["Attendance forms<br/>[forms.py]"]
  node_attendance_services["Attendance service<br/>[servicios.py]"]
  node_attendance_calc["Attendance calculations<br/>[calculo.py]"]
  node_attendance_models["Schedules and records<br/>[models.py]"]
end

node_staff(("Staff user"))
node_postgres[("PostgreSQL")]

node_staff -->|"uses"| node_web
node_web -->|"routes"| node_home
node_web -->|"routes"| node_account_views
node_home -->|"queries attendance"| node_attendance_services
node_home -->|"checks cash"| node_cash_services
node_home -->|"queries inventory"| node_inventory_reports
node_home -->|"queries sales"| node_sales_models
node_home -->|"queries accounts"| node_accounts
node_home -->|"queries audit"| node_audit
node_account_views -->|"uses"| node_account_forms
node_account_views -->|"queries"| node_accounts
node_account_views -->|"records actions"| node_audit
node_accounts -.->|"assigns roles"| node_rbac
node_inventory_views -->|"uses"| node_inventory_forms
node_inventory_views -->|"calls"| node_inventory_services
node_inventory_views -->|"calls"| node_inventory_reports
node_inventory_views -->|"queries"| node_inventory_models
node_inventory_services -->|"updates stock"| node_inventory_models
node_sales_views -->|"uses"| node_sales_forms
node_sales_views -->|"calls"| node_sales_services
node_sales_views -->|"calls"| node_sales_reports
node_sales_views -->|"queries"| node_sales_models
node_sales_services -->|"records sales"| node_sales_models
node_sales_services -->|"records stock"| node_inventory_services
node_sales_services -->|"records payment"| node_cash_services
node_cash_views -->|"calls"| node_cash_services
node_cash_services -->|"updates sessions"| node_cash_models
node_attendance_views -->|"uses"| node_attendance_forms
node_attendance_views -->|"calls"| node_attendance_services
node_attendance_views -->|"calculates"| node_attendance_calc
node_attendance_views -->|"queries"| node_attendance_models
node_attendance_services -->|"queries"| node_attendance_models
node_attendance_calc -->|"calculates from"| node_attendance_models

click node_web "https://github.com/anton10-ar/proyecto-optica/blob/main/config/urls.py"
click node_home "https://github.com/anton10-ar/proyecto-optica/blob/main/config/views.py"
click node_accounts "https://github.com/anton10-ar/proyecto-optica/blob/main/core/models.py"
click node_account_views "https://github.com/anton10-ar/proyecto-optica/blob/main/core/views.py"
click node_account_forms "https://github.com/anton10-ar/proyecto-optica/blob/main/core/forms.py"
click node_rbac "https://github.com/anton10-ar/proyecto-optica/blob/main/core/roles.py"
click node_audit "https://github.com/anton10-ar/proyecto-optica/blob/main/core/auditoria.py"
click node_inventory_views "https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/views.py"
click node_inventory_forms "https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/forms.py"
click node_inventory_services "https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/servicios.py"
click node_inventory_models "https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/models.py"
click node_inventory_reports "https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/reportes.py"
click node_sales_views "https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/views.py"
click node_sales_forms "https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/forms.py"
click node_sales_services "https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/servicios.py"
click node_sales_models "https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/models.py"
click node_sales_reports "https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/reportes.py"
click node_cash_views "https://github.com/anton10-ar/proyecto-optica/blob/main/caja/views.py"
click node_cash_services "https://github.com/anton10-ar/proyecto-optica/blob/main/caja/servicios.py"
click node_cash_models "https://github.com/anton10-ar/proyecto-optica/blob/main/caja/models.py"
click node_attendance_views "https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/views.py"
click node_attendance_forms "https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/forms.py"
click node_attendance_services "https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/servicios.py"
click node_attendance_calc "https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/calculo.py"
click node_attendance_models "https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/models.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_web,node_home,node_accounts,node_account_views,node_account_forms,node_rbac,node_audit,node_staff toneBlue
class node_inventory_views,node_inventory_forms,node_inventory_services,node_inventory_models,node_inventory_reports,node_postgres toneAmber
class node_sales_views,node_sales_forms,node_sales_services,node_sales_models,node_sales_reports,node_cash_views,node_cash_services,node_cash_models toneMint
class node_attendance_views,node_attendance_forms,node_attendance_services,node_attendance_calc,node_attendance_models toneRose
```

## Components

### Platform and administration

- [Django web entry](https://github.com/anton10-ar/proyecto-optica/blob/main/config/urls.py): `config/urls.py`
- [Role-aware dashboard](https://github.com/anton10-ar/proyecto-optica/blob/main/config/views.py): `config/views.py`
- [Users and branches](https://github.com/anton10-ar/proyecto-optica/blob/main/core/models.py): `core/models.py`
- [Account administration](https://github.com/anton10-ar/proyecto-optica/blob/main/core/views.py): `core/views.py`
- [Account forms](https://github.com/anton10-ar/proyecto-optica/blob/main/core/forms.py): `core/forms.py`
- [Role permissions](https://github.com/anton10-ar/proyecto-optica/blob/main/core/roles.py): `core/roles.py`
- [Activity audit](https://github.com/anton10-ar/proyecto-optica/blob/main/core/auditoria.py): `core/auditoria.py`

### Inventory

- [Inventory operations](https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/views.py): `inventario/views.py`
- [Inventory forms](https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/forms.py): `inventario/forms.py`
- [Stock movements](https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/servicios.py): `inventario/servicios.py`
- [Catalog and stock](https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/models.py): `inventario/models.py`
- [Inventory reports](https://github.com/anton10-ar/proyecto-optica/blob/main/inventario/reportes.py): `inventario/reportes.py`

### Sales and cash

- [Sales and orders](https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/views.py): `ventas/views.py`
- [Sales forms](https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/forms.py): `ventas/forms.py`
- [Sale processing](https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/servicios.py): `ventas/servicios.py`
- [Customers and sales](https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/models.py): `ventas/models.py`
- [Sales reports](https://github.com/anton10-ar/proyecto-optica/blob/main/ventas/reportes.py): `ventas/reportes.py`
- [Cash operations](https://github.com/anton10-ar/proyecto-optica/blob/main/caja/views.py): `caja/views.py`
- [Cash session service](https://github.com/anton10-ar/proyecto-optica/blob/main/caja/servicios.py): `caja/servicios.py`
- [Cash sessions](https://github.com/anton10-ar/proyecto-optica/blob/main/caja/models.py): `caja/models.py`

### Attendance

- [Attendance operations](https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/views.py): `asistencia/views.py`
- [Attendance forms](https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/forms.py): `asistencia/forms.py`
- [Attendance service](https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/servicios.py): `asistencia/servicios.py`
- [Attendance calculations](https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/calculo.py): `asistencia/calculo.py`
- [Schedules and records](https://github.com/anton10-ar/proyecto-optica/blob/main/asistencia/models.py): `asistencia/models.py`

### Other components

- **Staff user**
- **PostgreSQL**

## Connections

- Staff user → Django web entry: uses (evidence: `README.md`)
- Django web entry → Role-aware dashboard: routes (evidence: `config/urls.py`)
- Django web entry → Account administration: routes (evidence: `config/urls.py`)
- Role-aware dashboard → Attendance service: queries attendance (evidence: `config/views.py`)
- Role-aware dashboard → Cash session service: checks cash (evidence: `config/views.py`)
- Role-aware dashboard → Inventory reports: queries inventory (evidence: `config/views.py`)
- Role-aware dashboard → Customers and sales: queries sales (evidence: `config/views.py`)
- Role-aware dashboard → Users and branches: queries accounts (evidence: `config/views.py`)
- Role-aware dashboard → Activity audit: queries audit (evidence: `config/views.py`)
- Account administration → Account forms: uses (evidence: `core/views.py`)
- Account administration → Users and branches: queries (evidence: `core/views.py`)
- Account administration → Activity audit: records actions (evidence: `core/views.py`)
- Users and branches → Role permissions: assigns roles
- Inventory operations → Inventory forms: uses (evidence: `inventario/views.py`)
- Inventory operations → Stock movements: calls (evidence: `inventario/views.py`)
- Inventory operations → Inventory reports: calls (evidence: `inventario/views.py`)
- Inventory operations → Catalog and stock: queries (evidence: `inventario/views.py`)
- Stock movements → Catalog and stock: updates stock (evidence: `inventario/servicios.py`)
- Sales and orders → Sales forms: uses (evidence: `ventas/views.py`)
- Sales and orders → Sale processing: calls (evidence: `ventas/views.py`)
- Sales and orders → Sales reports: calls (evidence: `ventas/views.py`)
- Sales and orders → Customers and sales: queries (evidence: `ventas/views.py`)
- Sale processing → Customers and sales: records sales (evidence: `ventas/servicios.py`)
- Sale processing → Stock movements: records stock (evidence: `ventas/servicios.py`)
- Sale processing → Cash session service: records payment (evidence: `ventas/servicios.py`)
- Cash operations → Cash session service: calls (evidence: `caja/views.py`)
- Cash session service → Cash sessions: updates sessions (evidence: `caja/servicios.py`)
- Attendance operations → Attendance forms: uses (evidence: `asistencia/views.py`)
- Attendance operations → Attendance service: calls (evidence: `asistencia/views.py`)
- Attendance operations → Attendance calculations: calculates (evidence: `asistencia/views.py`)
- Attendance operations → Schedules and records: queries (evidence: `asistencia/views.py`)
- Attendance service → Schedules and records: queries (evidence: `asistencia/servicios.py`)
- Attendance calculations → Schedules and records: calculates from (evidence: `asistencia/calculo.py`)
