# vx3540/neo4j-to-html architecture

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

- Interactive diagram: https://gitdiagram.com/vx3540/neo4j-to-html
- Repository: https://github.com/vx3540/neo4j-to-html

## Overview

NtH is a browser-based Neo4j query and graph-visualization tool. Users authenticate, configure or select a Neo4j connection, then explore a chosen label through dynamically generated relationship queries or browse a full graph; query results become an interactive graph view. The product also supports JSON-to-Cypher import and manual node/relationship configuration. Backend routes handle authentication, saved connections, label discovery, and query execution, using SQLite for account and connection records and Neo4j for graph data. Some configuration and visualization internals were not excerpted; only documented or indexed relationships are shown.

Main entry points: [`backend/index.js`](https://github.com/vx3540/neo4j-to-html/blob/main/backend/index.js) (Express API), [`frontend/src/App.js`](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/App.js) (Application routes), [`frontend/src/CypherQueryTester/Configuration.js`](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/Configuration.js) (Connection setup), [`frontend/src/CypherQueryTester/CypherQueryTester.js`](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/CypherQueryTester.js) (Query and browse page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Account access"]
  node_app["Application routes<br/>[App.js]"]
  node_login["Sign in<br/>[Login.js]"]
  node_register["Registration<br/>[Register.js]"]
end

subgraph group_setup["Connection and schema"]
  node_config["Connection setup<br/>[Configuration.js]"]
  node_configview["Setup interface"]
  node_configutils["Setup API helpers"]
  node_templates["Node templates<br/>[nodeTemplates.js]"]
end

subgraph group_explore["Graph exploration"]
  node_tester["Query and browse page"]
  node_queryapi["Query API client<br/>[cypherQueryApi.js]"]
  node_select["Relationship selector<br/>[SimpleSelect.js]"]
  node_graphview["Graph result renderer"]
  node_jsonimport["JSON import<br/>[JsonImport.js]"]
  node_jsonutils["JSON to Cypher<br/>[jsonImportUtils.js]"]
end

subgraph group_services["Backend and data"]
  node_backend["Express API<br/>[index.js]"]
  node_authmw["JWT middleware<br/>[middleware.js]"]
  node_accounts[("Account store<br/>[db.js]")]
end

node_user(("User"))
node_neo4j[("Neo4j graph database")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_config
node_app -->|"routes to"| node_tester
node_app -->|"routes to"| node_jsonimport
node_login -->|"posts login"| node_backend
node_register -.->|"registers account"| node_backend
node_config -->|"renders"| node_configview
node_config -->|"delegates setup"| node_configutils
node_config -->|"uses templates"| node_templates
node_config -->|"opens exploration"| node_tester
node_config -->|"opens import"| node_jsonimport
node_tester -->|"requests data"| node_queryapi
node_tester -->|"renders selector"| node_select
node_tester -->|"builds graph view"| node_graphview
node_jsonimport -->|"validates and converts"| node_jsonutils
node_jsonimport -->|"posts import query"| node_backend
node_queryapi -->|"posts query"| node_backend
node_backend -->|"guards routes"| node_authmw
node_backend -->|"reads and writes"| node_accounts
node_backend -->|"runs Cypher"| node_neo4j

click node_app "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/App.js"
click node_login "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/Auth/Login.js"
click node_register "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/Auth/Register.js"
click node_config "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/Configuration.js"
click node_configview "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/components/ConfigurationView.js"
click node_configutils "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/utils/configurationUtils.js"
click node_templates "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/constants/nodeTemplates.js"
click node_tester "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/CypherQueryTester.js"
click node_queryapi "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/utils/cypherQueryApi.js"
click node_select "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/components/SimpleSelect.js"
click node_graphview "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/utils/buildResultsPageContent.js"
click node_jsonimport "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/JsonImport.js"
click node_jsonutils "https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/utils/jsonImportUtils.js"
click node_backend "https://github.com/vx3540/neo4j-to-html/blob/main/backend/index.js"
click node_authmw "https://github.com/vx3540/neo4j-to-html/blob/main/backend/middleware.js"
click node_accounts "https://github.com/vx3540/neo4j-to-html/blob/main/backend/db.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_login,node_register,node_user toneBlue
class node_config,node_configview,node_configutils,node_templates,node_neo4j toneAmber
class node_tester,node_queryapi,node_select,node_graphview,node_jsonimport,node_jsonutils toneMint
class node_backend,node_authmw,node_accounts toneRose
```

## Components

### Account access

- [Application routes](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Sign in](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/Auth/Login.js): `frontend/src/Auth/Login.js`
- [Registration](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/Auth/Register.js): `frontend/src/Auth/Register.js`

### Connection and schema

- [Connection setup](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/Configuration.js): `frontend/src/CypherQueryTester/Configuration.js`
- [Setup interface](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/components/ConfigurationView.js): `frontend/src/CypherQueryTester/components/ConfigurationView.js`
- [Setup API helpers](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/utils/configurationUtils.js): `frontend/src/CypherQueryTester/utils/configurationUtils.js`
- [Node templates](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/constants/nodeTemplates.js): `frontend/src/CypherQueryTester/constants/nodeTemplates.js`

### Graph exploration

- [Query and browse page](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/CypherQueryTester.js): `frontend/src/CypherQueryTester/CypherQueryTester.js`
- [Query API client](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/utils/cypherQueryApi.js): `frontend/src/CypherQueryTester/utils/cypherQueryApi.js`
- [Relationship selector](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/components/SimpleSelect.js): `frontend/src/CypherQueryTester/components/SimpleSelect.js`
- [Graph result renderer](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/utils/buildResultsPageContent.js): `frontend/src/CypherQueryTester/utils/buildResultsPageContent.js`
- [JSON import](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/JsonImport.js): `frontend/src/CypherQueryTester/JsonImport.js`
- [JSON to Cypher](https://github.com/vx3540/neo4j-to-html/blob/main/frontend/src/CypherQueryTester/utils/jsonImportUtils.js): `frontend/src/CypherQueryTester/utils/jsonImportUtils.js`

### Backend and data

- [Express API](https://github.com/vx3540/neo4j-to-html/blob/main/backend/index.js): `backend/index.js`
- [JWT middleware](https://github.com/vx3540/neo4j-to-html/blob/main/backend/middleware.js): `backend/middleware.js`
- [Account store](https://github.com/vx3540/neo4j-to-html/blob/main/backend/db.js): `backend/db.js`

### Other components

- **User**
- **Neo4j graph database**

## Connections

- User → Application routes: uses (evidence: `frontend/src/App.js`)
- Application routes → Sign in: routes to (evidence: `frontend/src/App.js`)
- Application routes → Registration: routes to (evidence: `frontend/src/App.js`)
- Application routes → Connection setup: routes to (evidence: `frontend/src/App.js`)
- Application routes → Query and browse page: routes to (evidence: `frontend/src/App.js`)
- Application routes → JSON import: routes to (evidence: `frontend/src/App.js`)
- Sign in → Express API: posts login (evidence: `frontend/src/Auth/Login.js`)
- Registration → Express API: registers account
- Connection setup → Setup interface: renders (evidence: `frontend/src/CypherQueryTester/Configuration.js`)
- Connection setup → Setup API helpers: delegates setup (evidence: `frontend/src/CypherQueryTester/Configuration.js`)
- Connection setup → Node templates: uses templates (evidence: `frontend/src/CypherQueryTester/Configuration.js`)
- Connection setup → Query and browse page: opens exploration (evidence: `frontend/src/CypherQueryTester/Configuration.js`)
- Connection setup → JSON import: opens import (evidence: `frontend/src/CypherQueryTester/Configuration.js`)
- Query and browse page → Query API client: requests data (evidence: `frontend/src/CypherQueryTester/CypherQueryTester.js`)
- Query and browse page → Relationship selector: renders selector (evidence: `frontend/src/CypherQueryTester/CypherQueryTester.js`)
- Query and browse page → Graph result renderer: builds graph view (evidence: `frontend/src/CypherQueryTester/CypherQueryTester.js`)
- JSON import → JSON to Cypher: validates and converts (evidence: `frontend/src/CypherQueryTester/JsonImport.js`)
- JSON import → Express API: posts import query (evidence: `frontend/src/CypherQueryTester/JsonImport.js`)
- Query API client → Express API: posts query (evidence: `frontend/src/CypherQueryTester/utils/cypherQueryApi.js`)
- Express API → JWT middleware: guards routes (evidence: `backend/index.js`)
- Express API → Account store: reads and writes (evidence: `backend/index.js`)
- Express API → Neo4j graph database: runs Cypher (evidence: `backend/index.js`)
