# nardoroman/inventario-app architecture

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

- Interactive diagram: https://gitdiagram.com/nardoroman/inventario-app
- Repository: https://github.com/nardoroman/inventario-app

## Overview

This is a MERN inventory application: users browse the product catalog, add products, edit them in a modal, or delete them; the React app updates its displayed state from API responses. The Express server routes CRUD requests to controllers, which use a validated Mongoose product model backed by MongoDB. The README also documents health and optional hosted-backend use. Relationships are limited to calls, registrations, and data exchanges visible in excerpts or explicitly documented; unsampled details are not inferred.

Main entry points: [`client/src/App.tsx`](https://github.com/nardoroman/inventario-app/blob/main/client/src/App.tsx) (Inventory dashboard), [`client/src/services/api.ts`](https://github.com/nardoroman/inventario-app/blob/main/client/src/services/api.ts) (API client), [`client/src/types/product.ts`](https://github.com/nardoroman/inventario-app/blob/main/client/src/types/product.ts) (Product contracts), [`client/src/components/ProductForm.tsx`](https://github.com/nardoroman/inventario-app/blob/main/client/src/components/ProductForm.tsx) (Product form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Inventory interface"]
  node_app["Inventory dashboard<br/>[App.tsx]"]
  node_navbar["Navigation bar<br/>[Navbar.tsx]"]
  node_form["Product form<br/>[ProductForm.tsx]"]
  node_list["Product catalog<br/>[ProductList.tsx]"]
  node_edit["Edit modal<br/>[EditModal.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_product_types["Product contracts<br/>[product.ts]"]
end

subgraph group_server["REST backend"]
  node_express["Express server<br/>[server.ts]"]
  node_routes["Product routes<br/>[productRoutes.ts]"]
  node_controller["Product controller"]
end

subgraph group_data["Product data"]
  node_db_config["Database connection<br/>[db.ts]"]
  node_product_model["Product schema<br/>[Product.ts]"]
  node_seed["Initial product seed<br/>[seed.ts]"]
end

node_user(("Inventory user"))
node_mongodb[("MongoDB Atlas")]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_form
node_app -->|"renders"| node_list
node_app -->|"renders"| node_edit
node_app -->|"loads and deletes"| node_api_client
node_form -->|"creates via"| node_api_client
node_edit -->|"updates via"| node_api_client
node_app -->|"uses types"| node_product_types
node_form -->|"uses types"| node_product_types
node_list -->|"uses types"| node_product_types
node_edit -->|"uses types"| node_product_types
node_api_client -->|"uses types"| node_product_types
node_api_client -->|"sends REST requests"| node_express
node_express -->|"mounts routes"| node_routes
node_express -->|"connects before listen"| node_db_config
node_routes -->|"dispatches requests"| node_controller
node_controller -->|"queries and writes"| node_product_model
node_db_config -->|"connects to"| node_mongodb
node_seed -->|"creates seed records"| node_product_model

click node_app "https://github.com/nardoroman/inventario-app/blob/main/client/src/App.tsx"
click node_navbar "https://github.com/nardoroman/inventario-app/blob/main/client/src/components/Navbar.tsx"
click node_form "https://github.com/nardoroman/inventario-app/blob/main/client/src/components/ProductForm.tsx"
click node_list "https://github.com/nardoroman/inventario-app/blob/main/client/src/components/ProductList.tsx"
click node_edit "https://github.com/nardoroman/inventario-app/blob/main/client/src/components/EditModal.tsx"
click node_api_client "https://github.com/nardoroman/inventario-app/blob/main/client/src/services/api.ts"
click node_product_types "https://github.com/nardoroman/inventario-app/blob/main/client/src/types/product.ts"
click node_express "https://github.com/nardoroman/inventario-app/blob/main/server/src/server.ts"
click node_routes "https://github.com/nardoroman/inventario-app/blob/main/server/src/routes/productRoutes.ts"
click node_controller "https://github.com/nardoroman/inventario-app/blob/main/server/src/controllers/productController.ts"
click node_db_config "https://github.com/nardoroman/inventario-app/blob/main/server/src/config/db.ts"
click node_product_model "https://github.com/nardoroman/inventario-app/blob/main/server/src/models/Product.ts"
click node_seed "https://github.com/nardoroman/inventario-app/blob/main/server/src/seed.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_navbar,node_form,node_list,node_edit,node_api_client,node_product_types,node_user toneBlue
class node_express,node_routes,node_controller,node_mongodb toneAmber
class node_db_config,node_product_model,node_seed toneMint
```

## Components

### Inventory interface

- [Inventory dashboard](https://github.com/nardoroman/inventario-app/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Navigation bar](https://github.com/nardoroman/inventario-app/blob/main/client/src/components/Navbar.tsx): `client/src/components/Navbar.tsx`
- [Product form](https://github.com/nardoroman/inventario-app/blob/main/client/src/components/ProductForm.tsx): `client/src/components/ProductForm.tsx`
- [Product catalog](https://github.com/nardoroman/inventario-app/blob/main/client/src/components/ProductList.tsx): `client/src/components/ProductList.tsx`
- [Edit modal](https://github.com/nardoroman/inventario-app/blob/main/client/src/components/EditModal.tsx): `client/src/components/EditModal.tsx`
- [API client](https://github.com/nardoroman/inventario-app/blob/main/client/src/services/api.ts): `client/src/services/api.ts`
- [Product contracts](https://github.com/nardoroman/inventario-app/blob/main/client/src/types/product.ts): `client/src/types/product.ts`

### REST backend

- [Express server](https://github.com/nardoroman/inventario-app/blob/main/server/src/server.ts): `server/src/server.ts`
- [Product routes](https://github.com/nardoroman/inventario-app/blob/main/server/src/routes/productRoutes.ts): `server/src/routes/productRoutes.ts`
- [Product controller](https://github.com/nardoroman/inventario-app/blob/main/server/src/controllers/productController.ts): `server/src/controllers/productController.ts`

### Product data

- [Database connection](https://github.com/nardoroman/inventario-app/blob/main/server/src/config/db.ts): `server/src/config/db.ts`
- [Product schema](https://github.com/nardoroman/inventario-app/blob/main/server/src/models/Product.ts): `server/src/models/Product.ts`
- [Initial product seed](https://github.com/nardoroman/inventario-app/blob/main/server/src/seed.ts): `server/src/seed.ts`

### Other components

- **Inventory user**
- **MongoDB Atlas**

## Connections

- Inventory user → Inventory dashboard: uses (evidence: `README.md`)
- Inventory dashboard → Navigation bar: renders (evidence: `client/src/App.tsx`)
- Inventory dashboard → Product form: renders (evidence: `client/src/App.tsx`)
- Inventory dashboard → Product catalog: renders (evidence: `client/src/App.tsx`)
- Inventory dashboard → Edit modal: renders (evidence: `client/src/App.tsx`)
- Inventory dashboard → API client: loads and deletes (evidence: `client/src/App.tsx`)
- Product form → API client: creates via (evidence: `client/src/components/ProductForm.tsx`)
- Edit modal → API client: updates via (evidence: `client/src/components/EditModal.tsx`)
- Inventory dashboard → Product contracts: uses types (evidence: `client/src/App.tsx`)
- Product form → Product contracts: uses types (evidence: `client/src/components/ProductForm.tsx`)
- Product catalog → Product contracts: uses types (evidence: `client/src/components/ProductList.tsx`)
- Edit modal → Product contracts: uses types (evidence: `client/src/components/EditModal.tsx`)
- API client → Product contracts: uses types (evidence: `client/src/services/api.ts`)
- API client → Express server: sends REST requests (evidence: `client/src/services/api.ts`)
- Express server → Product routes: mounts routes (evidence: `server/src/server.ts`)
- Express server → Database connection: connects before listen (evidence: `server/src/server.ts`)
- Product routes → Product controller: dispatches requests (evidence: `server/src/routes/productRoutes.ts`)
- Product controller → Product schema: queries and writes (evidence: `server/src/controllers/productController.ts`)
- Database connection → MongoDB Atlas: connects to (evidence: `server/src/config/db.ts`)
- Initial product seed → Product schema: creates seed records (evidence: `server/src/seed.ts`)
