# Toes - Claude Code Guide ## What It Is Personal web appliance that auto-discovers and runs multiple web apps on your home network. "Plug it in, turn it on, and forget about the cloud." ## How It Works 1. Host server scans `/apps` directory for valid apps 2. Valid app = has `package.json` with `scripts.toes` entry 3. Each app spawned as child process with unique port (3001+) 4. Dashboard UI shows all apps with current status, logs, and links ## Key Files ### Server (`src/server/`) - `apps.ts` - **The heart**: app discovery, process management, health checks, auto-restart - `api/apps.ts` - REST API for app lifecycle (start/stop/restart, logs, icons, rename) - `api/sync.ts` - File sync protocol (manifest, push/pull, watch) - `index.tsx` - Entry point (minimal, initializes Hype) - `shell.tsx` - HTML shell for web UI ### Client (`src/client/`) - `components/` - Dashboard, Sidebar, AppDetail, Nav - `modals/` - NewApp, RenameApp, DeleteApp dialogs - `styles/` - Forge CSS-in-JS (themes, buttons, forms, layout) - `state.ts` - Client state management - `api.ts` - API client ### CLI (`src/cli/`) - `commands/manage.ts` - list, start, stop, restart, info, new, rename, delete, open - `commands/sync.ts` - push, pull, sync - `commands/logs.ts` - log viewing with tail support ### Shared (`src/shared/`) - Code shared between frontend (browser) and backend (server) - `types.ts` - App, AppState, Manifest interfaces - IMPORTANT: Cannot use filesystem or Node APIs (runs in browser) ### Lib (`src/lib/`) - Code shared between CLI and server (server-side only) - `templates.ts` - Template generation for new apps - Can use filesystem and Node APIs (never runs in browser) ### Other - `apps/*/package.json` - Must have `"toes": "bun run --watch index.tsx"` script - `TODO.txt` - Task list ## Tech Stack - **Bun** runtime (not Node) - **Hype** (custom HTTP framework wrapping Hono) from git+https://git.nose.space/defunkt/hype - **Forge** (typed CSS-in-JS) from git+https://git.nose.space/defunkt/forge - **Commander** + **kleur** for CLI - TypeScript + Hono JSX ## Running ```bash bun run --hot src/server/index.tsx # Dev mode with hot reload ``` ## App Structure ```tsx // apps/example/index.tsx import { Hype } from "@because/hype" const app = new Hype() app.get("/", (c) => c.html(