diff --git a/CLAUDE.md b/CLAUDE.md index 104643b..0e3af9b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,7 +2,9 @@ ## What It Is -Personal web server framework that auto-discovers and runs multiple web apps on your home network. "Set it up, turn it on, forget about the cloud." +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 @@ -13,17 +15,38 @@ Personal web server framework that auto-discovers and runs multiple web apps on ## Key Files -- `src/server/apps.ts` - **The heart**: app discovery, process management, lifecycle -- `src/server/index.tsx` - Entry point (minimal, just initializes Hype) -- `src/pages/index.tsx` - Dashboard UI +### 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/`) +- `types.ts` - App, AppState, Manifest interfaces + +### Other - `apps/*/package.json` - Must have `"toes": "bun run --watch index.tsx"` script -- `TODO.md` - User-maintained task list (read this!) +- `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 @@ -36,7 +59,7 @@ bun run --hot src/server/index.tsx # Dev mode with hot reload ```tsx // apps/example/index.tsx -import { Hype } from "hype" +import { Hype } from "@because/hype" const app = new Hype() app.get("/", (c) => c.html(