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
- Provisioning: When you run
nkdev up, thetermservice starts first and performs thenpm install. Other services wait fortermto be healthy before starting. - Terminal Sessions: When you open a terminal in the Dashboard, the UI connects to the
termservice on port3007(local) or via the/_bridgeroute (remote) to spawn a secure PTY. - Resource Isolation: Native module compilation (like
node-pty) happens exclusively in thetermcontainer, keeping thehubcontainer slim and responsive.