I built a terminal portfolio using React and Ink -- animated header, tabbed navigation, streaming bio text, the works. It looked great locally, but the real question was: how do I let other people see it?
The SSH Approach
The answer: run it as an SSH server. When someone types ssh r-that.com, they get connected to a Node.js process that renders a fresh Ink app instance to their terminal. No browser needed, no client to install.
The Implementation
The server uses the ssh2 npm package to accept SSH connections:
const server = new Server({ hostKeys: [hostKey] }, (client) => {
client.on('session', (accept) => {
const session = accept();
session.on('shell', (accept) => {
const channel = accept();
// Render Ink to the SSH channel
render(<Portfolio />, { stdout, stdin, interactive: true });
});
});
});
The tricky parts were:
- Stream bridging: Ink expects Node.js
WriteStreamobjects, but SSH gives you a channel. I had to implementcursorTo,clearLine, andmoveCursorusing raw ANSI escape sequences. - Newline handling: Terminals expect
\r\nover SSH, but Ink outputs bare\n. A simple regex replacement fixed the stair-stepping. - Color support: Chalk detects color support from
process.stdout, not the SSH stream. SettingFORCE_COLOR=3before imports andchalk.level = 3after forces truecolor output.
Deployment
The server runs on a Hostinger VPS as a systemd service. Admin SSH was moved to port 2200, freeing port 22 for the portfolio. A Cloudflare DNS A record points r-that.com to the VPS IP (with proxy disabled -- Cloudflare doesn't proxy SSH).
The result: anyone with a terminal can run ssh r-that.com and browse an interactive, animated portfolio.