update claude
This commit is contained in:
parent
f1cf2b9291
commit
f4e13dd932
52
CLAUDE.md
52
CLAUDE.md
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
## What It Is
|
## 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
|
## How It Works
|
||||||
|
|
||||||
|
|
@ -13,17 +15,38 @@ Personal web server framework that auto-discovers and runs multiple web apps on
|
||||||
|
|
||||||
## Key Files
|
## Key Files
|
||||||
|
|
||||||
- `src/server/apps.ts` - **The heart**: app discovery, process management, lifecycle
|
### Server (`src/server/`)
|
||||||
- `src/server/index.tsx` - Entry point (minimal, just initializes Hype)
|
- `apps.ts` - **The heart**: app discovery, process management, health checks, auto-restart
|
||||||
- `src/pages/index.tsx` - Dashboard UI
|
- `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
|
- `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
|
## Tech Stack
|
||||||
|
|
||||||
- **Bun** runtime (not Node)
|
- **Bun** runtime (not Node)
|
||||||
- **Hype** (custom HTTP framework wrapping Hono) from git+https://git.nose.space/defunkt/hype
|
- **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
|
- **Forge** (typed CSS-in-JS) from git+https://git.nose.space/defunkt/forge
|
||||||
|
- **Commander** + **kleur** for CLI
|
||||||
- TypeScript + Hono JSX
|
- TypeScript + Hono JSX
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
@ -36,7 +59,7 @@ bun run --hot src/server/index.tsx # Dev mode with hot reload
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// apps/example/index.tsx
|
// apps/example/index.tsx
|
||||||
import { Hype } from "hype"
|
import { Hype } from "@because/hype"
|
||||||
const app = new Hype()
|
const app = new Hype()
|
||||||
app.get("/", (c) => c.html(<h1>Content</h1>))
|
app.get("/", (c) => c.html(<h1>Content</h1>))
|
||||||
export default app.defaults
|
export default app.defaults
|
||||||
|
|
@ -48,12 +71,23 @@ export default app.defaults
|
||||||
- Each app is isolated process with own dependencies
|
- Each app is isolated process with own dependencies
|
||||||
- No path-based routing - apps run on separate ports
|
- No path-based routing - apps run on separate ports
|
||||||
- `DATA_DIR` env controls where apps are discovered
|
- `DATA_DIR` env controls where apps are discovered
|
||||||
|
- Path aliases: `$` → server, `@` → shared, `%` → lib
|
||||||
|
|
||||||
## Current State
|
## Current State
|
||||||
|
|
||||||
- Core infrastructure: ✓ Complete (discovery, spawn, watch, ports, UI)
|
### Infrastructure (Complete)
|
||||||
- Apps: basic, profile (working); risk, tictactoe (empty)
|
- App discovery, spawn, watch, auto-restart with exponential backoff
|
||||||
- Check TODO.md for planned features
|
- Health checks every 30s (3 failures trigger restart)
|
||||||
|
- Port pool (3001-3100), sticky allocation per app
|
||||||
|
- SSE streams for real-time app state and log updates
|
||||||
|
- File sync protocol with hash-based manifests
|
||||||
|
|
||||||
|
### CLI
|
||||||
|
- Full management: `toes list|start|stop|restart|info|new|rename|delete|open`
|
||||||
|
- File sync: `toes push|pull|sync`
|
||||||
|
- Logs: `toes logs [-f] <app>`
|
||||||
|
|
||||||
|
Check `TODO.txt` for planned features
|
||||||
|
|
||||||
## Coding Guidelines
|
## Coding Guidelines
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user