# CLAUDE.md — Archipelago (Archy) Project Guide ## Project Overview Archipelago is a **Bitcoin Node OS** — a bootable, self-sovereign personal server you flash to USB, install on hardware, and manage via a web UI. Similar to Umbrel/Start9/RaspiBlitz but custom-built with production-grade security. **Stack**: Rust backend + Vue 3 (Composition API) + TypeScript (strict) + Vite 7 + Tailwind CSS + Pinia + Podman **Target OS**: Debian 12 (Bookworm) — x86_64 and ARM64 **Current version**: 0.1.0 ## Quick Reference ```bash # Frontend local dev (mock backend on :5959, Vite on :8100) cd neode-ui && npm start # Deploy to live server (frontend + backend + restart services) ./scripts/deploy-to-target.sh --live # Deploy to both servers ./scripts/deploy-to-target.sh --both # Frontend build (outputs to web/dist/neode-ui/) cd neode-ui && npm run build # Type-check frontend cd neode-ui && npm run type-check # Rust checks (run on dev server, NOT macOS) cargo clippy --all-targets --all-features cargo fmt --all cargo test --all-features ``` Dev server: `http://192.168.1.228` | Local frontend: `http://localhost:8100` (password: `password123`) ## Architecture ``` Debian 12 (Bookworm) ├── Podman (rootless containers) ├── Nginx (port 80 → proxies /rpc/, /ws/, /health to backend) ├── Rust Backend (core/) — binary on port 5678 │ ├── core/archipelago/ — Main binary, RPC endpoints │ ├── core/container/ — PodmanClient, manifest parser, dependency resolver, health monitor │ ├── core/security/ — AppArmor profiles, secrets manager, Cosign image verifier │ ├── core/performance/ — Resource manager │ └── core/parmanode/ — Parmanode compatibility layer └── Vue.js UI (neode-ui/) ├── src/api/ — RPC client (rpc-client.ts), WebSocket, container client ├── src/stores/ — Pinia stores ├── src/views/ — Page components ├── src/components/ — Reusable components ├── src/router/ — Vue Router ├── src/types/ — TypeScript type definitions └── src/style.css — Global styles + Tailwind utilities ``` ### Data Paths (Server) - App data: `/var/lib/archipelago/{app-id}/` - Secrets: `/var/lib/archipelago/secrets/{app-id}/` (encrypted) - Frontend: `/opt/archipelago/web-ui/` - Backend binary: `/usr/local/bin/archipelago` - Systemd service: `/etc/systemd/system/archipelago.service` - Nginx config: `/etc/nginx/sites-available/archipelago` ## CRITICAL Workflow Rules ### 1. NEVER Build Rust on macOS for Linux Always rsync source to the Linux dev server and build there. Building on macOS and copying the binary causes Exec format errors. ```bash # Deploy does this automatically: ./scripts/deploy-to-target.sh --live ``` ### 2. Always Deploy After Changes After editing code (frontend, backend, scripts, or configs), deploy to the live server. Do not leave deployment to the user. ### 3. Frontend Build Output Path Frontend builds to `web/dist/neode-ui/` — NOT `neode-ui/dist/`. ### 4. Deploy-Test-Fix Loop 1. Make the change 2. Deploy with `./scripts/deploy-to-target.sh --live` 3. Test at http://192.168.1.228 4. If broken, fix and redeploy — repeat until working 5. End loop only when everything works ### 5. SSH Access - **Primary**: `archipelago@192.168.1.228` — password: `EwPDR8q45l0Upx@` - **Secondary**: `archipelago@192.168.1.198` - Credentials stored in gitignored `scripts/deploy-config.sh` ```bash sshpass -p 'EwPDR8q45l0Upx@' ssh -o StrictHostKeyChecking=no archipelago@192.168.1.228 ``` ## Frontend Rules (Vue.js + TypeScript) ### Component Standards - **Always** `