# fontanilla09/complab-5-fontanilla architecture

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

- Interactive diagram: https://gitdiagram.com/fontanilla09/complab-5-fontanilla
- Repository: https://github.com/fontanilla09/complab-5-fontanilla

## Overview

This repository implements a small distributed order system. A user submits a product and quantity through the React interface; the gateway forwards the request to the order service, which validates it and publishes an order event. RabbitMQ distributes that event to payment and inventory consumers; successful payment produces a second event consumed by notifications. The sampled code shows an accepted-order response, not a UI flow for later payment or inventory results. The README is empty, so this map is based on the sampled source.

Main entry points: [`gateway/server.js`](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/gateway/server.js) (API gateway), [`services/order-service/server.js`](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/order-service/server.js) (Order service), [`frontend/src/App.jsx`](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/frontend/src/App.jsx) (Order form), [`services/payment-service/server.js`](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/payment-service/server.js) (Payment service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Order client"]
  node_order_ui["Order form<br/>[App.jsx]"]
end

subgraph group_request["Order request path"]
  node_gateway["API gateway<br/>[server.js]"]
  node_orders["Order service<br/>[server.js]"]
end

subgraph group_events["Event messaging"]
  node_rabbitmq["RabbitMQ"]
end

subgraph group_consumers["Event consumers"]
  node_payment["Payment service<br/>[server.js]"]
  node_inventory["Inventory service<br/>[server.js]"]
  node_notification["Notification service<br/>[server.js]"]
end

node_user(("User"))

node_user -->|"enters order"| node_order_ui
node_order_ui -->|"submits order"| node_gateway
node_gateway -->|"forwards request"| node_orders
node_orders -->|"publishes order"| node_rabbitmq
node_rabbitmq -->|"delivers order"| node_payment
node_rabbitmq -->|"delivers order"| node_inventory
node_payment -->|"publishes payment"| node_rabbitmq
node_rabbitmq -->|"delivers payment"| node_notification
node_orders -->|"returns acceptance"| node_gateway
node_gateway -->|"returns response"| node_order_ui

click node_order_ui "https://github.com/fontanilla09/complab-5-fontanilla/blob/master/frontend/src/App.jsx"
click node_gateway "https://github.com/fontanilla09/complab-5-fontanilla/blob/master/gateway/server.js"
click node_orders "https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/order-service/server.js"
click node_payment "https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/payment-service/server.js"
click node_inventory "https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/inventory-service/server.js"
click node_notification "https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/notification-service/server.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_order_ui,node_user toneBlue
class node_gateway,node_orders toneAmber
class node_rabbitmq toneMint
class node_payment,node_inventory,node_notification toneRose
```

## Components

### Order client

- [Order form](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`

### Order request path

- [API gateway](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/gateway/server.js): `gateway/server.js`
- [Order service](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/order-service/server.js): `services/order-service/server.js`

### Event messaging

- **RabbitMQ**

### Event consumers

- [Payment service](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/payment-service/server.js): `services/payment-service/server.js`
- [Inventory service](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/inventory-service/server.js): `services/inventory-service/server.js`
- [Notification service](https://github.com/fontanilla09/complab-5-fontanilla/blob/master/services/notification-service/server.js): `services/notification-service/server.js`

### Other components

- **User**

## Connections

- User → Order form: enters order (evidence: `frontend/src/App.jsx`)
- Order form → API gateway: submits order (evidence: `frontend/src/App.jsx`)
- API gateway → Order service: forwards request (evidence: `gateway/server.js`)
- Order service → RabbitMQ: publishes order (evidence: `services/order-service/server.js`)
- RabbitMQ → Payment service: delivers order (evidence: `services/payment-service/server.js`)
- RabbitMQ → Inventory service: delivers order (evidence: `services/inventory-service/server.js`)
- Payment service → RabbitMQ: publishes payment (evidence: `services/payment-service/server.js`)
- RabbitMQ → Notification service: delivers payment (evidence: `services/notification-service/server.js`)
- Order service → API gateway: returns acceptance (evidence: `gateway/server.js`)
- API gateway → Order form: returns response (evidence: `frontend/src/App.jsx`)
