# stivencr7/catalogoproductos_prueba architecture

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

- Interactive diagram: https://gitdiagram.com/stivencr7/catalogoproductos_prueba
- Repository: https://github.com/stivencr7/catalogoproductos_prueba

## Overview

This is a product-catalog application: users authenticate, then browse and edit products in an Angular interface backed by Spring REST endpoints and MySQL. A separate catalog-import capability fetches categories and products from Fake Store API and stores new records locally. The graph captures the sampled controller, service, repository, and JWT interactions plus README-documented frontend/API and database capabilities; unsampled Angular service wiring and startup database setup are represented only where documentation supports them.

Main entry points: [`BackendStoreApi/src/main/java/com/storeApi/web/service/CatalogoService.java`](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/service/CatalogoService.java) (Catalog importer), [`BackendStoreApi/src/main/java/com/storeApi/web/repository/CategoriaRepository.java`](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/repository/CategoriaRepository.java) (Category repository), [`FrontedStoreApi/src/app/app.routes.ts`](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/app.routes.ts) (App routes), [`BackendStoreApi/src/main/java/com/storeApi/web/controller/LoginController.java`](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/LoginController.java) (Login endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular storefront"]
  node_routes["App routes<br/>[app.routes.ts]"]
  node_login_ui["Login screen<br/>[login.component.ts]"]
  node_products_ui["Product grid"]
  node_auth_service["Auth service<br/>[auth.service.ts]"]
  node_product_service["Product service"]
  node_category_service["Category service"]
end

subgraph group_api["REST API"]
  node_login_api["Login endpoint"]
  node_product_api["Product endpoints"]
  node_category_api["Category endpoint"]
  node_catalog_api["Import endpoint"]
end

subgraph group_security["Authentication"]
  node_jwt["JWT handling<br/>[JWTCreator.java]"]
  node_jwt_filter["JWT request filter<br/>[JWTFilter.java]"]
end

subgraph group_catalog["Catalog import"]
  node_catalog_import["Catalog importer"]
end

subgraph group_persistence["Persistence"]
  node_product_repo["Product repository"]
  node_category_repo["Category repository"]
  node_user_repo["User repository"]
  node_mysql[("MySQL database")]
end

node_user(("Store user"))
node_fake_api["Fake Store API"]

node_user -->|"uses"| node_routes
node_routes -->|"routes to"| node_login_ui
node_routes -->|"guards route"| node_products_ui
node_login_ui -->|"submits login"| node_auth_service
node_products_ui -->|"requests products"| node_product_service
node_user -->|"browses catalog"| node_products_ui
node_auth_service -->|"posts credentials"| node_login_api
node_product_service -->|"consumes endpoints"| node_product_api
node_category_service -->|"consumes endpoints"| node_category_api
node_login_api -->|"looks up user"| node_user_repo
node_login_api -->|"creates token"| node_jwt
node_jwt_filter -->|"validates token"| node_jwt
node_product_api -->|"reads and saves"| node_product_repo
node_product_api -->|"checks category"| node_category_repo
node_category_api -->|"accesses categories"| node_category_repo
node_catalog_api -->|"invokes import"| node_catalog_import
node_catalog_import -->|"fetches catalog"| node_fake_api
node_catalog_import -->|"finds and saves"| node_category_repo
node_catalog_import -->|"checks and saves"| node_product_repo
node_product_repo -->|"persists entities"| node_mysql
node_category_repo -->|"persists entities"| node_mysql
node_user_repo -->|"persists entities"| node_mysql

click node_routes "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/app.routes.ts"
click node_login_ui "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/login/login.component.ts"
click node_products_ui "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/productos/prodcutos.component.ts"
click node_auth_service "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/Services/auth.service.ts"
click node_product_service "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/Services/producto.service.ts"
click node_category_service "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/Services/categorias.service.ts"
click node_login_api "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/LoginController.java"
click node_product_api "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/ProdcutosController.java"
click node_category_api "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/CategoriaController.java"
click node_catalog_api "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/CatalogoController.java"
click node_jwt "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/security/JWTCreator.java"
click node_jwt_filter "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/security/JWTFilter.java"
click node_catalog_import "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/service/CatalogoService.java"
click node_product_repo "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/repository/ProductosRepository.java"
click node_category_repo "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/repository/CategoriaRepository.java"
click node_user_repo "https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/repository/UsuarioRepository.java"

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_routes,node_login_ui,node_products_ui,node_auth_service,node_product_service,node_category_service,node_user toneBlue
class node_login_api,node_product_api,node_category_api,node_catalog_api toneAmber
class node_jwt,node_jwt_filter,node_fake_api toneMint
class node_catalog_import toneRose
class node_product_repo,node_category_repo,node_user_repo,node_mysql toneIndigo
```

## Components

### Angular storefront

- [App routes](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/app.routes.ts): `FrontedStoreApi/src/app/app.routes.ts`
- [Login screen](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/login/login.component.ts): `FrontedStoreApi/src/app/login/login.component.ts`
- [Product grid](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/productos/prodcutos.component.ts): `FrontedStoreApi/src/app/productos/prodcutos.component.ts`
- [Auth service](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/Services/auth.service.ts): `FrontedStoreApi/src/app/Services/auth.service.ts`
- [Product service](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/Services/producto.service.ts): `FrontedStoreApi/src/app/Services/producto.service.ts`
- [Category service](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/FrontedStoreApi/src/app/Services/categorias.service.ts): `FrontedStoreApi/src/app/Services/categorias.service.ts`

### REST API

- [Login endpoint](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/LoginController.java): `BackendStoreApi/src/main/java/com/storeApi/web/controller/LoginController.java`
- [Product endpoints](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/ProdcutosController.java): `BackendStoreApi/src/main/java/com/storeApi/web/controller/ProdcutosController.java`
- [Category endpoint](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/CategoriaController.java): `BackendStoreApi/src/main/java/com/storeApi/web/controller/CategoriaController.java`
- [Import endpoint](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/controller/CatalogoController.java): `BackendStoreApi/src/main/java/com/storeApi/web/controller/CatalogoController.java`

### Authentication

- [JWT handling](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/security/JWTCreator.java): `BackendStoreApi/src/main/java/com/storeApi/web/security/JWTCreator.java`
- [JWT request filter](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/security/JWTFilter.java): `BackendStoreApi/src/main/java/com/storeApi/web/security/JWTFilter.java`

### Catalog import

- [Catalog importer](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/service/CatalogoService.java): `BackendStoreApi/src/main/java/com/storeApi/web/service/CatalogoService.java`

### Persistence

- [Product repository](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/repository/ProductosRepository.java): `BackendStoreApi/src/main/java/com/storeApi/web/repository/ProductosRepository.java`
- [Category repository](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/repository/CategoriaRepository.java): `BackendStoreApi/src/main/java/com/storeApi/web/repository/CategoriaRepository.java`
- [User repository](https://github.com/stivencr7/catalogoproductos_prueba/blob/main/BackendStoreApi/src/main/java/com/storeApi/web/repository/UsuarioRepository.java): `BackendStoreApi/src/main/java/com/storeApi/web/repository/UsuarioRepository.java`
- **MySQL database**

### Other components

- **Store user**
- **Fake Store API**

## Connections

- Store user → App routes: uses (evidence: `FrontedStoreApi/src/app/app.routes.ts`)
- App routes → Login screen: routes to (evidence: `FrontedStoreApi/src/app/app.routes.ts`)
- App routes → Product grid: guards route (evidence: `FrontedStoreApi/src/app/app.routes.ts`)
- Login screen → Auth service: submits login (evidence: `FrontedStoreApi/src/app/login/login.component.ts`)
- Product grid → Product service: requests products (evidence: `FrontedStoreApi/src/app/productos/prodcutos.component.ts`)
- Store user → Product grid: browses catalog (evidence: `README.md`)
- Auth service → Login endpoint: posts credentials (evidence: `FrontedStoreApi/src/app/Services/auth.service.ts`)
- Product service → Product endpoints: consumes endpoints (evidence: `README.md`)
- Category service → Category endpoint: consumes endpoints (evidence: `README.md`)
- Login endpoint → User repository: looks up user (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/controller/LoginController.java`)
- Login endpoint → JWT handling: creates token (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/controller/LoginController.java`)
- JWT request filter → JWT handling: validates token (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/security/JWTFilter.java`)
- Product endpoints → Product repository: reads and saves (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/controller/ProdcutosController.java`)
- Product endpoints → Category repository: checks category (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/controller/ProdcutosController.java`)
- Category endpoint → Category repository: accesses categories (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/controller/CategoriaController.java`)
- Import endpoint → Catalog importer: invokes import (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/controller/CatalogoController.java`)
- Catalog importer → Fake Store API: fetches catalog (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/service/CatalogoService.java`)
- Catalog importer → Category repository: finds and saves (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/service/CatalogoService.java`)
- Catalog importer → Product repository: checks and saves (evidence: `BackendStoreApi/src/main/java/com/storeApi/web/service/CatalogoService.java`)
- Product repository → MySQL database: persists entities (evidence: `README.md`)
- Category repository → MySQL database: persists entities (evidence: `README.md`)
- User repository → MySQL database: persists entities (evidence: `README.md`)
