# goncho05/proyecto-mueblerias-jota architecture

> Architecture diagram of the GitHub repository goncho05/proyecto-mueblerias-jota, 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/goncho05/proyecto-mueblerias-jota
- Repository: https://github.com/goncho05/proyecto-mueblerias-jota

## Overview

Mueblería Hermanos Jota is a furniture-catalog e-commerce application: customers browse a catalog and product details, while administrators can create and edit products. The React client calls an Express API backed by MongoDB; the client also maintains an in-memory cart. Authentication and role checks protect administrative product routes. The README describes the principal catalog flow, while the provided excerpts establish API routing, persistence calls, and admin-form operations; some UI-to-service call details are not excerpted, so those links are marked unverified.

Main entry points: [`client/src/App.jsx`](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/App.jsx) (App and cart), [`backend/server.js`](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/server.js) (Express server), [`client/src/components/ProductList.jsx`](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ProductList.jsx) (Product list), [`client/src/services/productos.js`](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/services/productos.js) (Product API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront UI"]
  node_app["App and cart<br/>[App.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_product_list["Product list<br/>[ProductList.jsx]"]
  node_product_card["Product card<br/>[ProductCard.jsx]"]
  node_product_detail["Product detail<br/>[ProductDetail.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_contact["Contact form<br/>[ContactForm.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_admin_form["Product admin form"]
  node_product_service["Product API client<br/>[productos.js]"]
end

subgraph group_catalog["Catalog API"]
  node_api["Express server<br/>[server.js]"]
  node_product_routes["Product routes"]
  node_product_controller["Product operations"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_auth_controller["Registration and login<br/>[auth.controller.js]"]
  node_auth_middleware["Token validation<br/>[auth.middleware.js]"]
  node_admin_guard["Admin authorization"]
end

subgraph group_persistence["Data and persistence"]
  node_product_model["Product model<br/>[product.js]"]
  node_user_model["User model<br/>[user.js]"]
  node_database[("MongoDB<br/>[db.js]")]
  node_seed["Product seed data<br/>[productos.js]"]
  node_seed_runner["Seed runner<br/>[seed.js]"]
end

node_visitor(("Shopper"))
node_api_user(("API client"))

node_visitor -->|"browses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_product_list
node_app -->|"routes to"| node_product_detail
node_app -->|"routes to"| node_contact
node_app -->|"routes to"| node_admin_form
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_app -->|"supplies cart action"| node_product_list
node_app -->|"supplies cart action"| node_product_detail
node_app -->|"supplies cart count"| node_navbar
node_home -.->|"uses"| node_product_list
node_product_list -.->|"renders"| node_product_card
node_product_list -.->|"loads products"| node_product_service
node_product_detail -.->|"loads detail"| node_product_service
node_admin_form -->|"reads and saves"| node_product_service
node_product_card -.->|"uses image URL"| node_product_service
node_product_service -->|"HTTP requests"| node_api
node_api_user -->|"sends requests"| node_api
node_api -->|"mounts routes"| node_product_routes
node_api -->|"mounts routes"| node_auth_routes
node_product_routes -->|"dispatches"| node_product_controller
node_product_routes -->|"protects writes"| node_auth_middleware
node_product_routes -->|"checks admin role"| node_admin_guard
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"reads and writes users"| node_user_model
node_product_controller -->|"reads and writes products"| node_product_model
node_api -->|"connects"| node_database
node_seed_runner -->|"loads records"| node_seed
node_seed_runner -->|"creates records"| node_product_model

click node_app "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/App.jsx"
click node_home "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/pages/Home.jsx"
click node_product_list "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ProductList.jsx"
click node_product_card "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ProductCard.jsx"
click node_product_detail "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ProductDetail.jsx"
click node_navbar "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/Navbar.jsx"
click node_contact "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ContactForm.jsx"
click node_footer "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/Footer.jsx"
click node_admin_form "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/AdminProductForm.jsx"
click node_product_service "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/services/productos.js"
click node_api "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/server.js"
click node_product_routes "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/routes/productos.routes.js"
click node_product_controller "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/controllers/producto.controller.js"
click node_auth_routes "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/routes/auth.routes.js"
click node_auth_controller "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/controllers/auth.controller.js"
click node_auth_middleware "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/middlewares/auth.middleware.js"
click node_admin_guard "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/middlewares/admin.middleware.js"
click node_product_model "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/models/product.js"
click node_user_model "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/models/user.js"
click node_database "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/config/db.js"
click node_seed "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/data/productos.js"
click node_seed_runner "https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/seed.js"

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_home,node_product_list,node_product_card,node_product_detail,node_navbar,node_contact,node_footer,node_admin_form,node_product_service,node_api_user toneBlue
class node_api,node_product_routes,node_product_controller toneAmber
class node_auth_routes,node_auth_controller,node_auth_middleware,node_admin_guard toneMint
class node_product_model,node_user_model,node_database,node_seed,node_seed_runner toneRose
class node_visitor toneIndigo
```

## Components

### Storefront UI

- [App and cart](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Home page](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Product list](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ProductList.jsx): `client/src/components/ProductList.jsx`
- [Product card](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ProductCard.jsx): `client/src/components/ProductCard.jsx`
- [Product detail](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ProductDetail.jsx): `client/src/components/ProductDetail.jsx`
- [Navigation](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/Navbar.jsx): `client/src/components/Navbar.jsx`
- [Contact form](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/ContactForm.jsx): `client/src/components/ContactForm.jsx`
- [Footer](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/Footer.jsx): `client/src/components/Footer.jsx`
- [Product admin form](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/components/AdminProductForm.jsx): `client/src/components/AdminProductForm.jsx`
- [Product API client](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/client/src/services/productos.js): `client/src/services/productos.js`

### Catalog API

- [Express server](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/server.js): `backend/server.js`
- [Product routes](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/routes/productos.routes.js): `backend/routes/productos.routes.js`
- [Product operations](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/controllers/producto.controller.js): `backend/controllers/producto.controller.js`

### Identity and access

- [Auth routes](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/routes/auth.routes.js): `backend/routes/auth.routes.js`
- [Registration and login](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/controllers/auth.controller.js): `backend/controllers/auth.controller.js`
- [Token validation](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/middlewares/auth.middleware.js): `backend/middlewares/auth.middleware.js`
- [Admin authorization](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/middlewares/admin.middleware.js): `backend/middlewares/admin.middleware.js`

### Data and persistence

- [Product model](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/models/product.js): `backend/models/product.js`
- [User model](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/models/user.js): `backend/models/user.js`
- [MongoDB](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/config/db.js): `backend/config/db.js`
- [Product seed data](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/data/productos.js): `backend/data/productos.js`
- [Seed runner](https://github.com/goncho05/proyecto-mueblerias-jota/blob/main/backend/seed.js): `backend/seed.js`

### Other components

- **Shopper**
- **API client**

## Connections

- Shopper → App and cart: browses
- App and cart → Home page: routes to (evidence: `client/src/App.jsx`)
- App and cart → Product list: routes to (evidence: `client/src/App.jsx`)
- App and cart → Product detail: routes to (evidence: `client/src/App.jsx`)
- App and cart → Contact form: routes to (evidence: `client/src/App.jsx`)
- App and cart → Product admin form: routes to (evidence: `client/src/App.jsx`)
- App and cart → Navigation: renders (evidence: `client/src/App.jsx`)
- App and cart → Footer: renders (evidence: `client/src/App.jsx`)
- App and cart → Product list: supplies cart action (evidence: `client/src/App.jsx`)
- App and cart → Product detail: supplies cart action (evidence: `client/src/App.jsx`)
- App and cart → Navigation: supplies cart count (evidence: `client/src/App.jsx`)
- Home page → Product list: uses (evidence: `client/src/pages/Home.jsx`)
- Product list → Product card: renders (evidence: `client/src/components/ProductList.jsx`)
- Product list → Product API client: loads products (evidence: `client/src/components/ProductList.jsx`)
- Product detail → Product API client: loads detail (evidence: `client/src/components/ProductDetail.jsx`)
- Product admin form → Product API client: reads and saves (evidence: `client/src/components/AdminProductForm.jsx`)
- Product card → Product API client: uses image URL (evidence: `client/src/components/ProductCard.jsx`)
- Product API client → Express server: HTTP requests
- API client → Express server: sends requests
- Express server → Product routes: mounts routes (evidence: `backend/server.js`)
- Express server → Auth routes: mounts routes (evidence: `backend/server.js`)
- Product routes → Product operations: dispatches (evidence: `backend/routes/productos.routes.js`)
- Product routes → Token validation: protects writes (evidence: `backend/routes/productos.routes.js`)
- Product routes → Admin authorization: checks admin role (evidence: `backend/routes/productos.routes.js`)
- Auth routes → Registration and login: dispatches (evidence: `backend/routes/auth.routes.js`)
- Registration and login → User model: reads and writes users (evidence: `backend/controllers/auth.controller.js`)
- Product operations → Product model: reads and writes products (evidence: `backend/controllers/producto.controller.js`)
- Express server → MongoDB: connects (evidence: `backend/server.js`)
- Seed runner → Product seed data: loads records (evidence: `backend/seed.js`)
- Seed runner → Product model: creates records (evidence: `backend/seed.js`)
