unify _ui and _web server #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
remove these scripts
the _ui is admin section and can be under /admin/ part on the new _ui
so new server is _ui and has enduser parts as well as admin parts, admin parts under /admin/
make sure we have self start using /hero_proc_log_selfstart_check
make all clean and shiny
Implementation Spec for Issue #4: Unify _ui and _web server
Objective
Merge
hero_whiteboard_web(end-user whiteboard UI) andhero_whiteboard_ui(admin dashboard) into a single binaryhero_whiteboard_ui. Admin dashboard served under/admin/, end-user whiteboard at/. Remove obsolete shell scripts replaced by self-start pattern.Requirements
_webinto_uias a single Axum server//admin/~/hero/var/sockets/hero_whiteboard_ui.sockhero_whiteboard_webcrate from workspacerun.sh,stop.sh,rundev.sh,status.sh,logs.shbuild_lib.sh,download-assets.sh,install.shbuildenv.sh,Makefile,install.shImplementation Plan (12 Steps)
Step 1: Copy web assets and templates into _ui crate
Copy
_web/static/→_ui/static/web/,_web/templates/→_ui/templates/web/Step 2: Update _ui Cargo.toml with _web dependencies
Add
futures-util, ensureaxumhaswsfeatureStep 3: Add WebSocket module to _ui
Copy
_web/src/ws.rs→_ui/src/ws.rs, addmod ws;Step 4: Update assets.rs to embed both static asset sets
Add
WebAssetsrust-embed struct forstatic/web/Step 5: Merge routes (core change)
Combine all routes: admin nested under
/admin/, end-user at/Step 6: Update main.rs for unified router
Add WebSocket support, switch to manual hyper accept loop for WS over Unix sockets
Step 7: Update web templates for unified server
Ensure asset paths work at root level
Step 8: Update admin templates for /admin/ prefix
Set
base_path = "/admin/"Step 9: Remove _web crate and update workspace
Delete
crates/hero_whiteboard_web/, update workspace Cargo.tomlStep 10: Remove obsolete scripts and update build infrastructure
Delete scripts, update
buildenv.sh,install.sh,download-assets.shStep 11: Update Makefile
Remove _web targets, simplify run/stop/status
Step 12: Update documentation
Update CLAUDE.md and README.md
Acceptance Criteria
cargo build --workspacecompiles successfullycargo test --workspacepasses/and admin at/admin//ws/{board_id}/rpcand/admin/rpc/s/{token}make runandmake stopwork correctlyhero_whiteboard_ui.sockNotes
web/base_web.html)localhost:8880/adminImplementation Complete
Changes Made
Unified
hero_whiteboard_webintohero_whiteboard_ui:/and admin dashboard at/admin//ws/{board_id}with manual hyper accept loop/rpc, parsed at/admin/rpc/s/{token}, static assets for both UIsFiles modified:
crates/hero_whiteboard_ui/src/main.rs— Unified server with WebSocket supportcrates/hero_whiteboard_ui/src/routes.rs— Merged all routes (admin nested under /admin/)crates/hero_whiteboard_ui/src/assets.rs— Dual rust-embed (admin + web static assets)crates/hero_whiteboard_ui/src/ws.rs— WebSocket module (from _web)crates/hero_whiteboard_ui/src/lib.rs— Added ws module exportcrates/hero_whiteboard_ui/Cargo.toml— Added futures-util dependencycrates/hero_whiteboard_ui/static/web/— Web static assets (copied from _web)crates/hero_whiteboard_ui/templates/web/— Web templates (copied from _web)Cargo.toml— Removed hero_whiteboard_web from workspaceMakefile— Simplified, removed script-based targets, uses self-start directlybuildenv.sh— Removed hero_whiteboard_web from BINARIESscripts/install.sh— Removed hero_whiteboard_webscripts/download-assets.sh— Updated for unified structureFiles deleted:
crates/hero_whiteboard_web/— Entire crate (merged into _ui)scripts/run.sh,scripts/stop.sh,scripts/rundev.sh,scripts/status.sh,scripts/logs.shCLAUDE.mdTest Results
cargo check --workspace: OK (compiles clean)cargo test --workspace: All passed, 0 failuresImplementation committed:
c6372a1Browse:
c6372a1