# alexurbina8/datosapp architecture

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

- Interactive diagram: https://gitdiagram.com/alexurbina8/datosapp
- Repository: https://github.com/alexurbina8/datosapp

## Overview

TareaSwiftData is a SwiftUI app for managing products and employees. Users switch between the two lists, search products, and add, edit, or delete records; view models validate inputs and save changes through SwiftData. The app configures a persistent model container for both record types. The excerpts show the UI-to-view-model calls and container setup; storage behavior beyond those SwiftData operations is not independently shown.

Main entry points: [`TareaSwiftData/TareaSwiftDataApp.swift`](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/TareaSwiftDataApp.swift) (App entry), [`TareaSwiftData/ProductViewModel.swift`](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/ProductViewModel.swift) (Product operations), [`TareaSwiftData/EmployeeViewModel.swift`](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/EmployeeViewModel.swift) (Employee operations), [`TareaSwiftData/ProductViews.swift`](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/ProductViews.swift) (Product screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app_entry["App entry"]
  node_tabs["Tab navigation<br/>[ContentView.swift]"]
end

subgraph group_products["Product management"]
  node_product_ui["Product screens<br/>[ProductViews.swift]"]
  node_product_logic["Product operations"]
  node_product_model["Product record<br/>[Product.swift]"]
end

subgraph group_employees["Employee management"]
  node_employee_ui["Employee screens"]
  node_employee_logic["Employee operations"]
  node_employee_model["Employee record<br/>[Employee.swift]"]
end

subgraph group_shared["Shared data"]
  node_operation_result["Operation result"]
  node_swiftdata_store[("SwiftData store")]
end

node_user(("User"))

node_user -->|"launches"| node_app_entry
node_app_entry -->|"shows"| node_tabs
node_tabs -->|"opens tab"| node_product_ui
node_tabs -->|"opens tab"| node_employee_ui
node_user -->|"uses"| node_product_ui
node_user -->|"uses"| node_employee_ui
node_product_ui -->|"invokes"| node_product_logic
node_employee_ui -->|"invokes"| node_employee_logic
node_product_ui -->|"queries"| node_product_model
node_employee_ui -->|"queries"| node_employee_model
node_product_logic -->|"creates and updates"| node_product_model
node_employee_logic -->|"creates and updates"| node_employee_model
node_product_logic -->|"returns"| node_operation_result
node_employee_logic -->|"returns"| node_operation_result
node_app_entry -->|"configures"| node_swiftdata_store
node_app_entry -->|"registers schema"| node_product_model
node_app_entry -->|"registers schema"| node_employee_model
node_product_logic -->|"saves changes"| node_swiftdata_store
node_employee_logic -->|"saves changes"| node_swiftdata_store

click node_app_entry "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/TareaSwiftDataApp.swift"
click node_tabs "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/ContentView.swift"
click node_product_ui "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/ProductViews.swift"
click node_product_logic "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/ProductViewModel.swift"
click node_product_model "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/Product.swift"
click node_employee_ui "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/EmployeeViews.swift"
click node_employee_logic "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/EmployeeViewModel.swift"
click node_employee_model "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/Employee.swift"
click node_operation_result "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/OperationResult.swift"
click node_swiftdata_store "https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/TareaSwiftDataApp.swift"

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_entry,node_tabs,node_user toneBlue
class node_product_ui,node_product_logic,node_product_model toneAmber
class node_employee_ui,node_employee_logic,node_employee_model toneMint
class node_operation_result,node_swiftdata_store toneRose
```

## Components

### App shell

- [App entry](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/TareaSwiftDataApp.swift): `TareaSwiftData/TareaSwiftDataApp.swift`
- [Tab navigation](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/ContentView.swift): `TareaSwiftData/ContentView.swift`

### Product management

- [Product screens](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/ProductViews.swift): `TareaSwiftData/ProductViews.swift`
- [Product operations](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/ProductViewModel.swift): `TareaSwiftData/ProductViewModel.swift`
- [Product record](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/Product.swift): `TareaSwiftData/Product.swift`

### Employee management

- [Employee screens](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/EmployeeViews.swift): `TareaSwiftData/EmployeeViews.swift`
- [Employee operations](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/EmployeeViewModel.swift): `TareaSwiftData/EmployeeViewModel.swift`
- [Employee record](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/Employee.swift): `TareaSwiftData/Employee.swift`

### Shared data

- [Operation result](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/OperationResult.swift): `TareaSwiftData/OperationResult.swift`
- [SwiftData store](https://github.com/alexurbina8/datosapp/blob/main/TareaSwiftData/TareaSwiftDataApp.swift): `TareaSwiftData/TareaSwiftDataApp.swift`

### Other components

- **User**

## Connections

- User → App entry: launches
- App entry → Tab navigation: shows (evidence: `TareaSwiftData/TareaSwiftDataApp.swift`)
- Tab navigation → Product screens: opens tab (evidence: `TareaSwiftData/ContentView.swift`)
- Tab navigation → Employee screens: opens tab (evidence: `TareaSwiftData/ContentView.swift`)
- User → Product screens: uses
- User → Employee screens: uses
- Product screens → Product operations: invokes (evidence: `TareaSwiftData/ProductViews.swift`)
- Employee screens → Employee operations: invokes (evidence: `TareaSwiftData/EmployeeViews.swift`)
- Product screens → Product record: queries (evidence: `TareaSwiftData/ProductViews.swift`)
- Employee screens → Employee record: queries (evidence: `TareaSwiftData/EmployeeViews.swift`)
- Product operations → Product record: creates and updates (evidence: `TareaSwiftData/ProductViewModel.swift`)
- Employee operations → Employee record: creates and updates (evidence: `TareaSwiftData/EmployeeViewModel.swift`)
- Product operations → Operation result: returns (evidence: `TareaSwiftData/ProductViewModel.swift`)
- Employee operations → Operation result: returns (evidence: `TareaSwiftData/EmployeeViewModel.swift`)
- App entry → SwiftData store: configures (evidence: `TareaSwiftData/TareaSwiftDataApp.swift`)
- App entry → Product record: registers schema (evidence: `TareaSwiftData/TareaSwiftDataApp.swift`)
- App entry → Employee record: registers schema (evidence: `TareaSwiftData/TareaSwiftDataApp.swift`)
- Product operations → SwiftData store: saves changes (evidence: `TareaSwiftData/ProductViewModel.swift`)
- Employee operations → SwiftData store: saves changes (evidence: `TareaSwiftData/EmployeeViewModel.swift`)
