# abrilherrera-svg/navi-web architecture

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

- Interactive diagram: https://gitdiagram.com/abrilherrera-svg/navi-web
- Repository: https://github.com/abrilherrera-svg/navi-web

## Overview

NAVI is a café operations system: staff sign in, then use a web console for orders, menu, inventory, cash, sales, tasks, users, and settings; a backend exposes API routes and persists operational data in Firebase. The shown code confirms the task-management flow and parts of authentication, inventory, and order handling. Other major feature areas are represented from the repository tree, but their internal calls were not sampled, so those relationships are left out.

Main entry points: [`NAVI-web/src/App.tsx`](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/App.tsx) (App navigation), [`NAVI-web/backend/src/routes`](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/backend/src/routes) (API routes), [`NAVI-web/backend/src/controllers/orderController.ts`](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/orderController.ts) (Order handlers), [`NAVI-web/src/features/tasks`](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/tasks) (Tasks and shifts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App navigation<br/>[App.tsx]"]
  node_login["Login<br/>[LoginPage.tsx]"]
  node_authclient["Auth client<br/>[authService.ts]"]
  node_api["HTTP client<br/>[api.ts]"]
end

subgraph group_operations["Café operations"]
  node_orders["Orders"]
  node_menu["Menu and recipes"]
  node_inventory["Inventory"]
  node_cash["Cash register"]
  node_sales["Sales reporting"]
  node_dashboard["Dashboard"]
  node_tasks["Tasks and shifts"]
  node_users["Staff management"]
  node_extras["Extras"]
  node_settings["Settings and profile"]
end

subgraph group_backend["Backend API"]
  node_routes["API routes"]
  node_authcontroller["Auth handlers<br/>[authController.ts]"]
  node_ordercontroller["Order handlers<br/>[orderController.ts]"]
  node_inventorycontroller["Inventory handlers"]
  node_recipescontroller["Recipe handlers"]
end

subgraph group_data["Identity and data"]
  node_userstore[("User records<br/>[userModel.ts]")]
  node_orderstore[("Order records<br/>[orderModel.ts]")]
  node_inventorymodel[("Inventory records<br/>[inventoryModel.ts]")]
  node_firebase["Firebase services<br/>[firebase.ts]"]
  node_push["Push notifications<br/>[notificaciones.ts]"]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_app
node_app -->|"shows signed out"| node_login
node_app -->|"calls login"| node_authclient
node_authclient -->|"requests through"| node_api
node_app -->|"selects page"| node_dashboard
node_app -->|"selects page"| node_sales
node_app -->|"selects page"| node_orders
node_app -->|"selects page"| node_menu
node_app -->|"selects page"| node_cash
node_app -->|"selects page"| node_inventory
node_app -->|"selects page"| node_tasks
node_app -->|"selects page"| node_users
node_app -->|"selects page"| node_settings
node_tasks -->|"reads staff"| node_users
node_tasks -.->|"requests task API"| node_routes
node_routes -->|"routes auth"| node_authcontroller
node_routes -->|"routes inventory"| node_inventorycontroller
node_routes -->|"routes recipes"| node_recipescontroller
node_routes -->|"routes orders"| node_ordercontroller
node_authcontroller -->|"reads and updates"| node_userstore
node_inventorycontroller -->|"uses inventory data"| node_inventorymodel
node_recipescontroller -.->|"uses Firebase data"| node_firebase
node_ordercontroller -->|"reads and writes"| node_orderstore
node_ordercontroller -->|"looks up customer"| node_userstore
node_ordercontroller -->|"sends notifications"| node_push
node_userstore -->|"uses Firebase"| node_firebase
node_inventorymodel -->|"uses Firebase"| node_firebase

click node_app "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/App.tsx"
click node_login "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/pages/LoginPage.tsx"
click node_authclient "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/features/auth/services/authService.ts"
click node_api "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/lib/api.ts"
click node_orders "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/orders"
click node_menu "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/menu"
click node_inventory "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/inventory"
click node_cash "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/cash-register"
click node_sales "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/sales"
click node_dashboard "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/dashboard"
click node_tasks "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/tasks"
click node_users "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/users"
click node_extras "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/extras"
click node_settings "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/settings"
click node_routes "https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/backend/src/routes"
click node_authcontroller "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/authController.ts"
click node_ordercontroller "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/orderController.ts"
click node_inventorycontroller "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/inventoryController.ts"
click node_recipescontroller "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/recipeController.ts"
click node_userstore "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/models/userModel.ts"
click node_orderstore "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/models/orderModel.ts"
click node_inventorymodel "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/models/inventoryModel.ts"
click node_firebase "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/config/firebase.ts"
click node_push "https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/services/notificaciones.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_login,node_authclient,node_api,node_staff toneBlue
class node_orders,node_menu,node_inventory,node_cash,node_sales,node_dashboard,node_tasks,node_users,node_extras,node_settings toneAmber
class node_routes,node_authcontroller,node_ordercontroller,node_inventorycontroller,node_recipescontroller toneMint
class node_userstore,node_orderstore,node_inventorymodel,node_firebase,node_push toneRose
```

## Components

### Web application

- [App navigation](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/App.tsx): `NAVI-web/src/App.tsx`
- [Login](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/pages/LoginPage.tsx): `NAVI-web/src/pages/LoginPage.tsx`
- [Auth client](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/features/auth/services/authService.ts): `NAVI-web/src/features/auth/services/authService.ts`
- [HTTP client](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/src/lib/api.ts): `NAVI-web/src/lib/api.ts`

### Café operations

- [Orders](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/orders): `NAVI-web/src/features/orders`
- [Menu and recipes](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/menu): `NAVI-web/src/features/menu`
- [Inventory](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/inventory): `NAVI-web/src/features/inventory`
- [Cash register](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/cash-register): `NAVI-web/src/features/cash-register`
- [Sales reporting](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/sales): `NAVI-web/src/features/sales`
- [Dashboard](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/dashboard): `NAVI-web/src/features/dashboard`
- [Tasks and shifts](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/tasks): `NAVI-web/src/features/tasks`
- [Staff management](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/users): `NAVI-web/src/features/users`
- [Extras](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/extras): `NAVI-web/src/features/extras`
- [Settings and profile](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/src/features/settings): `NAVI-web/src/features/settings`

### Backend API

- [API routes](https://github.com/abrilherrera-svg/navi-web/tree/main/NAVI-web/backend/src/routes): `NAVI-web/backend/src/routes`
- [Auth handlers](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/authController.ts): `NAVI-web/backend/src/controllers/authController.ts`
- [Order handlers](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/orderController.ts): `NAVI-web/backend/src/controllers/orderController.ts`
- [Inventory handlers](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/inventoryController.ts): `NAVI-web/backend/src/controllers/inventoryController.ts`
- [Recipe handlers](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/controllers/recipeController.ts): `NAVI-web/backend/src/controllers/recipeController.ts`

### Identity and data

- [User records](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/models/userModel.ts): `NAVI-web/backend/src/models/userModel.ts`
- [Order records](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/models/orderModel.ts): `NAVI-web/backend/src/models/orderModel.ts`
- [Inventory records](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/models/inventoryModel.ts): `NAVI-web/backend/src/models/inventoryModel.ts`
- [Firebase services](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/config/firebase.ts): `NAVI-web/backend/src/config/firebase.ts`
- [Push notifications](https://github.com/abrilherrera-svg/navi-web/blob/main/NAVI-web/backend/src/services/notificaciones.ts): `NAVI-web/backend/src/services/notificaciones.ts`

### Other components

- **Staff user**

## Connections

- Staff user → App navigation: uses (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Login: shows signed out (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Auth client: calls login (evidence: `NAVI-web/src/App.tsx`)
- Auth client → HTTP client: requests through (evidence: `NAVI-web/src/features/auth/services/authService.ts`)
- App navigation → Dashboard: selects page (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Sales reporting: selects page (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Orders: selects page (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Menu and recipes: selects page (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Cash register: selects page (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Inventory: selects page (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Tasks and shifts: selects page (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Staff management: selects page (evidence: `NAVI-web/src/App.tsx`)
- App navigation → Settings and profile: selects page (evidence: `NAVI-web/src/App.tsx`)
- Tasks and shifts → Staff management: reads staff (evidence: `NAVI-web/src/pages/TasksPage.tsx`)
- Tasks and shifts → API routes: requests task API
- API routes → Auth handlers: routes auth (evidence: `NAVI-web/backend/src/routes/authRoutes.ts`)
- API routes → Inventory handlers: routes inventory (evidence: `NAVI-web/backend/src/routes/inventoryRoutes.ts`)
- API routes → Recipe handlers: routes recipes (evidence: `NAVI-web/backend/src/routes/inventoryRoutes.ts`)
- API routes → Order handlers: routes orders (evidence: `NAVI-web/backend/src/routes/orderRoutes.ts`)
- Auth handlers → User records: reads and updates (evidence: `NAVI-web/backend/src/controllers/authController.ts`)
- Inventory handlers → Inventory records: uses inventory data (evidence: `NAVI-web/backend/src/controllers/inventoryController.ts`)
- Recipe handlers → Firebase services: uses Firebase data
- Order handlers → Order records: reads and writes (evidence: `NAVI-web/backend/src/controllers/orderController.ts`)
- Order handlers → User records: looks up customer (evidence: `NAVI-web/backend/src/controllers/orderController.ts`)
- Order handlers → Push notifications: sends notifications (evidence: `NAVI-web/backend/src/controllers/orderController.ts`)
- User records → Firebase services: uses Firebase (evidence: `NAVI-web/backend/src/models/userModel.ts`)
- Inventory records → Firebase services: uses Firebase (evidence: `NAVI-web/backend/src/models/inventoryModel.ts`)
