# anthonypro32/pruebainfo architecture

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

- Interactive diagram: https://gitdiagram.com/anthonypro32/pruebainfo
- Repository: https://github.com/anthonypro32/pruebainfo

## Overview

ECOHOGAR is a Spanish-language storefront and operations platform for a student-run business. Customers browse workshops and products, keep a persistent cart, submit an order, and receive confirmation; account registration and order history are optional. Staff use role-controlled administration for order fulfillment and a broader set of inventory, finance, document, production, scheduling, and audit tasks. The excerpts show storefront state, authentication, Supabase access, and some admin data operations; several admin capabilities are represented from the README rather than inspected implementation.

Main entry points: [`src/App.tsx`](https://github.com/anthonypro32/pruebainfo/blob/main/src/App.tsx) (App routes), [`src/lib/supabaseClient.ts`](https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/supabaseClient.ts) (Supabase), [`src/components/TiendaLayout.tsx`](https://github.com/anthonypro32/pruebainfo/blob/main/src/components/TiendaLayout.tsx) (Storefront UI), [`src/pages/public/Checkout.tsx`](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/public/Checkout.tsx) (Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App routes<br/>[App.tsx]"]
  node_catalog["Catalog"]
  node_storefront_ui["Storefront UI<br/>[TiendaLayout.tsx]"]
  node_cart["Persistent cart<br/>[CartContext.tsx]"]
  node_checkout["Checkout<br/>[Checkout.tsx]"]
  node_confirmation["Order confirmation<br/>[Confirmacion.tsx]"]
end

subgraph group_identity["Accounts"]
  node_account_access["Account access<br/>[AccesoCuenta.tsx]"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_customer_account["Customer account<br/>[cuenta.ts]"]
end

subgraph group_operations["Administration"]
  node_admin_routes["Admin routes<br/>[AdminRutas.tsx]"]
  node_admin_state["Admin data<br/>[AdminContext.tsx]"]
  node_orders_admin["Order management<br/>[Pedidos.tsx]"]
  node_inventory["Inventory<br/>[Inventario.tsx]"]
  node_finance["Finance<br/>[Finanzas.tsx]"]
  node_documents["Documents and payments<br/>[Documentos.tsx]"]
  node_materials["Materials and production"]
  node_scheduling["Appointments and delivery"]
  node_audit["Audit history<br/>[Auditoria.tsx]"]
end

subgraph group_platform["Data services"]
  node_admin_lib["Admin data services<br/>[admin.ts]"]
  node_orders_lib["Order submission<br/>[pedidos.ts]"]
  node_supabase[("Supabase<br/>[supabaseClient.ts]")]
end

node_customer(("Customer"))
node_staff(("Staff"))

node_customer -->|"opens store"| node_app
node_app -->|"provides catalog"| node_catalog
node_app -->|"provides cart"| node_cart
node_app -->|"renders layout"| node_storefront_ui
node_storefront_ui -->|"reads catalog"| node_catalog
node_storefront_ui -->|"reads cart"| node_cart
node_catalog -->|"loads listings"| node_supabase
node_customer -->|"places order"| node_checkout
node_checkout -->|"submits order"| node_orders_lib
node_orders_lib -->|"writes order"| node_supabase
node_checkout -->|"routes after order"| node_confirmation
node_customer -->|"signs in"| node_account_access
node_account_access -->|"uses auth state"| node_auth
node_auth -->|"verifies session"| node_supabase
node_auth -->|"loads customer"| node_customer_account
node_staff -->|"opens panel"| node_admin_routes
node_admin_routes -->|"provides admin data"| node_admin_state
node_admin_state -->|"loads admin data"| node_admin_lib
node_admin_lib -->|"queries operations"| node_supabase
node_staff -->|"manages orders"| node_orders_admin
node_staff -->|"manages stock"| node_inventory
node_staff -->|"records finances"| node_finance
node_staff -->|"manages documents"| node_documents
node_staff -->|"manages production"| node_materials
node_staff -->|"coordinates schedules"| node_scheduling
node_staff -->|"reviews history"| node_audit

click node_app "https://github.com/anthonypro32/pruebainfo/blob/main/src/App.tsx"
click node_catalog "https://github.com/anthonypro32/pruebainfo/blob/main/src/context/CatalogoContext.tsx"
click node_storefront_ui "https://github.com/anthonypro32/pruebainfo/blob/main/src/components/TiendaLayout.tsx"
click node_cart "https://github.com/anthonypro32/pruebainfo/blob/main/src/context/CartContext.tsx"
click node_checkout "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/public/Checkout.tsx"
click node_confirmation "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/public/Confirmacion.tsx"
click node_account_access "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/public/AccesoCuenta.tsx"
click node_auth "https://github.com/anthonypro32/pruebainfo/blob/main/src/context/AuthContext.tsx"
click node_customer_account "https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/cuenta.ts"
click node_admin_routes "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/AdminRutas.tsx"
click node_admin_state "https://github.com/anthonypro32/pruebainfo/blob/main/src/context/AdminContext.tsx"
click node_orders_admin "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Pedidos.tsx"
click node_inventory "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Inventario.tsx"
click node_finance "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Finanzas.tsx"
click node_documents "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Documentos.tsx"
click node_materials "https://github.com/anthonypro32/pruebainfo/tree/main/src/pages/admin"
click node_scheduling "https://github.com/anthonypro32/pruebainfo/tree/main/src/pages/admin"
click node_audit "https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Auditoria.tsx"
click node_admin_lib "https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/admin.ts"
click node_orders_lib "https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/pedidos.ts"
click node_supabase "https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/supabaseClient.ts"

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_catalog,node_storefront_ui,node_cart,node_checkout,node_confirmation toneBlue
class node_account_access,node_auth,node_customer_account toneAmber
class node_admin_routes,node_admin_state,node_orders_admin,node_inventory,node_finance,node_documents,node_materials,node_scheduling,node_audit toneMint
class node_admin_lib,node_orders_lib,node_supabase toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Storefront

- [App routes](https://github.com/anthonypro32/pruebainfo/blob/main/src/App.tsx): `src/App.tsx`
- [Catalog](https://github.com/anthonypro32/pruebainfo/blob/main/src/context/CatalogoContext.tsx): `src/context/CatalogoContext.tsx`
- [Storefront UI](https://github.com/anthonypro32/pruebainfo/blob/main/src/components/TiendaLayout.tsx): `src/components/TiendaLayout.tsx`
- [Persistent cart](https://github.com/anthonypro32/pruebainfo/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Checkout](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/public/Checkout.tsx): `src/pages/public/Checkout.tsx`
- [Order confirmation](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/public/Confirmacion.tsx): `src/pages/public/Confirmacion.tsx`

### Accounts

- [Account access](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/public/AccesoCuenta.tsx): `src/pages/public/AccesoCuenta.tsx`
- [Authentication state](https://github.com/anthonypro32/pruebainfo/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Customer account](https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/cuenta.ts): `src/lib/cuenta.ts`

### Administration

- [Admin routes](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/AdminRutas.tsx): `src/pages/admin/AdminRutas.tsx`
- [Admin data](https://github.com/anthonypro32/pruebainfo/blob/main/src/context/AdminContext.tsx): `src/context/AdminContext.tsx`
- [Order management](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Pedidos.tsx): `src/pages/admin/Pedidos.tsx`
- [Inventory](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Inventario.tsx): `src/pages/admin/Inventario.tsx`
- [Finance](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Finanzas.tsx): `src/pages/admin/Finanzas.tsx`
- [Documents and payments](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Documentos.tsx): `src/pages/admin/Documentos.tsx`
- [Materials and production](https://github.com/anthonypro32/pruebainfo/tree/main/src/pages/admin): `src/pages/admin`
- [Appointments and delivery](https://github.com/anthonypro32/pruebainfo/tree/main/src/pages/admin): `src/pages/admin`
- [Audit history](https://github.com/anthonypro32/pruebainfo/blob/main/src/pages/admin/Auditoria.tsx): `src/pages/admin/Auditoria.tsx`

### Data services

- [Admin data services](https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/admin.ts): `src/lib/admin.ts`
- [Order submission](https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/pedidos.ts): `src/lib/pedidos.ts`
- [Supabase](https://github.com/anthonypro32/pruebainfo/blob/main/src/lib/supabaseClient.ts): `src/lib/supabaseClient.ts`

### Other components

- **Customer**
- **Staff**

## Connections

- Customer → App routes: opens store (evidence: `src/App.tsx`)
- App routes → Catalog: provides catalog (evidence: `src/App.tsx`)
- App routes → Persistent cart: provides cart (evidence: `src/App.tsx`)
- App routes → Storefront UI: renders layout (evidence: `src/App.tsx`)
- Storefront UI → Catalog: reads catalog (evidence: `src/components/TiendaLayout.tsx`)
- Storefront UI → Persistent cart: reads cart (evidence: `src/components/TiendaLayout.tsx`)
- Catalog → Supabase: loads listings (evidence: `src/context/CatalogoContext.tsx`)
- Customer → Checkout: places order (evidence: `README.md`)
- Checkout → Order submission: submits order (evidence: `src/pages/public/Checkout.tsx`)
- Order submission → Supabase: writes order (evidence: `src/lib/pedidos.ts`)
- Checkout → Order confirmation: routes after order (evidence: `src/App.tsx`)
- Customer → Account access: signs in (evidence: `README.md`)
- Account access → Authentication state: uses auth state (evidence: `src/pages/public/AccesoCuenta.tsx`)
- Authentication state → Supabase: verifies session (evidence: `src/context/AuthContext.tsx`)
- Authentication state → Customer account: loads customer (evidence: `src/context/AuthContext.tsx`)
- Staff → Admin routes: opens panel (evidence: `README.md`)
- Admin routes → Admin data: provides admin data (evidence: `src/pages/admin/AdminRutas.tsx`)
- Admin data → Admin data services: loads admin data (evidence: `src/context/AdminContext.tsx`)
- Admin data services → Supabase: queries operations (evidence: `src/lib/admin.ts`)
- Staff → Order management: manages orders (evidence: `README.md`)
- Staff → Inventory: manages stock (evidence: `README.md`)
- Staff → Finance: records finances (evidence: `README.md`)
- Staff → Documents and payments: manages documents (evidence: `README.md`)
- Staff → Materials and production: manages production (evidence: `README.md`)
- Staff → Appointments and delivery: coordinates schedules (evidence: `README.md`)
- Staff → Audit history: reviews history (evidence: `README.md`)
