# carloslobos17/sistema-de-gestion-de-inventario architecture

> Architecture diagram of the GitHub repository carloslobos17/sistema-de-gestion-de-inventario, 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/carloslobos17/sistema-de-gestion-de-inventario
- Repository: https://github.com/carloslobos17/sistema-de-gestion-de-inventario

## Overview

This repository is an inventory-management ERP, but the implemented user-facing scope visible here centers on login, dashboard navigation, user administration, and brand management—not the README’s broader finance or sales capabilities. The main workflow is browser login and authenticated access to role-gated pages, whose feature clients call Express routes and domain services backed by MySQL through Prisma. The backend’s startup wiring, some UI pages, and dashboard implementation were not excerpted, so links beyond explicit routing and calls are omitted or left unverified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/App.tsx) (React application), [`backend/src/app.ts`](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/app.ts) (Express API), [`frontend/src/api/axiosConfig.ts`](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/api/axiosConfig.ts) (HTTP client), [`backend/src/modules/auth/auth.routes.ts`](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/auth/auth.routes.ts) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["React application<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_httpclient["HTTP client<br/>[axiosConfig.ts]"]
end

subgraph group_identity["Identity and access"]
  node_authui["Login client<br/>[auth.service.ts]"]
  node_authhooks["Login state<br/>[useLoginForm.ts]"]
  node_authroutes["Auth routes<br/>[auth.routes.ts]"]
  node_authcontroller["Auth controller<br/>[auth.controller.ts]"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
  node_authguard["JWT authentication<br/>[auth.middleware.ts]"]
end

subgraph group_catalog["Brand management"]
  node_brandsui["Brand management UI"]
  node_brandclient["Brand API client<br/>[brands.service.ts]"]
  node_brandroutes["Brand routes<br/>[brand.routes.ts]"]
  node_brandcontroller["Brand controller"]
  node_brandservice["Brand service<br/>[brand.service.ts]"]
  node_brandrepo["Brand repository"]
end

subgraph group_administration["User administration"]
  node_usersui["User administration UI"]
  node_userclient["User API client<br/>[users.service.ts]"]
  node_userroutes["User routes<br/>[user.routes.ts]"]
  node_usercontroller["User controller<br/>[user.controller.ts]"]
  node_userservice["User service<br/>[user.service.ts]"]
  node_userrepo["User repository<br/>[user.repository.ts]"]
end

subgraph group_server["API and persistence"]
  node_api["Express API<br/>[app.ts]"]
  node_mysql[("MySQL database")]
end

node_operator(("ERP user"))

node_operator -->|"uses"| node_webapp
node_webapp -->|"routes"| node_dashboard
node_webapp -->|"routes"| node_usersui
node_webapp -->|"routes"| node_brandsui
node_authhooks -.->|"submits login"| node_authui
node_authui -->|"posts credentials"| node_httpclient
node_brandclient -->|"sends requests"| node_httpclient
node_userclient -->|"sends requests"| node_httpclient
node_httpclient -.->|"calls API"| node_api
node_api -->|"mounts routes"| node_authroutes
node_api -->|"mounts routes"| node_userroutes
node_api -->|"mounts routes"| node_brandroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"calls"| node_authservice
node_authservice -->|"looks up and saves tokens"| node_userrepo
node_authroutes -.->|"authenticates requests"| node_authguard
node_brandroutes -->|"dispatches"| node_brandcontroller
node_brandroutes -->|"authenticates requests"| node_authguard
node_brandcontroller -->|"calls"| node_brandservice
node_brandservice -->|"calls"| node_brandrepo
node_userroutes -->|"dispatches"| node_usercontroller
node_userroutes -->|"authenticates requests"| node_authguard
node_usercontroller -->|"calls"| node_userservice
node_userservice -->|"calls"| node_userrepo
node_brandrepo -.->|"reads and writes"| node_mysql
node_userrepo -.->|"reads and writes"| node_mysql

click node_webapp "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/App.tsx"
click node_dashboard "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_authui "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/features/auth/api/auth.service.ts"
click node_authhooks "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/features/auth/hooks/useLoginForm.ts"
click node_brandsui "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/tree/main/frontend/src/features/brands"
click node_brandclient "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/features/brands/api/brands.service.ts"
click node_usersui "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/tree/main/frontend/src/features/users"
click node_userclient "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/features/users/api/users.service.ts"
click node_httpclient "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/api/axiosConfig.ts"
click node_api "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/app.ts"
click node_authroutes "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/auth/auth.routes.ts"
click node_authcontroller "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/auth/auth.controller.ts"
click node_authservice "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/auth/auth.service.ts"
click node_authguard "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/middlewares/auth.middleware.ts"
click node_brandroutes "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/brands/brand.routes.ts"
click node_brandcontroller "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/brands/brand.controller.ts"
click node_brandservice "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/brands/brand.service.ts"
click node_brandrepo "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/brands/brand.repository.ts"
click node_userroutes "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/users/user.routes.ts"
click node_usercontroller "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/users/user.controller.ts"
click node_userservice "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/users/user.service.ts"
click node_userrepo "https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/users/user.repository.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_webapp,node_dashboard,node_httpclient,node_operator toneBlue
class node_authui,node_authhooks,node_authroutes,node_authcontroller,node_authservice,node_authguard toneAmber
class node_brandsui,node_brandclient,node_brandroutes,node_brandcontroller,node_brandservice,node_brandrepo toneMint
class node_usersui,node_userclient,node_userroutes,node_usercontroller,node_userservice,node_userrepo toneRose
class node_api,node_mysql toneIndigo
```

## Components

### Web application

- [React application](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [HTTP client](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/api/axiosConfig.ts): `frontend/src/api/axiosConfig.ts`

### Identity and access

- [Login client](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/features/auth/api/auth.service.ts): `frontend/src/features/auth/api/auth.service.ts`
- [Login state](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/features/auth/hooks/useLoginForm.ts): `frontend/src/features/auth/hooks/useLoginForm.ts`
- [Auth routes](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/auth/auth.routes.ts): `backend/src/modules/auth/auth.routes.ts`
- [Auth controller](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/auth/auth.controller.ts): `backend/src/modules/auth/auth.controller.ts`
- [Auth service](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/auth/auth.service.ts): `backend/src/modules/auth/auth.service.ts`
- [JWT authentication](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/middlewares/auth.middleware.ts): `backend/src/middlewares/auth.middleware.ts`

### Brand management

- [Brand management UI](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/tree/main/frontend/src/features/brands): `frontend/src/features/brands`
- [Brand API client](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/features/brands/api/brands.service.ts): `frontend/src/features/brands/api/brands.service.ts`
- [Brand routes](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/brands/brand.routes.ts): `backend/src/modules/brands/brand.routes.ts`
- [Brand controller](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/brands/brand.controller.ts): `backend/src/modules/brands/brand.controller.ts`
- [Brand service](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/brands/brand.service.ts): `backend/src/modules/brands/brand.service.ts`
- [Brand repository](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/brands/brand.repository.ts): `backend/src/modules/brands/brand.repository.ts`

### User administration

- [User administration UI](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/tree/main/frontend/src/features/users): `frontend/src/features/users`
- [User API client](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/frontend/src/features/users/api/users.service.ts): `frontend/src/features/users/api/users.service.ts`
- [User routes](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/users/user.routes.ts): `backend/src/modules/users/user.routes.ts`
- [User controller](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/users/user.controller.ts): `backend/src/modules/users/user.controller.ts`
- [User service](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/users/user.service.ts): `backend/src/modules/users/user.service.ts`
- [User repository](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/modules/users/user.repository.ts): `backend/src/modules/users/user.repository.ts`

### API and persistence

- [Express API](https://github.com/carloslobos17/sistema-de-gestion-de-inventario/blob/main/backend/src/app.ts): `backend/src/app.ts`
- **MySQL database**

### Other components

- **ERP user**

## Connections

- ERP user → React application: uses (evidence: `frontend/src/App.tsx`)
- React application → Dashboard: routes (evidence: `frontend/src/App.tsx`)
- React application → User administration UI: routes (evidence: `frontend/src/App.tsx`)
- React application → Brand management UI: routes (evidence: `frontend/src/App.tsx`)
- Login state → Login client: submits login
- Login client → HTTP client: posts credentials (evidence: `frontend/src/features/auth/api/auth.service.ts`)
- Brand API client → HTTP client: sends requests (evidence: `frontend/src/features/brands/api/brands.service.ts`)
- User API client → HTTP client: sends requests (evidence: `frontend/src/features/users/api/users.service.ts`)
- HTTP client → Express API: calls API
- Express API → Auth routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → User routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Brand routes: mounts routes (evidence: `backend/src/app.ts`)
- Auth routes → Auth controller: dispatches (evidence: `backend/src/modules/auth/auth.routes.ts`)
- Auth controller → Auth service: calls (evidence: `backend/src/modules/auth/auth.controller.ts`)
- Auth service → User repository: looks up and saves tokens (evidence: `backend/src/modules/auth/auth.service.ts`)
- Auth routes → JWT authentication: authenticates requests
- Brand routes → Brand controller: dispatches (evidence: `backend/src/modules/brands/brand.routes.ts`)
- Brand routes → JWT authentication: authenticates requests (evidence: `backend/src/modules/brands/brand.routes.ts`)
- Brand controller → Brand service: calls (evidence: `backend/src/modules/brands/brand.controller.ts`)
- Brand service → Brand repository: calls (evidence: `backend/src/modules/brands/brand.service.ts`)
- User routes → User controller: dispatches (evidence: `backend/src/modules/users/user.routes.ts`)
- User routes → JWT authentication: authenticates requests (evidence: `backend/src/modules/users/user.routes.ts`)
- User controller → User service: calls (evidence: `backend/src/modules/users/user.controller.ts`)
- User service → User repository: calls (evidence: `backend/src/modules/users/user.service.ts`)
- Brand repository → MySQL database: reads and writes
- User repository → MySQL database: reads and writes
