# amiruh1/winware-360 architecture

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

- Interactive diagram: https://gitdiagram.com/amiruh1/winware-360
- Repository: https://github.com/amiruh1/winware-360

## Overview

Winware 360 is a role-based equipment rental and support portal for Winware staff and customers. Users sign in or register, then work through role-specific areas: browse and order equipment, manage equipment and contracts, pay invoices, or submit and track support tickets. Staff also manage inventory, users, finance, and operational indicators. The frontend authenticates through Cognito and sends API requests to the deployed backend; the README describes server-side permission checks and AI-backed suggestions. Edges from unsampled pages to the API reflect documented capabilities, not inspection of their implementation.

Main entry points: [`lib/api.ts`](https://github.com/amiruh1/winware-360/blob/main/lib/api.ts) (Authenticated API client), [`lib/auth.tsx`](https://github.com/amiruh1/winware-360/blob/main/lib/auth.tsx) (Session and permissions), [`components/FuncionesIA.tsx`](https://github.com/amiruh1/winware-360/blob/main/components/FuncionesIA.tsx) (AI assistance features), [`app/(app)/catalogo/page.tsx`](https://github.com/amiruh1/winware-360/blob/main/app/(app)/catalogo/page.tsx) (Equipment catalog and orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shared UI"]
  node_login["Sign-in and registration<br/>[page.tsx]"]
  node_auth["Session and permissions<br/>[auth.tsx]"]
  node_shell["Application shell<br/>[AppShell.tsx]"]
  node_shared_ui["Shared forms and status UI<br/>[Campos.tsx]"]
end

subgraph group_customer["Customer portal"]
  node_catalog["Equipment catalog and orders<br/>[page.tsx]"]
  node_my_equipment["My equipment<br/>[page.tsx]"]
  node_my_contracts["My contracts<br/>[page.tsx]"]
  node_my_payments["My payments<br/>[page.tsx]"]
  node_payment_form["Payment form<br/>[PagoForm.tsx]"]
end

subgraph group_operations["Staff operations"]
  node_home["Operational summary<br/>[page.tsx]"]
  node_inventory["Inventory management<br/>[page.tsx]"]
  node_contracts["Staff contracts<br/>[page.tsx]"]
  node_finance["Finance<br/>[page.tsx]"]
  node_users["User administration<br/>[page.tsx]"]
  node_indicators["Performance indicators<br/>[page.tsx]"]
end

subgraph group_support["Support and AI"]
  node_helpdesk["Staff ticket board<br/>[page.tsx]"]
  node_customer_support["Customer support<br/>[page.tsx]"]
  node_ai["AI assistance features<br/>[FuncionesIA.tsx]"]
end

subgraph group_services["Frontend services"]
  node_api_client["Authenticated API client<br/>[api.ts]"]
  node_session["Token persistence<br/>[sesion.ts]"]
  node_cognito_client["Cognito client<br/>[cognito.ts]"]
  node_data_hooks["Data loading hooks<br/>[hooks.ts]"]
  node_types["Domain data types<br/>[tipos.ts]"]
end

node_user(("Staff or customer"))
node_cognito{{"Amazon Cognito"}}
node_backend{{"Winware API"}}

node_user -->|"signs in"| node_login
node_login -->|"uses auth"| node_auth
node_auth -->|"authenticates with"| node_cognito_client
node_cognito_client -->|"sends credentials"| node_cognito
node_auth -->|"loads profile"| node_api_client
node_auth -->|"stores tokens"| node_session
node_api_client -->|"gets token"| node_session
node_api_client -->|"sends requests"| node_backend
node_shell -.->|"checks access"| node_auth
node_home -->|"loads summary"| node_api_client
node_inventory -->|"manages equipment"| node_api_client
node_contracts -->|"loads contracts"| node_api_client
node_finance -->|"manages invoices"| node_api_client
node_users -->|"approves accounts"| node_api_client
node_indicators -.->|"loads indicators"| node_api_client
node_catalog -->|"places orders"| node_api_client
node_catalog -->|"uses payment form"| node_payment_form
node_my_equipment -->|"loads equipment"| node_api_client
node_my_contracts -->|"loads contracts"| node_api_client
node_my_payments -->|"loads payments"| node_api_client
node_my_payments -->|"uses payment form"| node_payment_form
node_helpdesk -->|"updates tickets"| node_api_client
node_customer_support -->|"submits tickets"| node_api_client
node_catalog -->|"offers recommendations"| node_ai
node_helpdesk -->|"offers ticket assistance"| node_ai
node_customer_support -->|"offers self-help"| node_ai
node_ai -->|"requests suggestions"| node_api_client
node_inventory -.->|"loads data"| node_data_hooks
node_shared_ui -.->|"uses domain values"| node_types

click node_login "https://github.com/amiruh1/winware-360/blob/main/app/login/page.tsx"
click node_auth "https://github.com/amiruh1/winware-360/blob/main/lib/auth.tsx"
click node_shell "https://github.com/amiruh1/winware-360/blob/main/components/AppShell.tsx"
click node_home "https://github.com/amiruh1/winware-360/blob/main/app/(app)/page.tsx"
click node_inventory "https://github.com/amiruh1/winware-360/blob/main/app/(app)/inventario/page.tsx"
click node_contracts "https://github.com/amiruh1/winware-360/blob/main/app/(app)/contratos/page.tsx"
click node_finance "https://github.com/amiruh1/winware-360/blob/main/app/(app)/finanzas/page.tsx"
click node_users "https://github.com/amiruh1/winware-360/blob/main/app/(app)/usuarios/page.tsx"
click node_indicators "https://github.com/amiruh1/winware-360/blob/main/app/(app)/indicadores/page.tsx"
click node_catalog "https://github.com/amiruh1/winware-360/blob/main/app/(app)/catalogo/page.tsx"
click node_my_equipment "https://github.com/amiruh1/winware-360/blob/main/app/(app)/mis-equipos/page.tsx"
click node_my_contracts "https://github.com/amiruh1/winware-360/blob/main/app/(app)/mis-contratos/page.tsx"
click node_my_payments "https://github.com/amiruh1/winware-360/blob/main/app/(app)/mis-pagos/page.tsx"
click node_helpdesk "https://github.com/amiruh1/winware-360/blob/main/app/(app)/mesa-de-ayuda/page.tsx"
click node_customer_support "https://github.com/amiruh1/winware-360/blob/main/app/(app)/soporte/page.tsx"
click node_ai "https://github.com/amiruh1/winware-360/blob/main/components/FuncionesIA.tsx"
click node_api_client "https://github.com/amiruh1/winware-360/blob/main/lib/api.ts"
click node_session "https://github.com/amiruh1/winware-360/blob/main/lib/sesion.ts"
click node_cognito_client "https://github.com/amiruh1/winware-360/blob/main/lib/cognito.ts"
click node_data_hooks "https://github.com/amiruh1/winware-360/blob/main/lib/hooks.ts"
click node_types "https://github.com/amiruh1/winware-360/blob/main/lib/tipos.ts"
click node_shared_ui "https://github.com/amiruh1/winware-360/blob/main/components/Campos.tsx"
click node_payment_form "https://github.com/amiruh1/winware-360/blob/main/components/PagoForm.tsx"

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_auth,node_shell,node_shared_ui toneBlue
class node_catalog,node_my_equipment,node_my_contracts,node_my_payments,node_payment_form toneAmber
class node_home,node_inventory,node_contracts,node_finance,node_users,node_indicators,node_backend toneMint
class node_helpdesk,node_customer_support,node_ai toneRose
class node_api_client,node_session,node_cognito_client,node_data_hooks,node_types,node_user,node_cognito toneIndigo
```

## Components

### Access and shared UI

- [Sign-in and registration](https://github.com/amiruh1/winware-360/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Session and permissions](https://github.com/amiruh1/winware-360/blob/main/lib/auth.tsx): `lib/auth.tsx`
- [Application shell](https://github.com/amiruh1/winware-360/blob/main/components/AppShell.tsx): `components/AppShell.tsx`
- [Shared forms and status UI](https://github.com/amiruh1/winware-360/blob/main/components/Campos.tsx): `components/Campos.tsx`

### Customer portal

- [Equipment catalog and orders](https://github.com/amiruh1/winware-360/blob/main/app/(app)/catalogo/page.tsx): `app/(app)/catalogo/page.tsx`
- [My equipment](https://github.com/amiruh1/winware-360/blob/main/app/(app)/mis-equipos/page.tsx): `app/(app)/mis-equipos/page.tsx`
- [My contracts](https://github.com/amiruh1/winware-360/blob/main/app/(app)/mis-contratos/page.tsx): `app/(app)/mis-contratos/page.tsx`
- [My payments](https://github.com/amiruh1/winware-360/blob/main/app/(app)/mis-pagos/page.tsx): `app/(app)/mis-pagos/page.tsx`
- [Payment form](https://github.com/amiruh1/winware-360/blob/main/components/PagoForm.tsx): `components/PagoForm.tsx`

### Staff operations

- [Operational summary](https://github.com/amiruh1/winware-360/blob/main/app/(app)/page.tsx): `app/(app)/page.tsx`
- [Inventory management](https://github.com/amiruh1/winware-360/blob/main/app/(app)/inventario/page.tsx): `app/(app)/inventario/page.tsx`
- [Staff contracts](https://github.com/amiruh1/winware-360/blob/main/app/(app)/contratos/page.tsx): `app/(app)/contratos/page.tsx`
- [Finance](https://github.com/amiruh1/winware-360/blob/main/app/(app)/finanzas/page.tsx): `app/(app)/finanzas/page.tsx`
- [User administration](https://github.com/amiruh1/winware-360/blob/main/app/(app)/usuarios/page.tsx): `app/(app)/usuarios/page.tsx`
- [Performance indicators](https://github.com/amiruh1/winware-360/blob/main/app/(app)/indicadores/page.tsx): `app/(app)/indicadores/page.tsx`

### Support and AI

- [Staff ticket board](https://github.com/amiruh1/winware-360/blob/main/app/(app)/mesa-de-ayuda/page.tsx): `app/(app)/mesa-de-ayuda/page.tsx`
- [Customer support](https://github.com/amiruh1/winware-360/blob/main/app/(app)/soporte/page.tsx): `app/(app)/soporte/page.tsx`
- [AI assistance features](https://github.com/amiruh1/winware-360/blob/main/components/FuncionesIA.tsx): `components/FuncionesIA.tsx`

### Frontend services

- [Authenticated API client](https://github.com/amiruh1/winware-360/blob/main/lib/api.ts): `lib/api.ts`
- [Token persistence](https://github.com/amiruh1/winware-360/blob/main/lib/sesion.ts): `lib/sesion.ts`
- [Cognito client](https://github.com/amiruh1/winware-360/blob/main/lib/cognito.ts): `lib/cognito.ts`
- [Data loading hooks](https://github.com/amiruh1/winware-360/blob/main/lib/hooks.ts): `lib/hooks.ts`
- [Domain data types](https://github.com/amiruh1/winware-360/blob/main/lib/tipos.ts): `lib/tipos.ts`

### Other components

- **Staff or customer**
- **Amazon Cognito**
- **Winware API**

## Connections

- Staff or customer → Sign-in and registration: signs in (evidence: `README.md`)
- Sign-in and registration → Session and permissions: uses auth (evidence: `app/login/page.tsx`)
- Session and permissions → Cognito client: authenticates with (evidence: `lib/auth.tsx`)
- Cognito client → Amazon Cognito: sends credentials (evidence: `README.md`)
- Session and permissions → Authenticated API client: loads profile (evidence: `lib/auth.tsx`)
- Session and permissions → Token persistence: stores tokens (evidence: `lib/auth.tsx`)
- Authenticated API client → Token persistence: gets token (evidence: `lib/api.ts`)
- Authenticated API client → Winware API: sends requests (evidence: `README.md`)
- Application shell → Session and permissions: checks access
- Operational summary → Authenticated API client: loads summary (evidence: `README.md`)
- Inventory management → Authenticated API client: manages equipment (evidence: `README.md`)
- Staff contracts → Authenticated API client: loads contracts (evidence: `README.md`)
- Finance → Authenticated API client: manages invoices (evidence: `README.md`)
- User administration → Authenticated API client: approves accounts (evidence: `README.md`)
- Performance indicators → Authenticated API client: loads indicators (evidence: `app/(app)/indicadores/page.tsx`)
- Equipment catalog and orders → Authenticated API client: places orders (evidence: `README.md`)
- Equipment catalog and orders → Payment form: uses payment form (evidence: `app/(app)/catalogo/page.tsx`)
- My equipment → Authenticated API client: loads equipment (evidence: `README.md`)
- My contracts → Authenticated API client: loads contracts (evidence: `README.md`)
- My payments → Authenticated API client: loads payments (evidence: `README.md`)
- My payments → Payment form: uses payment form (evidence: `app/(app)/mis-pagos/page.tsx`)
- Staff ticket board → Authenticated API client: updates tickets (evidence: `README.md`)
- Customer support → Authenticated API client: submits tickets (evidence: `README.md`)
- Equipment catalog and orders → AI assistance features: offers recommendations (evidence: `app/(app)/catalogo/page.tsx`)
- Staff ticket board → AI assistance features: offers ticket assistance (evidence: `app/(app)/mesa-de-ayuda/page.tsx`)
- Customer support → AI assistance features: offers self-help (evidence: `app/(app)/soporte/page.tsx`)
- AI assistance features → Authenticated API client: requests suggestions (evidence: `components/FuncionesIA.tsx`)
- Inventory management → Data loading hooks: loads data (evidence: `app/(app)/inventario/page.tsx`)
- Shared forms and status UI → Domain data types: uses domain values
