# juanpiiis/mobulaaa architecture

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

- Interactive diagram: https://gitdiagram.com/juanpiiis/mobulaaa
- Repository: https://github.com/juanpiiis/mobulaaa

## Overview

Mobulaa is a role-based inventory and order-management application. Users enter through authentication and role-specific dashboards; sellers browse products and manage orders, warehouse staff handle stock and order fulfillment, finance reviews orders, and administrators manage inventory and operational reporting. The tree identifies these product areas, while sampled code confirms customer lookup/registration and order history, product search, Excel inventory uploads, and realtime notifications. Most page implementations were not sampled, so their internal calls and cross-role transitions are not asserted.

Main entry points: [`app/(dashboard)/layout.tsx`](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/layout.tsx) (Dashboard shell), [`lib/supabase/client.ts`](https://github.com/juanpiiis/mobulaaa/blob/main/lib/supabase/client.ts) (Supabase client), [`components/pedidos/ClienteSelector.tsx`](https://github.com/juanpiiis/mobulaaa/blob/main/components/pedidos/ClienteSelector.tsx) (Customer selection), [`app/api/subir-inventario/route.ts`](https://github.com/juanpiiis/mobulaaa/blob/main/app/api/subir-inventario/route.ts) (Upload processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; workspace"]
  node_auth["Sign in<br/>[page.tsx]"]
  node_register["Registration<br/>[page.tsx]"]
  node_dashboard["Dashboard shell<br/>[layout.tsx]"]
  node_home["Home routing<br/>[page.tsx]"]
end

subgraph group_sales["Sales &amp; customers"]
  node_seller["Seller workspace<br/>[page.tsx]"]
  node_catalog["Product catalog<br/>[page.tsx]"]
  node_sellerorders["My orders<br/>[page.tsx]"]
  node_clientselect["Customer selection"]
  node_clientform["Customer registration"]
  node_clienthistory["Order history"]
  node_productsearch["Product search"]
  node_finance["Receivables review<br/>[page.tsx]"]
end

subgraph group_warehouse["Warehouse operations"]
  node_warehousehome["Warehouse workspace<br/>[page.tsx]"]
  node_stock["Stock inventory<br/>[page.tsx]"]
  node_receipts["Stock entries<br/>[page.tsx]"]
  node_movements["Stock movements<br/>[page.tsx]"]
  node_warehouseorders["Order processing<br/>[page.tsx]"]
end

subgraph group_oversight["Administration"]
  node_adminhome["Admin workspace<br/>[page.tsx]"]
  node_products["Product management<br/>[page.tsx]"]
  node_warehouses["Warehouse management<br/>[page.tsx]"]
  node_uploadpage["Inventory upload<br/>[page.tsx]"]
  node_uploadapi["Upload processing<br/>[route.ts]"]
  node_cuts["Stock counts<br/>[page.tsx]"]
  node_cutdetail["Count detail<br/>[page.tsx]"]
  node_analytics["Statistics<br/>[page.tsx]"]
  node_reports["Reports<br/>[page.tsx]"]
  node_users["User management<br/>[page.tsx]"]
end

subgraph group_services["Data &amp; realtime"]
  node_excel["Excel cleaning<br/>[dataExcel.ts]"]
  node_clienthook["Customer lookup"]
  node_notifications["Realtime alerts"]
  node_supabaseclient["Supabase client<br/>[client.ts]"]
  node_database[("Supabase data store")]
end

node_user(("Staff user"))

node_user -->|"opens"| node_home
node_user -->|"signs in"| node_auth
node_user -->|"registers"| node_register
node_auth -->|"enters"| node_dashboard
node_register -->|"enters"| node_dashboard
node_dashboard -->|"presents role"| node_seller
node_dashboard -->|"presents role"| node_warehousehome
node_dashboard -->|"presents role"| node_adminhome
node_clientselect -->|"searches"| node_clienthook
node_clientselect -->|"registers missing"| node_clientform
node_clientselect -->|"opens history"| node_clienthistory
node_clienthook -->|"queries through"| node_supabaseclient
node_clientform -->|"writes through"| node_supabaseclient
node_clienthistory -->|"queries through"| node_supabaseclient
node_productsearch -->|"queries through"| node_supabaseclient
node_supabaseclient -->|"accesses"| node_database
node_uploadpage -->|"submits file"| node_uploadapi
node_uploadapi -->|"cleans rows"| node_excel
node_uploadapi -->|"writes counts"| node_database
node_notifications -->|"subscribes to changes"| node_database

click node_auth "https://github.com/juanpiiis/mobulaaa/blob/main/app/(auth)/login/page.tsx"
click node_register "https://github.com/juanpiiis/mobulaaa/blob/main/app/(auth)/registro/page.tsx"
click node_dashboard "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/layout.tsx"
click node_home "https://github.com/juanpiiis/mobulaaa/blob/main/app/page.tsx"
click node_seller "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/vendedor/page.tsx"
click node_catalog "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/vendedor/catalogo/page.tsx"
click node_sellerorders "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/vendedor/mis-pedidos/page.tsx"
click node_clientselect "https://github.com/juanpiiis/mobulaaa/blob/main/components/pedidos/ClienteSelector.tsx"
click node_clientform "https://github.com/juanpiiis/mobulaaa/blob/main/components/pedidos/ClienteNuevoForm.tsx"
click node_clienthistory "https://github.com/juanpiiis/mobulaaa/blob/main/components/pedidos/HistorialClienteModal.tsx"
click node_productsearch "https://github.com/juanpiiis/mobulaaa/blob/main/lib/hooks/useBuscarProducto.ts"
click node_warehousehome "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/page.tsx"
click node_stock "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/inventario/page.tsx"
click node_receipts "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/entradas/page.tsx"
click node_movements "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/movimientos/page.tsx"
click node_warehouseorders "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/pedidos/page.tsx"
click node_finance "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/cartera/page.tsx"
click node_adminhome "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/page.tsx"
click node_products "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/productos/page.tsx"
click node_warehouses "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/bodegas/page.tsx"
click node_uploadpage "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/subir-inventario/page.tsx"
click node_uploadapi "https://github.com/juanpiiis/mobulaaa/blob/main/app/api/subir-inventario/route.ts"
click node_cuts "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/cortes/page.tsx"
click node_cutdetail "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/cortes/%5Bid%5D/page.tsx"
click node_analytics "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/estadisticas/page.tsx"
click node_reports "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/reportes/page.tsx"
click node_users "https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/usuarios/page.tsx"
click node_excel "https://github.com/juanpiiis/mobulaaa/blob/main/lib/utils/dataExcel.ts"
click node_clienthook "https://github.com/juanpiiis/mobulaaa/blob/main/lib/hooks/useBuscarCliente.ts"
click node_notifications "https://github.com/juanpiiis/mobulaaa/blob/main/lib/context/NotificacionesContext.tsx"
click node_supabaseclient "https://github.com/juanpiiis/mobulaaa/blob/main/lib/supabase/client.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_auth,node_register,node_dashboard,node_home,node_user toneBlue
class node_seller,node_catalog,node_sellerorders,node_clientselect,node_clientform,node_clienthistory,node_productsearch,node_finance toneAmber
class node_warehousehome,node_stock,node_receipts,node_movements,node_warehouseorders toneMint
class node_adminhome,node_products,node_warehouses,node_uploadpage,node_uploadapi,node_cuts,node_cutdetail,node_analytics,node_reports,node_users toneRose
class node_excel,node_clienthook,node_notifications,node_supabaseclient,node_database toneIndigo
```

## Components

### Access & workspace

- [Sign in](https://github.com/juanpiiis/mobulaaa/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Registration](https://github.com/juanpiiis/mobulaaa/blob/main/app/(auth)/registro/page.tsx): `app/(auth)/registro/page.tsx`
- [Dashboard shell](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/layout.tsx): `app/(dashboard)/layout.tsx`
- [Home routing](https://github.com/juanpiiis/mobulaaa/blob/main/app/page.tsx): `app/page.tsx`

### Sales & customers

- [Seller workspace](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/vendedor/page.tsx): `app/(dashboard)/vendedor/page.tsx`
- [Product catalog](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/vendedor/catalogo/page.tsx): `app/(dashboard)/vendedor/catalogo/page.tsx`
- [My orders](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/vendedor/mis-pedidos/page.tsx): `app/(dashboard)/vendedor/mis-pedidos/page.tsx`
- [Customer selection](https://github.com/juanpiiis/mobulaaa/blob/main/components/pedidos/ClienteSelector.tsx): `components/pedidos/ClienteSelector.tsx`
- [Customer registration](https://github.com/juanpiiis/mobulaaa/blob/main/components/pedidos/ClienteNuevoForm.tsx): `components/pedidos/ClienteNuevoForm.tsx`
- [Order history](https://github.com/juanpiiis/mobulaaa/blob/main/components/pedidos/HistorialClienteModal.tsx): `components/pedidos/HistorialClienteModal.tsx`
- [Product search](https://github.com/juanpiiis/mobulaaa/blob/main/lib/hooks/useBuscarProducto.ts): `lib/hooks/useBuscarProducto.ts`
- [Receivables review](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/cartera/page.tsx): `app/(dashboard)/cartera/page.tsx`

### Warehouse operations

- [Warehouse workspace](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/page.tsx): `app/(dashboard)/bodeguero/page.tsx`
- [Stock inventory](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/inventario/page.tsx): `app/(dashboard)/bodeguero/inventario/page.tsx`
- [Stock entries](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/entradas/page.tsx): `app/(dashboard)/bodeguero/entradas/page.tsx`
- [Stock movements](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/movimientos/page.tsx): `app/(dashboard)/bodeguero/movimientos/page.tsx`
- [Order processing](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/bodeguero/pedidos/page.tsx): `app/(dashboard)/bodeguero/pedidos/page.tsx`

### Administration

- [Admin workspace](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/page.tsx): `app/(dashboard)/admin/page.tsx`
- [Product management](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/productos/page.tsx): `app/(dashboard)/admin/productos/page.tsx`
- [Warehouse management](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/bodegas/page.tsx): `app/(dashboard)/admin/bodegas/page.tsx`
- [Inventory upload](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/subir-inventario/page.tsx): `app/(dashboard)/admin/subir-inventario/page.tsx`
- [Upload processing](https://github.com/juanpiiis/mobulaaa/blob/main/app/api/subir-inventario/route.ts): `app/api/subir-inventario/route.ts`
- [Stock counts](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/cortes/page.tsx): `app/(dashboard)/admin/cortes/page.tsx`
- [Count detail](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/cortes/%5Bid%5D/page.tsx): `app/(dashboard)/admin/cortes/[id]/page.tsx`
- [Statistics](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/estadisticas/page.tsx): `app/(dashboard)/admin/estadisticas/page.tsx`
- [Reports](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/reportes/page.tsx): `app/(dashboard)/admin/reportes/page.tsx`
- [User management](https://github.com/juanpiiis/mobulaaa/blob/main/app/(dashboard)/admin/usuarios/page.tsx): `app/(dashboard)/admin/usuarios/page.tsx`

### Data & realtime

- [Excel cleaning](https://github.com/juanpiiis/mobulaaa/blob/main/lib/utils/dataExcel.ts): `lib/utils/dataExcel.ts`
- [Customer lookup](https://github.com/juanpiiis/mobulaaa/blob/main/lib/hooks/useBuscarCliente.ts): `lib/hooks/useBuscarCliente.ts`
- [Realtime alerts](https://github.com/juanpiiis/mobulaaa/blob/main/lib/context/NotificacionesContext.tsx): `lib/context/NotificacionesContext.tsx`
- [Supabase client](https://github.com/juanpiiis/mobulaaa/blob/main/lib/supabase/client.ts): `lib/supabase/client.ts`
- **Supabase data store**

### Other components

- **Staff user**

## Connections

- Staff user → Home routing: opens
- Staff user → Sign in: signs in
- Staff user → Registration: registers
- Sign in → Dashboard shell: enters
- Registration → Dashboard shell: enters
- Dashboard shell → Seller workspace: presents role
- Dashboard shell → Warehouse workspace: presents role
- Dashboard shell → Admin workspace: presents role
- Customer selection → Customer lookup: searches
- Customer selection → Customer registration: registers missing
- Customer selection → Order history: opens history
- Customer lookup → Supabase client: queries through
- Customer registration → Supabase client: writes through
- Order history → Supabase client: queries through
- Product search → Supabase client: queries through
- Supabase client → Supabase data store: accesses
- Inventory upload → Upload processing: submits file
- Upload processing → Excel cleaning: cleans rows
- Upload processing → Supabase data store: writes counts
- Realtime alerts → Supabase data store: subscribes to changes
