# hacv1k/opcua-monitor architecture

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

- Interactive diagram: https://gitdiagram.com/hacv1k/opcua-monitor
- Repository: https://github.com/hacv1k/opcua-monitor

## Overview

This repository is a small starter application: the browser renders a single home page and requests a greeting from a FastAPI backend; the backend also exposes status-check creation and listing backed by MongoDB. Separately, the frontend includes development-time visual-editing and build-health capabilities, plus a reusable UI component set. The README provides no product detail, and unsampled UI modules and plugin internals are represented only at directory level where appropriate.

Main entry points: [`frontend/craco.config.js`](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/craco.config.js) (Frontend configuration), [`backend/server.py`](https://github.com/hacv1k/opcua-monitor/blob/main/backend/server.py) (FastAPI service), [`frontend/src/index.js`](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/src/index.js) (React entry), [`frontend/src/App.js`](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/src/App.js) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_entry["React entry<br/>[index.js]"]
  node_app["Home page<br/>[App.js]"]
end

subgraph group_api["Backend API"]
  node_backend["FastAPI service<br/>[server.py]"]
  node_status["Status checks<br/>[server.py]"]
end

subgraph group_dev["Development tooling"]
  node_craco["Frontend configuration<br/>[craco.config.js]"]
  node_visual["Visual edit middleware"]
  node_metadata["JSX metadata transform"]
  node_healthplug["Webpack health tracker"]
  node_healthroutes["Health endpoints"]
end

subgraph group_ui["UI components"]
  node_uikit["Reusable UI primitives"]
  node_toast["Toast state<br/>[use-toast.js]"]
end

node_visitor(("Browser visitor"))
node_mongo[("MongoDB")]

node_visitor -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"requests greeting"| node_backend
node_visitor -.->|"submits status"| node_backend
node_backend -->|"connects"| node_mongo
node_status -->|"reads and writes"| node_mongo
node_craco -->|"configures middleware"| node_visual
node_craco -->|"registers transform"| node_metadata
node_craco -->|"configures plugin"| node_healthplug
node_craco -->|"registers endpoints"| node_healthroutes
node_healthroutes -->|"queries status"| node_healthplug

click node_entry "https://github.com/hacv1k/opcua-monitor/blob/main/frontend/src/index.js"
click node_app "https://github.com/hacv1k/opcua-monitor/blob/main/frontend/src/App.js"
click node_backend "https://github.com/hacv1k/opcua-monitor/blob/main/backend/server.py"
click node_status "https://github.com/hacv1k/opcua-monitor/blob/main/backend/server.py"
click node_craco "https://github.com/hacv1k/opcua-monitor/blob/main/frontend/craco.config.js"
click node_visual "https://github.com/hacv1k/opcua-monitor/blob/main/frontend/plugins/visual-edits/dev-server-setup.js"
click node_metadata "https://github.com/hacv1k/opcua-monitor/blob/main/frontend/plugins/visual-edits/babel-metadata-plugin.js"
click node_healthplug "https://github.com/hacv1k/opcua-monitor/blob/main/frontend/plugins/health-check/webpack-health-plugin.js"
click node_healthroutes "https://github.com/hacv1k/opcua-monitor/blob/main/frontend/plugins/health-check/health-endpoints.js"
click node_uikit "https://github.com/hacv1k/opcua-monitor/tree/main/frontend/src/components/ui"
click node_toast "https://github.com/hacv1k/opcua-monitor/blob/main/frontend/src/hooks/use-toast.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_entry,node_app,node_visitor toneBlue
class node_backend,node_status,node_mongo toneAmber
class node_craco,node_visual,node_metadata,node_healthplug,node_healthroutes toneMint
class node_uikit,node_toast toneRose
```

## Components

### Web application

- [React entry](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/src/index.js): `frontend/src/index.js`
- [Home page](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/src/App.js): `frontend/src/App.js`

### Backend API

- [FastAPI service](https://github.com/hacv1k/opcua-monitor/blob/main/backend/server.py): `backend/server.py`
- [Status checks](https://github.com/hacv1k/opcua-monitor/blob/main/backend/server.py): `backend/server.py`

### Development tooling

- [Frontend configuration](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/craco.config.js): `frontend/craco.config.js`
- [Visual edit middleware](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/plugins/visual-edits/dev-server-setup.js): `frontend/plugins/visual-edits/dev-server-setup.js`
- [JSX metadata transform](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/plugins/visual-edits/babel-metadata-plugin.js): `frontend/plugins/visual-edits/babel-metadata-plugin.js`
- [Webpack health tracker](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/plugins/health-check/webpack-health-plugin.js): `frontend/plugins/health-check/webpack-health-plugin.js`
- [Health endpoints](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/plugins/health-check/health-endpoints.js): `frontend/plugins/health-check/health-endpoints.js`

### UI components

- [Reusable UI primitives](https://github.com/hacv1k/opcua-monitor/tree/main/frontend/src/components/ui): `frontend/src/components/ui`
- [Toast state](https://github.com/hacv1k/opcua-monitor/blob/main/frontend/src/hooks/use-toast.js): `frontend/src/hooks/use-toast.js`

### Other components

- **Browser visitor**
- **MongoDB**

## Connections

- Browser visitor → React entry: opens app
- React entry → Home page: renders (evidence: `frontend/src/index.js`)
- Home page → FastAPI service: requests greeting (evidence: `frontend/src/App.js`)
- Browser visitor → FastAPI service: submits status
- FastAPI service → MongoDB: connects (evidence: `backend/server.py`)
- Status checks → MongoDB: reads and writes (evidence: `backend/server.py`)
- Frontend configuration → Visual edit middleware: configures middleware (evidence: `frontend/craco.config.js`)
- Frontend configuration → JSX metadata transform: registers transform (evidence: `frontend/craco.config.js`)
- Frontend configuration → Webpack health tracker: configures plugin (evidence: `frontend/craco.config.js`)
- Frontend configuration → Health endpoints: registers endpoints (evidence: `frontend/craco.config.js`)
- Health endpoints → Webpack health tracker: queries status (evidence: `frontend/plugins/health-check/health-endpoints.js`)
