# gegs-12358/ferreteria architecture

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

- Interactive diagram: https://gitdiagram.com/gegs-12358/ferreteria
- Repository: https://github.com/gegs-12358/ferreteria

## Overview

FERREMAS is a multi-service hardware e-commerce platform. The main user journey runs from the Django web interface through catalog browsing and cart/checkout to order and payment services; authentication and role-based operations support the customer and staff workflows. The README documents additional capabilities including stock reduction, Stripe and bank-transfer payments, currency conversion, user administration, and role-specific order states. Source excerpts confirm several service-layer calls; cross-service links and unsampled feature links are based on README documentation.

Main entry points: [`fronted/ferremas_app/views.py`](https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/views.py) (Web application), [`auth/src/main/java/com/ferremas/auth/controller/AuthController.java`](https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/controller/AuthController.java) (Auth API), [`pedidos_ms/pedidos/views.py`](https://github.com/gegs-12358/ferreteria/blob/main/pedidos_ms/pedidos/views.py) (Order API), [`pagos/pagos_app/views.py`](https://github.com/gegs-12358/ferreteria/blob/main/pagos/pagos_app/views.py) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web application<br/>[views.py]"]
  node_cart["Cart and checkout<br/>[carrito.js]"]
  node_catalogui["Catalog interface<br/>[productos.js]"]
  node_useradmin["User administration<br/>[crud_usuarios.js]"]
  node_currencyui["Currency conversion<br/>[moneda.js]"]
end

subgraph group_identity["Identity and access"]
  node_authapi["Auth API"]
  node_user_service["User service"]
  node_user_store[("Users and roles<br/>[Usuario.java]")]
  node_jwt["JWT security<br/>[JwtUtil.java]"]
end

subgraph group_catalog["Product catalog"]
  node_productapi["Product API"]
  node_product_store[("Product catalog store<br/>[Producto.java]")]
end

subgraph group_orders["Order operations"]
  node_orderapi["Order API<br/>[views.py]"]
  node_orderdata[("Order records<br/>[models.py]")]
  node_order_serializer["Order serialization<br/>[serializers.py]"]
end

subgraph group_payments["Payments and currency"]
  node_paymentapi["Payment processing<br/>[views.py]"]
  node_paymentdata[("Payment records<br/>[models.py]")]
end

node_shopper(("Shopper and staff"))
node_stripe["Stripe Checkout"]
node_centralbank["Central Bank currency API"]

node_shopper -->|"uses"| node_webapp
node_webapp -->|"consumes auth"| node_authapi
node_webapp -->|"consumes catalog"| node_productapi
node_webapp -->|"consumes orders"| node_orderapi
node_webapp -->|"consumes payments"| node_paymentapi
node_cart -.->|"supports checkout"| node_webapp
node_catalogui -.->|"supports browsing"| node_webapp
node_useradmin -.->|"supports administration"| node_webapp
node_currencyui -->|"fetches rates"| node_centralbank
node_authapi -->|"registers and authenticates"| node_user_service
node_authapi -->|"creates and validates"| node_jwt
node_authapi -->|"reads and updates"| node_user_store
node_user_service -->|"persists users"| node_user_store
node_productapi -->|"reads and writes"| node_product_store
node_orderapi -->|"serializes orders"| node_order_serializer
node_orderapi -->|"reads and updates"| node_orderdata
node_order_serializer -->|"serializes records"| node_orderdata
node_paymentapi -->|"records payments"| node_paymentdata
node_paymentapi -->|"offers card checkout"| node_stripe
node_orderapi -.->|"reduces stock"| node_productapi

click node_webapp "https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/views.py"
click node_cart "https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/static/js/carrito.js"
click node_catalogui "https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/static/js/productos.js"
click node_useradmin "https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/static/js/crud_usuarios.js"
click node_currencyui "https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/static/js/moneda.js"
click node_authapi "https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/controller/AuthController.java"
click node_user_service "https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/service/UsuarioService.java"
click node_user_store "https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/model/Usuario.java"
click node_jwt "https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/security/JwtUtil.java"
click node_productapi "https://github.com/gegs-12358/ferreteria/blob/main/productos/src/main/java/com/ferremas/productos/controller/ProductoController.java"
click node_product_store "https://github.com/gegs-12358/ferreteria/blob/main/productos/src/main/java/com/ferremas/productos/model/Producto.java"
click node_orderapi "https://github.com/gegs-12358/ferreteria/blob/main/pedidos_ms/pedidos/views.py"
click node_orderdata "https://github.com/gegs-12358/ferreteria/blob/main/pedidos_ms/pedidos/models.py"
click node_order_serializer "https://github.com/gegs-12358/ferreteria/blob/main/pedidos_ms/pedidos/serializers.py"
click node_paymentapi "https://github.com/gegs-12358/ferreteria/blob/main/pagos/pagos_app/views.py"
click node_paymentdata "https://github.com/gegs-12358/ferreteria/blob/main/pagos/pagos_app/models.py"

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_cart,node_catalogui,node_useradmin,node_currencyui toneBlue
class node_authapi,node_user_service,node_user_store,node_jwt toneAmber
class node_productapi,node_product_store,node_centralbank toneMint
class node_orderapi,node_orderdata,node_order_serializer toneRose
class node_paymentapi,node_paymentdata,node_shopper,node_stripe toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/views.py): `fronted/ferremas_app/views.py`
- [Cart and checkout](https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/static/js/carrito.js): `fronted/ferremas_app/static/js/carrito.js`
- [Catalog interface](https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/static/js/productos.js): `fronted/ferremas_app/static/js/productos.js`
- [User administration](https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/static/js/crud_usuarios.js): `fronted/ferremas_app/static/js/crud_usuarios.js`
- [Currency conversion](https://github.com/gegs-12358/ferreteria/blob/main/fronted/ferremas_app/static/js/moneda.js): `fronted/ferremas_app/static/js/moneda.js`

### Identity and access

- [Auth API](https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/controller/AuthController.java): `auth/src/main/java/com/ferremas/auth/controller/AuthController.java`
- [User service](https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/service/UsuarioService.java): `auth/src/main/java/com/ferremas/auth/service/UsuarioService.java`
- [Users and roles](https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/model/Usuario.java): `auth/src/main/java/com/ferremas/auth/model/Usuario.java`
- [JWT security](https://github.com/gegs-12358/ferreteria/blob/main/auth/src/main/java/com/ferremas/auth/security/JwtUtil.java): `auth/src/main/java/com/ferremas/auth/security/JwtUtil.java`

### Product catalog

- [Product API](https://github.com/gegs-12358/ferreteria/blob/main/productos/src/main/java/com/ferremas/productos/controller/ProductoController.java): `productos/src/main/java/com/ferremas/productos/controller/ProductoController.java`
- [Product catalog store](https://github.com/gegs-12358/ferreteria/blob/main/productos/src/main/java/com/ferremas/productos/model/Producto.java): `productos/src/main/java/com/ferremas/productos/model/Producto.java`

### Order operations

- [Order API](https://github.com/gegs-12358/ferreteria/blob/main/pedidos_ms/pedidos/views.py): `pedidos_ms/pedidos/views.py`
- [Order records](https://github.com/gegs-12358/ferreteria/blob/main/pedidos_ms/pedidos/models.py): `pedidos_ms/pedidos/models.py`
- [Order serialization](https://github.com/gegs-12358/ferreteria/blob/main/pedidos_ms/pedidos/serializers.py): `pedidos_ms/pedidos/serializers.py`

### Payments and currency

- [Payment processing](https://github.com/gegs-12358/ferreteria/blob/main/pagos/pagos_app/views.py): `pagos/pagos_app/views.py`
- [Payment records](https://github.com/gegs-12358/ferreteria/blob/main/pagos/pagos_app/models.py): `pagos/pagos_app/models.py`

### Other components

- **Shopper and staff**
- **Stripe Checkout**
- **Central Bank currency API**

## Connections

- Shopper and staff → Web application: uses
- Web application → Auth API: consumes auth
- Web application → Product API: consumes catalog
- Web application → Order API: consumes orders
- Web application → Payment processing: consumes payments
- Cart and checkout → Web application: supports checkout
- Catalog interface → Web application: supports browsing
- User administration → Web application: supports administration
- Currency conversion → Central Bank currency API: fetches rates
- Auth API → User service: registers and authenticates (evidence: `auth/src/main/java/com/ferremas/auth/controller/AuthController.java`)
- Auth API → JWT security: creates and validates (evidence: `auth/src/main/java/com/ferremas/auth/controller/AuthController.java`)
- Auth API → Users and roles: reads and updates (evidence: `auth/src/main/java/com/ferremas/auth/controller/AuthController.java`)
- User service → Users and roles: persists users (evidence: `auth/src/main/java/com/ferremas/auth/service/UsuarioService.java`)
- Product API → Product catalog store: reads and writes (evidence: `productos/src/main/java/com/ferremas/productos/controller/ProductoController.java`)
- Order API → Order serialization: serializes orders (evidence: `pedidos_ms/pedidos/views.py`)
- Order API → Order records: reads and updates (evidence: `pedidos_ms/pedidos/views.py`)
- Order serialization → Order records: serializes records (evidence: `pedidos_ms/pedidos/serializers.py`)
- Payment processing → Payment records: records payments (evidence: `pagos/pagos_app/views.py`)
- Payment processing → Stripe Checkout: offers card checkout
- Order API → Product API: reduces stock
