This repo contains a small React + TypeScript + Vite application that acts as a dashboard for a running Helexa Cortex node.
The dashboard connects to Cortex’s observe websocket endpoint and provides:
neuron_registeredneuron_heartbeatprovisioning_sent, provisioning_response)model_state_changedcortex_shutdown_noticeThe app is designed to be built once and then configured at deploy time by operators, without rebuilding the bundle.
You will need:
helexa cortex \
--dashboard-socket 0.0.0.0:8090 \
...
This exposes a websocket endpoint (by default at ws://<host>:8090/observe)
that the dashboard will connect to.
From this cortex directory:
pnpm install
This installs all app dependencies into node_modules/.
To run a hot-reloading dev server:
pnpm dev
By default Vite will start on something like http://localhost:5173/.
The dashboard loads its configuration from /config.js at runtime. For dev,
public/config.js is copied into dist/ and served as-is.
Open:
cortex/public/config.js
and set:
window.__CORTEX_CONFIG__ = {
// Example: local Cortex node listening on 8090 with /observe
cortex_ws_endpoint: "ws://127.0.0.1:8090/observe",
};
During pnpm dev, you can edit public/config.js and refresh the browser to
point the dashboard at a different Cortex node.
To produce a static build:
pnpm build
This runs TypeScript and Vite and writes output into dist/:
dist/index.htmldist/assets/* (JS, CSS, etc.)dist/config.js (copied from public/config.js)You can preview the production build locally:
pnpm preview
(See Vite docs for details; this is optional.)
The build artefacts in dist/ are static and can be served from:
A common pattern:
pnpm build
tar czf cortex-dashboard-dist.tar.gz dist
# or
zip -r cortex-dashboard-dist.zip dist
Distribute that archive to operators.
Operators are expected to edit config.js in the deployed dist/ directory
to point the dashboard at their own Cortex node.
The file dist/config.js looks like:
window.__CORTEX_CONFIG__ = {
/**
* WebSocket endpoint for the Helexa Cortex dashboard stream.
*
* Examples:
* - "ws://127.0.0.1:8090/observe"
* - "wss://cortex.example.com/observe"
*
* NOTE:
* - Use "ws://" for plain HTTP deployments.
* - Use "wss://" when the dashboard is served over HTTPS.
*/
cortex_ws_endpoint: "ws://127.0.0.1:8090/observe",
};
To reconfigure a deployed dashboard, operators only need to:
config.js on their CDN / server.cortex_ws_endpoint to match their environment.No rebuild is required.
The dashboard talks to Cortex’s observe websocket, defined in
dashboard.md in the parent Helexa repo.
At a high level:
URL: ws://<cortex-host>:<dashboard-port>/observe
Messages are JSON Text frames.
The first message is always a snapshot:
{ "kind": "snapshot", "snapshot": { "neurons": [...] } }
After that, Cortex sends a stream of event messages:
{ "kind": "event", "event": { "type": "<event-type>", ... } }
Key event types:
neuron_registeredneuron_removedneuron_heartbeatprovisioning_sentprovisioning_responsemodel_state_changedcortex_shutdown_noticeThe dashboard:
neuron_heartbeat.The app supports light and dark themes via a custom ThemeProvider:
data-theme="light" | "dark" on <html>..app-root.theme-[mode].src/index.css drive background, text, border, and accent
colours.The dashboard layout:
Header: Logo + navigation.
Main:
Footer: Simple copyright line with localisation support.
The app uses i18next + react-i18next with resources under src/i18n/.
en, ru, …)common, home, chat)The dashboard mainly uses the common namespace for:
Adding a new language requires:
src/i18n/languages.ts.src/i18n/resources/<lang>/.src/i18n/index.ts.This project was bootstrapped from the standard Vite + React + TypeScript template.
Build/lint scripts are in package.json:
pnpm dev – dev server with HMR.pnpm build – typecheck + production build.pnpm preview – preview production build.The main app entry is src/main.tsx, which:
./i18n to initialise translations.<App /> inside <ThemeProvider>.cortex_ws_endpoint is being used.websocat ws://.../observe).config.js is served from the same origin as index.html and
is not cached with an old endpoint.The connection card will show an error and the browser console may have:
Firefox can’t establish a connection to the server at ws://...Check:
--dashboard-socket.config.js match the actual socket (e.g. :8090/observe).app.name)src/main.tsx imports ./i18n before rendering <App />.If you’re extending this dashboard (e.g. adding more panels, controls, or
operator actions), keep the runtime configuration approach (config.js) intact
so operators can continue to re-point the dashboard to different Cortex nodes
without rebuilding the app.
This project is provided under the Helexa.ai – Source Available License with
Scheduled Open Source Transition described in license.md:
See license.md for the full license text and details.
21 activities