# cradlock/ng-live architecture

> Architecture diagram of the GitHub repository cradlock/ng-live, 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/cradlock/ng-live
- Repository: https://github.com/cradlock/ng-live

## Overview

nglive combines a Svelte web interface with a Vert.x backend. The backend starts HTTP and WebSocket gateways; the HTTP gateway mounts authentication routes, while the WebSocket gateway mounts a device-chat route. The web tree also contains messenger, profile, and control pages, but the sampled files do not show how they communicate with the backend. Account, messenger-service, and several auth-provider modules are present, though their implementation or wiring is not established by the excerpts. Database initialization exists but is commented out at startup.

Main entry points: [`server/src/main/java/com/nglive/MainVerticle.java`](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/MainVerticle.java) (Application startup), [`server/src/main/java/com/nglive/gateways/HttpGatewayVerticle.java`](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/gateways/HttpGatewayVerticle.java) (HTTP gateway), [`server/src/main/java/com/nglive/gateways/WsGatewayVerticle.java`](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/gateways/WsGatewayVerticle.java) (WebSocket gateway), [`server/src/main/java/com/nglive/auth/AuthRouter.java`](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/auth/AuthRouter.java) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_web_shell["Web shell<br/>[+layout.svelte]"]
  node_landing["Landing page<br/>[+page.svelte]"]
  node_web_messenger["Messenger pages<br/>[+page.svelte]"]
  node_chat_page["Chat page<br/>[+page.svelte]"]
  node_profile["Profile page<br/>[+page.svelte]"]
  node_control["Control layout<br/>[+layout.svelte]"]
end

subgraph group_runtime["Backend gateways"]
  node_main["Application startup<br/>[MainVerticle.java]"]
  node_http_gateway["HTTP gateway"]
  node_ws_gateway["WebSocket gateway"]
end

subgraph group_identity["Identity and accounts"]
  node_auth_router["Auth routes<br/>[AuthRouter.java]"]
  node_auth_handler["Cookie validation<br/>[AuthHandler.java]"]
  node_auth_service["Auth service<br/>[AuthService.java]"]
  node_auth_providers["Signup providers"]
  node_account["Account module"]
end

subgraph group_features["Chat and persistence"]
  node_device_chat["Device chat route"]
  node_messenger_server["Messenger module"]
  node_database[("Database clients")]
end

node_browser(("Browser user"))

node_web_shell -->|"renders children"| node_main
node_main -->|"deploys"| node_http_gateway
node_main -->|"deploys"| node_ws_gateway
node_http_gateway -->|"mounts routes"| node_auth_router
node_auth_router -->|"invokes"| node_auth_handler
node_ws_gateway -->|"mounts routes"| node_device_chat

click node_web_shell "https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/%2Blayout.svelte"
click node_landing "https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/%2Bpage.svelte"
click node_web_messenger "https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/messenger/%2Bpage.svelte"
click node_chat_page "https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/messenger/%5BchatUUID%5D/%2Bpage.svelte"
click node_profile "https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/profile/%2Bpage.svelte"
click node_control "https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/control/%2Blayout.svelte"
click node_main "https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/MainVerticle.java"
click node_http_gateway "https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/gateways/HttpGatewayVerticle.java"
click node_ws_gateway "https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/gateways/WsGatewayVerticle.java"
click node_auth_router "https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/auth/AuthRouter.java"
click node_auth_handler "https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/auth/AuthHandler.java"
click node_auth_service "https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/auth/AuthService.java"
click node_auth_providers "https://github.com/cradlock/ng-live/tree/main/server/src/main/java/com/nglive/auth/providers"
click node_account "https://github.com/cradlock/ng-live/tree/main/server/src/main/java/com/nglive/account"
click node_device_chat "https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/devconnect/DeviceChatRouter.java"
click node_messenger_server "https://github.com/cradlock/ng-live/tree/main/server/src/main/java/com/nglive/messenger"
click node_database "https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/shared/DatabaseHolder.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_web_shell,node_landing,node_web_messenger,node_chat_page,node_profile,node_control,node_browser toneBlue
class node_main,node_http_gateway,node_ws_gateway toneAmber
class node_auth_router,node_auth_handler,node_auth_service,node_auth_providers,node_account toneMint
class node_device_chat,node_messenger_server,node_database toneRose
```

## Components

### Web interface

- [Web shell](https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/%2Blayout.svelte): `apps/web/src/routes/+layout.svelte`
- [Landing page](https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/%2Bpage.svelte): `apps/web/src/routes/+page.svelte`
- [Messenger pages](https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/messenger/%2Bpage.svelte): `apps/web/src/routes/messenger/+page.svelte`
- [Chat page](https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/messenger/%5BchatUUID%5D/%2Bpage.svelte): `apps/web/src/routes/messenger/[chatUUID]/+page.svelte`
- [Profile page](https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/profile/%2Bpage.svelte): `apps/web/src/routes/profile/+page.svelte`
- [Control layout](https://github.com/cradlock/ng-live/blob/main/apps/web/src/routes/control/%2Blayout.svelte): `apps/web/src/routes/control/+layout.svelte`

### Backend gateways

- [Application startup](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/MainVerticle.java): `server/src/main/java/com/nglive/MainVerticle.java`
- [HTTP gateway](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/gateways/HttpGatewayVerticle.java): `server/src/main/java/com/nglive/gateways/HttpGatewayVerticle.java`
- [WebSocket gateway](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/gateways/WsGatewayVerticle.java): `server/src/main/java/com/nglive/gateways/WsGatewayVerticle.java`

### Identity and accounts

- [Auth routes](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/auth/AuthRouter.java): `server/src/main/java/com/nglive/auth/AuthRouter.java`
- [Cookie validation](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/auth/AuthHandler.java): `server/src/main/java/com/nglive/auth/AuthHandler.java`
- [Auth service](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/auth/AuthService.java): `server/src/main/java/com/nglive/auth/AuthService.java`
- [Signup providers](https://github.com/cradlock/ng-live/tree/main/server/src/main/java/com/nglive/auth/providers): `server/src/main/java/com/nglive/auth/providers`
- [Account module](https://github.com/cradlock/ng-live/tree/main/server/src/main/java/com/nglive/account): `server/src/main/java/com/nglive/account`

### Chat and persistence

- [Device chat route](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/devconnect/DeviceChatRouter.java): `server/src/main/java/com/nglive/devconnect/DeviceChatRouter.java`
- [Messenger module](https://github.com/cradlock/ng-live/tree/main/server/src/main/java/com/nglive/messenger): `server/src/main/java/com/nglive/messenger`
- [Database clients](https://github.com/cradlock/ng-live/blob/main/server/src/main/java/com/nglive/shared/DatabaseHolder.java): `server/src/main/java/com/nglive/shared/DatabaseHolder.java`

### Other components

- **Browser user**

## Connections

- Web shell → Application startup: renders children (evidence: `apps/web/src/routes/+layout.svelte`)
- Application startup → HTTP gateway: deploys (evidence: `server/src/main/java/com/nglive/MainVerticle.java`)
- Application startup → WebSocket gateway: deploys (evidence: `server/src/main/java/com/nglive/MainVerticle.java`)
- HTTP gateway → Auth routes: mounts routes (evidence: `server/src/main/java/com/nglive/gateways/HttpGatewayVerticle.java`)
- Auth routes → Cookie validation: invokes (evidence: `server/src/main/java/com/nglive/auth/AuthRouter.java`)
- WebSocket gateway → Device chat route: mounts routes (evidence: `server/src/main/java/com/nglive/gateways/WsGatewayVerticle.java`)
