Overview
What it is
A terminal emulator running in the browser, built on xterm.js and Next.js 14 App Router. It presents a personal portfolio as a navigable virtual filesystem with a Bash-like command interface.
The entire content layer — projects, skills, contact, bio — is driven by a single data file. Adding a project means adding one JSON node; the terminal can immediately navigate, list, and display it without any code changes.
Design principles
- Command registry pattern — each module exports a typed command definition array
- Single source of truth — all portfolio content from one data file
- ANSI formatting abstracted into a helper — no raw escape strings in business logic
- Minimal React state: cwd, theme, history, busy flag via Zustand
- Dual input: xterm.js for desktop, companion HTML input for mobile compatibility
- GitHub data cached server-side and revalidated periodically — no blocking fetch on load
Browser ┌────────────────────────────────────────────────────────────┐ │ page.tsx (RSC) │ │ ├─ prefetch GitHub snapshot (ISR cache, server-side) │ │ └─ <TerminalWorkbench> (client component) │ │ ├─ xterm.js → input handler → command parser │ │ ├─ HTML input (mobile / fallback) │ │ ├─ useTerminalStore (Zustand) │ │ └─ executeCommand() → CommandResult │ │ ├─ portfolio module (whoami / projects / ...) │ │ ├─ filesystem module (ls / cd / cat / ...) │ │ ├─ github module (github / ask) │ │ │ ├─ GitHub integration (server-side) │ │ │ └─ AI streaming integration (server-side) │ │ ├─ theme module (theme) │ │ ├─ easter-eggs module (neofetch / matrix / ...) │ │ └─ utility module (history / tree / date ...) │ └────────────────────────────────────────────────────────────┘
Command Reference (30 total)
| cmd | module | usage |
|---|---|---|
| help | portfolio | help [cmd] |
| whoami | portfolio | whoami |
| projects | portfolio | projects |
| skills | portfolio | skills |
| contact | portfolio | contact |
| ls | filesystem | ls [path] |
| cd | filesystem | cd <path> |
| pwd | filesystem | pwd |
| cat | filesystem | cat <file> |
| open | filesystem | open <file> |
| tabhint | filesystem | tabhint |
| github | github | github |
| ask | github | ask "<question>" |
| theme | theme | theme [name] |
| clear | easter-eggs | clear |
| neofetch | easter-eggs | neofetch |
| matrix | easter-eggs | matrix |
| hack | easter-eggs | hack |
| cowsay | easter-eggs | cowsay [message] |
| curl | easter-eggs | curl |
| sudo | easter-eggs | sudo <cmd> |
| rm | easter-eggs | rm -rf <path> |
| history | utility | history |
| tree | utility | tree [path] |
| echo | utility | echo <text> |
| date | utility | date |
| banner | utility | banner <text> |
| uptime | utility | uptime |
| man | utility | man <cmd> |
| grep | utility | grep <pattern> <file> |
Virtual Filesystem
The virtual filesystem is a nested JSON structure — directories are plain objects, files are strings. The terminal traverses it for ls, cd, cat, and Tab autocomplete.
~/
├── bio.txt — personal introduction text
├── now.txt — what I'm working on right now
├── resume.pdf — stub: opens resume URL when using cat
├── projects/
│ ├── janus/
│ │ ├── readme.md
│ │ └── link.url
│ ├── drishti/
│ │ ├── readme.md
│ │ └── link.url
│ ├── sp500-dashboard/
│ │ ├── readme.md
│ │ └── link.url
│ └── ... (more projects)
├── skills/
│ ├── languages.md
│ ├── frameworks.md
│ ├── tools.md
│ └── learning.md
├── contact/
│ ├── email.txt
│ ├── github.url
│ └── linkedin.url
├── secret/
│ └── .credits — hidden easter egg
└── .config/
├── theme.txt
└── aliases.shTheme System
Themes are CSS-variable records. Switching a theme updates both the xterm.js renderer and the page CSS variables simultaneously. Use theme [name] in the terminal, or click a theme name in the sidebar.
Deep blue-grey — the base dark theme
Classic green phosphor on black
Cyberpunk magenta on near-black
Low-contrast neutral grey palette
Dracula color scheme — purple+pink
Tech Stack
| package |
|---|
| next |
| react |
| typescript |
| @xterm/xterm |
| @xterm/addon-fit |
| @xterm/addon-webgl |
| zustand |
| ai |
| @ai-sdk/google |
| octokit |
| next-pwa |
| tailwindcss |
Live Integrations
GitHub
Live GitHub stats — public repos, total stars, and follower count — are fetched server-side and cached for performance. The github command refreshes data on demand.
AI Assistant
The ask command streams AI-generated answers grounded in portfolio content — projects, skills, and background — for accurate, context-aware responses.