Skip to Content
ArchitectureTerm & Hub Separation

Architecture: Term & Hub Separation

Nanokit 1.x introduces a clear separation between the Dashboard UI and the Provisioning/Terminal engine to optimize resource usage and stability.

Hub Service (hub)

The Hub is now a lightweight UI service using the node-slim runtime. It serves the Dashboard interface and manages the high-level state of the project.

  • Runtime: node:22-slim
  • Default Port: 3004
  • Role: Dashboard UI, Configuration Bridge Client.

Term Service (term)

The Term service is a dedicated backend for heavy operations, including terminal sessions (PTY) and project provisioning (npm install). It uses the full node runtime to support native module compilation.

  • Runtime: node:22 (full)
  • Default Port: 3007 (to avoid conflict with host-side bridge on 3006).
  • Role: Provisioning Master, PTY/Terminal Backend.

How it works

  1. Provisioning: When you run nkdev up, the term service starts first and performs the npm install. Other services wait for term to be healthy before starting.
  2. Terminal Sessions: When you open a terminal in the Dashboard, the UI connects to the term service on port 3007 (local) or via the /_bridge route (remote) to spawn a secure PTY.
  3. Resource Isolation: Native module compilation (like node-pty) happens exclusively in the term container, keeping the hub container slim and responsive.