darknode-web

Architecture

Darknode Web is the marketing site and the full web console for darknode.ai. Signed-out visitors get a landing page with app/CLI/OS downloads; signed-in users get a single-page console: a browser tool arsenal (192 tool platforms + 790+ Toolbox mini-tools), payload / dork / exploit-DB libraries, threat intel and cheat sheets, a built-in AI assistant (hosted free tier or local Ollama), a report generator, a Private-Cloud compose generator, the Nexus showcase, docs, and download pages. Aimed at authorized pentesters and security learners.

There is no build step: public/index.html loads a single ES-module entry (js/auth.js) which lazily imports the page controllers. public/js holds ~300 ES modules (≈215K lines of JS, plus ≈25K lines of CSS; ≈492K lines across public/ counting JS + CSS + HTML). State lives in Firebase (Auth + Firestore) and localStorage.

README and this document agree. (Earlier revisions of each described an aspirational Cloudflare Pages + Fly.io stack and a product called “Sentinel”; both are corrected. The live project is Firebase-hosted and branded Darknode.)

Hosting & backend

Module map (high level)

378 modules is too many to list; they group as:

public/
  index.html            app shell; loads js/auth.js as the ONLY entry <script>
  css/styles.css        core stylesheet (~9.0K lines); pro-theme.css adds the skin
  js/
    firebase.js         [adapter] Firebase init/config; exports auth/db/providers + isAdminUser (admin-claim reader)
    user-keys.js        [core]    window.dnKeys — per-uid credential isolation
    auth.js             [core]    app entry + SPA router (~2.5K lines): auth flow,
                                  email/code verify, access gate, show(sec) dispatch,
                                  Ctrl-K palette, feedback modal, announcements, profile,
                                  Settings (incl. Nexus pairing-code generator)
    admin.js            [adapter] owner-only console (user stats, allow-list, announcements)
    api.js              [adapter] the user's Darknode API key (Firestore users/{uid}.apiKey)
    saved.js            [adapter] saved workspace (Firestore or localStorage)
    toolkit.js          [data]    the 192-entry tool CATALOG + browser-tool engine
    tools-manifest.js   [data]    792 Toolbox mini-tool ids/names/cats (generated)
    tools/*.js          [tools]   mini-tool implementations + plain-English help
    webai.js            [feature] AI assistant (hosted proxy, local Ollama, or a
                                  connected provider key, incl. OpenRouter)
    deck-ui.js          [feature] Darknode Command — admin-only overlay: a
                                  connection constellation + a tools gallery that
                                  opens each tool INSIDE the deck in an iframe
                                  (src="/<sec>?embed=1"), never leaving the deck
    openrouter-connect.js [feature] one-click "connect your OpenRouter account"
                                  (OAuth 2.0 PKCE, client-side, no secret/backend);
                                  mints a user-owned key into dn_key_openrouter
    <~200 more>         page controllers + flagship tool apps (phantom, oracle, citadel,
                        spectre, navarch, crucible, sentinel-eye globe, …), data libs,
                        threat-intel, console nav, toasts, modals, core/ spine
firebase/
  firestore.rules       per-user users/{uid}; owner-only settings/announcements;
                        feedback create-any; pairings create-own / server-consumed
  storage.rules         deny-by-default (client uses no Storage)
functions/index.js      chat (AI proxy) + pair (CLI pairing exchange)
worker/worker.js        Cloudflare Worker AI proxy (/api/chat, /api/smart)
firebase.json           Hosting + headers + Functions + Firestore/Storage rules
.firebaserc             Firebase project sentinel-b4194

App & data flow

index.html
   └─ loads js/user-keys.js then js/auth.js (the only module entry)
         │
         ▼
   onAuthStateChanged → sets window.__dnUid (per-uid key scope)
         │  (email/password?) → verify via notify.js code, else Firebase link
         ▼
   access gate → ensureUserDoc() writes users/{uid}
         ▼
   renderApp() → builds the sidebar + a show(sec) dispatcher mapping each
                 data-sec to a controller's render*() that paints #view

Relationship to the CLI / Nexus

This repo runs no AI agent. coder.js / docs.js showcase and document the darknode / nexus CLI, and the download pages (getapp.js, landing.js) link to its binaries. The agent runtime — the multi-engine, policy-gated Nexus — lives in the sibling nexus engine (nexus, 61 src/ modules) and the darknode-cli product shell (104 lib/ modules, 44 of them in lib/nexus; counts measured 2026-10-04), published to GitHub Releases under the Darknode-Official org. Both share a local-first stance: the web webai.js and the CLI’s Ollama client target 127.0.0.1:11434 so work can stay on-device.