# jdcarrillo15/reto2software2 architecture

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

- Interactive diagram: https://gitdiagram.com/jdcarrillo15/reto2software2
- Repository: https://github.com/jdcarrillo15/reto2software2

## Overview

This is a customer-and-order management application split into a React interface, a command service, and a query service. Users navigate to register or log in, manage customers and orders, and look up customer or order information; the frontend’s customer client targets separate command and query endpoints. The command service persists customer/order changes and publishes events, while the query service maintains read-side data. Authentication includes Keycloak user administration. Several event and UI-to-service links are inferred from names or endpoint configuration rather than shown in sampled call sites, so those links are marked unverified.

Main entry points: [`frontend/src/Menu.js`](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/Menu.js) (App routes), [`frontend/src/service/CustomerService.js`](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/service/CustomerService.js) (Customer API client), [`frontend/src/service/OrderService.js`](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/service/OrderService.js) (Order API client), [`retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerService.java`](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerService.java) (Customer command service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_router["App routes<br/>[Menu.js]"]
  node_customer_ui["Customer screens<br/>[AddCustomer.js]"]
  node_order_ui["Order screens<br/>[OrderForm.js]"]
  node_login_ui["Login and register<br/>[Login.js]"]
  node_customer_client["Customer API client<br/>[CustomerService.js]"]
  node_order_client["Order API client<br/>[OrderService.js]"]
end

subgraph group_command["Command service"]
  node_customer_cmd["Customer command API"]
  node_customer_cmd_service["Customer command service"]
  node_order_cmd["Order command API"]
  node_order_cmd_service["Order command service<br/>[OrderService.java]"]
  node_customer_events_out["Customer event publisher"]
  node_order_events_out["Order event publisher"]
end

subgraph group_query["Query service"]
  node_customer_query["Customer query API"]
  node_customer_query_service["Customer query service"]
  node_customer_consumer["Customer event consumer"]
  node_order_query["Order query API"]
  node_order_query_service["Order query service<br/>[OrderService.java]"]
  node_order_consumer["Order event consumer"]
end

subgraph group_auth["Authentication"]
  node_keycloak_api["Keycloak user API"]
  node_keycloak_service["Keycloak service"]
end

subgraph group_integration["Stores and events"]
  node_mysql_customer["Customer persistence adapter"]
  node_mysql_order[("Order repository")]
  node_customer_mongo[("Customer read store")]
  node_order_mongo[("Order read store")]
end

node_user(("User"))
node_keycloak{{"Keycloak"}}

node_user -->|"navigates"| node_router
node_router -->|"routes to"| node_customer_ui
node_router -->|"routes to"| node_order_ui
node_router -->|"routes to"| node_login_ui
node_customer_ui -->|"calls"| node_customer_client
node_customer_client -->|"HTTP command"| node_customer_cmd
node_customer_client -->|"HTTP query"| node_customer_query
node_order_ui -.->|"calls"| node_order_client
node_order_client -.->|"HTTP command"| node_order_cmd
node_order_client -.->|"HTTP query"| node_order_query
node_customer_cmd -->|"delegates"| node_customer_cmd_service
node_customer_cmd_service -->|"persists"| node_mysql_customer
node_customer_cmd_service -->|"publishes"| node_customer_events_out
node_order_cmd -->|"delegates"| node_order_cmd_service
node_order_cmd_service -->|"saves"| node_mysql_order
node_order_cmd_service -->|"publishes"| node_order_events_out
node_customer_events_out -.->|"event delivery"| node_customer_consumer
node_order_events_out -.->|"event delivery"| node_order_consumer
node_customer_query_service -->|"reads and saves"| node_customer_mongo
node_order_query_service -->|"queries and updates"| node_order_mongo
node_customer_query -.->|"delegates"| node_customer_query_service
node_order_query -.->|"delegates"| node_order_query_service
node_keycloak_api -->|"calls"| node_keycloak_service
node_keycloak_service -.->|"administers users"| node_keycloak

click node_router "https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/Menu.js"
click node_customer_ui "https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/components/AddCustomer.js"
click node_order_ui "https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/components/OrderForm.js"
click node_login_ui "https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/components/Login.js"
click node_customer_client "https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/service/CustomerService.js"
click node_order_client "https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/service/OrderService.js"
click node_customer_cmd "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerController.java"
click node_customer_cmd_service "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerService.java"
click node_order_cmd "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderController.java"
click node_order_cmd_service "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderService.java"
click node_customer_events_out "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerEventProducer.java"
click node_order_events_out "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderEventProducer.java"
click node_mysql_customer "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Infrastructure/CustomerPortMysql.java"
click node_mysql_order "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Infrastructure/OrderRepository.java"
click node_customer_query "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerController.java"
click node_customer_query_service "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerService.java"
click node_customer_consumer "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerEventConsumer.java"
click node_customer_mongo "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Infrastructure/CustomerPortMongo.java"
click node_order_query "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderController.java"
click node_order_query_service "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderService.java"
click node_order_consumer "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderEventConsumer.java"
click node_order_mongo "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Infrastructure/OrderPortMongo.java"
click node_keycloak_api "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Login/Adapters/Input/KeycloakController.java"
click node_keycloak_service "https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Login/Aplication/impl/KeycloakServiceImpl.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_router,node_customer_ui,node_order_ui,node_login_ui,node_customer_client,node_order_client,node_user toneBlue
class node_customer_cmd,node_customer_cmd_service,node_order_cmd,node_order_cmd_service,node_customer_events_out,node_order_events_out toneAmber
class node_customer_query,node_customer_query_service,node_customer_consumer,node_order_query,node_order_query_service,node_order_consumer toneMint
class node_keycloak_api,node_keycloak_service toneRose
class node_mysql_customer,node_mysql_order,node_customer_mongo,node_order_mongo,node_keycloak toneIndigo
```

## Components

### Web interface

- [App routes](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/Menu.js): `frontend/src/Menu.js`
- [Customer screens](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/components/AddCustomer.js): `frontend/src/components/AddCustomer.js`
- [Order screens](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/components/OrderForm.js): `frontend/src/components/OrderForm.js`
- [Login and register](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/components/Login.js): `frontend/src/components/Login.js`
- [Customer API client](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/service/CustomerService.js): `frontend/src/service/CustomerService.js`
- [Order API client](https://github.com/jdcarrillo15/reto2software2/blob/main/frontend/src/service/OrderService.js): `frontend/src/service/OrderService.js`

### Command service

- [Customer command API](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerController.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerController.java`
- [Customer command service](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerService.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerService.java`
- [Order command API](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderController.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderController.java`
- [Order command service](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderService.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderService.java`
- [Customer event publisher](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerEventProducer.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerEventProducer.java`
- [Order event publisher](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderEventProducer.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderEventProducer.java`

### Query service

- [Customer query API](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerController.java): `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerController.java`
- [Customer query service](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerService.java): `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerService.java`
- [Customer event consumer](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerEventConsumer.java): `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerEventConsumer.java`
- [Order query API](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderController.java): `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderController.java`
- [Order query service](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderService.java): `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderService.java`
- [Order event consumer](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderEventConsumer.java): `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderEventConsumer.java`

### Authentication

- [Keycloak user API](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Login/Adapters/Input/KeycloakController.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Login/Adapters/Input/KeycloakController.java`
- [Keycloak service](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Login/Aplication/impl/KeycloakServiceImpl.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Login/Aplication/impl/KeycloakServiceImpl.java`

### Stores and events

- [Customer persistence adapter](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Infrastructure/CustomerPortMysql.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Infrastructure/CustomerPortMysql.java`
- [Order repository](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Infrastructure/OrderRepository.java): `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Infrastructure/OrderRepository.java`
- [Customer read store](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Infrastructure/CustomerPortMongo.java): `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Infrastructure/CustomerPortMongo.java`
- [Order read store](https://github.com/jdcarrillo15/reto2software2/blob/main/retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Infrastructure/OrderPortMongo.java): `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Infrastructure/OrderPortMongo.java`

### Other components

- **User**
- **Keycloak**

## Connections

- User → App routes: navigates (evidence: `frontend/src/Menu.js`)
- App routes → Customer screens: routes to (evidence: `frontend/src/Menu.js`)
- App routes → Order screens: routes to (evidence: `frontend/src/Menu.js`)
- App routes → Login and register: routes to (evidence: `frontend/src/Menu.js`)
- Customer screens → Customer API client: calls (evidence: `frontend/src/components/AddCustomer.js`)
- Customer API client → Customer command API: HTTP command (evidence: `frontend/src/service/CustomerService.js`)
- Customer API client → Customer query API: HTTP query (evidence: `frontend/src/service/CustomerService.js`)
- Order screens → Order API client: calls
- Order API client → Order command API: HTTP command
- Order API client → Order query API: HTTP query
- Customer command API → Customer command service: delegates (evidence: `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerController.java`)
- Customer command service → Customer persistence adapter: persists (evidence: `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerService.java`)
- Customer command service → Customer event publisher: publishes (evidence: `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Customer/Aplication/CustomerService.java`)
- Order command API → Order command service: delegates (evidence: `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderController.java`)
- Order command service → Order repository: saves (evidence: `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderService.java`)
- Order command service → Order event publisher: publishes (evidence: `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Order/Aplication/OrderService.java`)
- Customer event publisher → Customer event consumer: event delivery
- Order event publisher → Order event consumer: event delivery
- Customer query service → Customer read store: reads and saves (evidence: `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Customer/Aplication/CustomerService.java`)
- Order query service → Order read store: queries and updates (evidence: `retofinalquery/src/main/java/edu/uptc/swii/retofinalquery/Order/Aplication/OrderService.java`)
- Customer query API → Customer query service: delegates
- Order query API → Order query service: delegates
- Keycloak user API → Keycloak service: calls (evidence: `retofinalcommand/src/main/java/edu/uptc/swii/retofinalcommand/Login/Adapters/Input/KeycloakController.java`)
- Keycloak service → Keycloak: administers users
