# f0derecka/safari-pilar architecture

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

- Interactive diagram: https://gitdiagram.com/f0derecka/safari-pilar
- Repository: https://github.com/f0derecka/safari-pilar

## Overview

Venta Safari is a Django web application for Parque Safari’s food-service operations. Staff use role-specific screens to manage sales, cash registers, tables and orders; kitchen and bar teams track preparation, while administrators oversee locations, personnel and reporting. The data model is the shared persistence layer. The README identifies these capabilities and the source index confirms the main implementation modules, but sampled excerpts do not expose URL-to-view dispatch or most browser-to-server requests; those links are therefore omitted or marked unverified.

Main entry points: [`ventas/views.py`](https://github.com/f0derecka/safari-pilar/blob/main/ventas/views.py) (Business workflows), [`ventas/models.py`](https://github.com/f0derecka/safari-pilar/blob/main/ventas/models.py) (Domain records), [`ventas/privacy_views.py`](https://github.com/f0derecka/safari-pilar/blob/main/ventas/privacy_views.py) (Privacy workflows), [`ventas/security.py`](https://github.com/f0derecka/safari-pilar/blob/main/ventas/security.py) (Security services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and security"]
  node_login["Login screens<br/>[login.js]"]
  node_security["Security services<br/>[security.py]"]
  node_middleware["Session middleware<br/>[middleware.py]"]
end

subgraph group_operations["Sales operations"]
  node_sales["POS and sales<br/>[vendedor.js]"]
  node_ticketing["Ticket creation<br/>[crear_ticket.js]"]
  node_waiter["Waiter service<br/>[mesero.js]"]
  node_business["Business workflows<br/>[views.py]"]
  node_rules["Financial utilities<br/>[utils.py]"]
end

subgraph group_preparation["Order preparation"]
  node_kitchen["Kitchen KDS<br/>[cocina.js]"]
  node_bar["Bar KDS<br/>[barra.js]"]
  node_domain["Order and ticket rules<br/>[utils.py]"]
end

subgraph group_administration["Administration"]
  node_adminui["Admin screens<br/>[dashboard.js]"]
  node_adminwork["Administration workflows<br/>[views.py]"]
  node_seed["Demo data setup<br/>[poblar_safari.py]"]
end

subgraph group_oversight["Privacy and reporting"]
  node_privacy["Privacy workflows<br/>[privacy_views.py]"]
  node_reports["Report exports"]
end

node_staff(("Staff users"))
node_webapp["Django application<br/>[settings.py]"]
node_models[("Domain records<br/>[models.py]")]
node_db[("Configured database")]

node_staff -->|"uses"| node_login
node_staff -->|"operates POS"| node_sales
node_staff -->|"sends orders"| node_waiter
node_staff -->|"prepares orders"| node_kitchen
node_staff -->|"oversees sites"| node_adminui
node_webapp -.->|"hosts workflows"| node_business
node_business -->|"reads and writes"| node_models
node_business -->|"uses"| node_rules
node_business -->|"uses"| node_security
node_business -->|"generates exports"| node_reports
node_business -.->|"handles admin"| node_adminwork
node_business -.->|"handles privacy"| node_privacy
node_sales -.->|"submits sales"| node_business
node_ticketing -.->|"submits tickets"| node_business
node_waiter -.->|"submits orders"| node_business
node_kitchen -.->|"updates status"| node_business
node_bar -.->|"updates status"| node_business
node_business -->|"uses"| node_domain
node_domain -->|"updates orders"| node_models
node_adminui -.->|"manages operations"| node_adminwork
node_adminwork -->|"reads and writes"| node_models
node_seed -->|"populates records"| node_models
node_privacy -->|"records privacy data"| node_models
node_privacy -->|"uses safeguards"| node_security
node_reports -->|"queries sales"| node_models
node_models -->|"persists records"| node_db
node_middleware -->|"uses"| node_security
node_middleware -->|"checks requests"| node_business

click node_webapp "https://github.com/f0derecka/safari-pilar/blob/main/Venta_safari/settings.py"
click node_login "https://github.com/f0derecka/safari-pilar/blob/main/static/js/acceso/login.js"
click node_security "https://github.com/f0derecka/safari-pilar/blob/main/ventas/security.py"
click node_middleware "https://github.com/f0derecka/safari-pilar/blob/main/ventas/middleware.py"
click node_sales "https://github.com/f0derecka/safari-pilar/blob/main/static/js/cajero/vendedor.js"
click node_ticketing "https://github.com/f0derecka/safari-pilar/blob/main/static/js/cajero/crear_ticket.js"
click node_waiter "https://github.com/f0derecka/safari-pilar/blob/main/static/js/mesero/mesero.js"
click node_business "https://github.com/f0derecka/safari-pilar/blob/main/ventas/views.py"
click node_rules "https://github.com/f0derecka/safari-pilar/blob/main/ventas/utils.py"
click node_kitchen "https://github.com/f0derecka/safari-pilar/blob/main/static/js/kds/cocina.js"
click node_bar "https://github.com/f0derecka/safari-pilar/blob/main/static/js/kds/barra.js"
click node_domain "https://github.com/f0derecka/safari-pilar/blob/main/ventas/utils.py"
click node_adminui "https://github.com/f0derecka/safari-pilar/blob/main/static/js/administrador/dashboard.js"
click node_adminwork "https://github.com/f0derecka/safari-pilar/blob/main/ventas/views.py"
click node_seed "https://github.com/f0derecka/safari-pilar/blob/main/ventas/management/commands/poblar_safari.py"
click node_privacy "https://github.com/f0derecka/safari-pilar/blob/main/ventas/privacy_views.py"
click node_reports "https://github.com/f0derecka/safari-pilar/blob/main/ventas/exportador_reportes.py"
click node_models "https://github.com/f0derecka/safari-pilar/blob/main/ventas/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_login,node_security,node_middleware,node_staff toneBlue
class node_sales,node_ticketing,node_waiter,node_business,node_rules,node_models,node_db toneAmber
class node_kitchen,node_bar,node_domain toneMint
class node_adminui,node_adminwork,node_seed toneRose
class node_privacy,node_reports toneIndigo
class node_webapp toneTeal
```

## Components

### Access and security

- [Login screens](https://github.com/f0derecka/safari-pilar/blob/main/static/js/acceso/login.js): `static/js/acceso/login.js`
- [Security services](https://github.com/f0derecka/safari-pilar/blob/main/ventas/security.py): `ventas/security.py`
- [Session middleware](https://github.com/f0derecka/safari-pilar/blob/main/ventas/middleware.py): `ventas/middleware.py`

### Sales operations

- [POS and sales](https://github.com/f0derecka/safari-pilar/blob/main/static/js/cajero/vendedor.js): `static/js/cajero/vendedor.js`
- [Ticket creation](https://github.com/f0derecka/safari-pilar/blob/main/static/js/cajero/crear_ticket.js): `static/js/cajero/crear_ticket.js`
- [Waiter service](https://github.com/f0derecka/safari-pilar/blob/main/static/js/mesero/mesero.js): `static/js/mesero/mesero.js`
- [Business workflows](https://github.com/f0derecka/safari-pilar/blob/main/ventas/views.py): `ventas/views.py`
- [Financial utilities](https://github.com/f0derecka/safari-pilar/blob/main/ventas/utils.py): `ventas/utils.py`

### Order preparation

- [Kitchen KDS](https://github.com/f0derecka/safari-pilar/blob/main/static/js/kds/cocina.js): `static/js/kds/cocina.js`
- [Bar KDS](https://github.com/f0derecka/safari-pilar/blob/main/static/js/kds/barra.js): `static/js/kds/barra.js`
- [Order and ticket rules](https://github.com/f0derecka/safari-pilar/blob/main/ventas/utils.py): `ventas/utils.py`

### Administration

- [Admin screens](https://github.com/f0derecka/safari-pilar/blob/main/static/js/administrador/dashboard.js): `static/js/administrador/dashboard.js`
- [Administration workflows](https://github.com/f0derecka/safari-pilar/blob/main/ventas/views.py): `ventas/views.py`
- [Demo data setup](https://github.com/f0derecka/safari-pilar/blob/main/ventas/management/commands/poblar_safari.py): `ventas/management/commands/poblar_safari.py`

### Privacy and reporting

- [Privacy workflows](https://github.com/f0derecka/safari-pilar/blob/main/ventas/privacy_views.py): `ventas/privacy_views.py`
- [Report exports](https://github.com/f0derecka/safari-pilar/blob/main/ventas/exportador_reportes.py): `ventas/exportador_reportes.py`

### Other components

- **Staff users**
- [Django application](https://github.com/f0derecka/safari-pilar/blob/main/Venta_safari/settings.py): `Venta_safari/settings.py`
- [Domain records](https://github.com/f0derecka/safari-pilar/blob/main/ventas/models.py): `ventas/models.py`
- **Configured database**

## Connections

- Staff users → Login screens: uses (evidence: `README.md`)
- Staff users → POS and sales: operates POS (evidence: `README.md`)
- Staff users → Waiter service: sends orders (evidence: `README.md`)
- Staff users → Kitchen KDS: prepares orders (evidence: `README.md`)
- Staff users → Admin screens: oversees sites (evidence: `README.md`)
- Django application → Business workflows: hosts workflows
- Business workflows → Domain records: reads and writes (evidence: `ventas/views.py`)
- Business workflows → Financial utilities: uses (evidence: `ventas/views.py`)
- Business workflows → Security services: uses (evidence: `ventas/views.py`)
- Business workflows → Report exports: generates exports (evidence: `ventas/views.py`)
- Business workflows → Administration workflows: handles admin (evidence: `ventas/views.py`)
- Business workflows → Privacy workflows: handles privacy (evidence: `ventas/privacy_views.py`)
- POS and sales → Business workflows: submits sales
- Ticket creation → Business workflows: submits tickets
- Waiter service → Business workflows: submits orders
- Kitchen KDS → Business workflows: updates status
- Bar KDS → Business workflows: updates status
- Business workflows → Order and ticket rules: uses (evidence: `ventas/views.py`)
- Order and ticket rules → Domain records: updates orders (evidence: `ventas/utils.py`)
- Admin screens → Administration workflows: manages operations
- Administration workflows → Domain records: reads and writes (evidence: `ventas/views.py`)
- Demo data setup → Domain records: populates records (evidence: `ventas/management/commands/poblar_safari.py`)
- Privacy workflows → Domain records: records privacy data (evidence: `ventas/privacy_views.py`)
- Privacy workflows → Security services: uses safeguards (evidence: `ventas/privacy_views.py`)
- Report exports → Domain records: queries sales (evidence: `ventas/exportador_reportes.py`)
- Domain records → Configured database: persists records
- Session middleware → Security services: uses (evidence: `ventas/middleware.py`)
- Session middleware → Business workflows: checks requests (evidence: `ventas/middleware.py`)
