separate admin UI _ui and move the current ui to _web #19
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_shrimp#19
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?
currently the _ui is for the enduser, but not the admin interface that's defined for all hero projects
so the goal is changing _ui to be _web and register it in the router as enduser dashboard
and creating an admin one in _ui
Implementation Spec for Issue #19
Objective
The current
hero_shrimp_uicrate serves the end-user conversational dashboard (chat, job workbench, library, voice input). This crate should be renamed tohero_shrimp_weband registered inhero_routerunder thewebURL segment using aweb_web.socksocket. Thehero_shrimp_uiname and socket (ui.sock) should then be reclaimed for a new admin interface following Hero project best practices.Before:
After:
Requirements
hero_shrimp_web. It binds toweb_web.sockand is accessible at/hero_shrimp/web.hero_shrimp_uiis created for the admin interface, bound toui.sock, accessible at/hero_shrimp/ui.rust-embed/healthand/.well-known/heroservice.jsonendpoints requiredCargo.tomlis updated to addhero_shrimp_weband keephero_shrimp_ui.hero_shrimp_types/src/paths.rsgainsdefault_web_socket()→web_web.sock.hero_shrimp/src/service.rsregisters three actions:hero_shrimp_server,hero_shrimp_web, andhero_shrimp_ui.hero_shrimp --startoutput.Files to Create / Modify
Files to Create:
crates/hero_shrimp_web/Cargo.toml— new crate, binary targethero_shrimp_webcrates/hero_shrimp_web/build.rscrates/hero_shrimp_web/src/lib.rs— moved fromhero_shrimp_ui/src/lib.rs, socket renamedcrates/hero_shrimp_web/src/main.rs— moved fromhero_shrimp_ui/src/main.rscrates/hero_shrimp_web/src/routes.rs— moved, heroservice manifest updatedcrates/hero_shrimp_web/src/assets.rs— copied unchangedcrates/hero_shrimp_web/static/— entire static dir copiedcrates/hero_shrimp_web/templates/— entire templates dir copiedcrates/hero_shrimp_ui/Cargo.toml— new admin crate (replaces old)crates/hero_shrimp_ui/src/main.rs— binds toui.sockcrates/hero_shrimp_ui/src/lib.rs— admin routercrates/hero_shrimp_ui/src/routes.rs— admin tab handlerscrates/hero_shrimp_ui/src/assets.rs— rust-embedcrates/hero_shrimp_ui/templates/base.html— Bootstrap 5 admin dashboardcrates/hero_shrimp_ui/static/— CSS, JS, fontsFiles to Modify:
Cargo.toml— addcrates/hero_shrimp_webto memberscrates/hero_shrimp_types/src/paths.rs— adddefault_web_socket()crates/hero_shrimp/src/service.rs— register third actionhero_shrimp_webcrates/hero_shrimp/src/main.rs— print all three socket pathscrates/hero_shrimp_sdk/src/lib.rs— re-exportdefault_web_socket()Implementation Plan
Step 1: Add
default_web_socket()tohero_shrimp_types/src/paths.rsFiles:
crates/hero_shrimp_types/src/paths.rspub fn default_web_socket() -> PathBufthat callssocket_path("web_web")Dependencies: none
Step 2: Create
hero_shrimp_webcrate (end-user dashboard)Files:
crates/hero_shrimp_web/(entire new crate)hero_shrimp_uirun_ui()→run_web(), socket env var →HERO_SHRIMP_WEB_SOCKETdefault_web_socket()fallback"protocol": "web","socket": "web"Dependencies: Step 1
Step 3: Add
hero_shrimp_webto workspaceCargo.tomlFiles:
Cargo.toml"crates/hero_shrimp_web"tomembersDependencies: Step 2
Step 4: Create new
hero_shrimp_uiadmin crate (replace old content)Files:
crates/hero_shrimp_ui/(replace all)/health,/.well-known/heroservice.json,/rpcproxy,/api/*"protocol": "ui","socket": "ui"Dependencies: Step 1
Step 5: Register
hero_shrimp_webinservice.rsFiles:
crates/hero_shrimp/src/service.rshero_shrimp_webbinary binding toweb_web.sockhero_shrimp_uiaction unchangedDependencies: Steps 1, 2, 4
Step 6: Update startup output in
main.rsFiles:
crates/hero_shrimp/src/main.rs--starthero_shrimp_webto legacy cleanup listDependencies: Step 5
Step 7: Update
hero_shrimp_sdkFiles:
crates/hero_shrimp_sdk/src/lib.rsdefault_web_socket()Dependencies: Step 1
Acceptance Criteria
crates/hero_shrimp_web/compiles as a standalone cratehero_shrimp_webbinary binds toweb_web.sock→ routed at/hero_shrimp/web/hero_shrimp/webcrates/hero_shrimp_ui/contains the new admin-only interfacehero_shrimp_uibinary binds toui.sock→ routed at/hero_shrimp/ui/healthand/.well-known/heroservice.jsonhero_shrimp --startstarts all three binaries and prints all three socket pathscargo test --workspacepassescargo clippy --workspace -- -D warningspassesNotes
web_web.sock(notweb.sock). The scanner pattern isweb_<name>.sockwhere<name>becomes the URL segment.hero_shrimp_uihas no persistent state — it is a pure proxy frontend.X-Forwarded-Prefixin templates: Both UIs rely on thebase_pathinjected from the header. After renaming, the prefix for the web crate will be/hero_shrimp/weband for the admin crate/hero_shrimp/ui. No template changes needed.socketfield: Inhero_shrimp_web, set"socket": "web". Inhero_shrimp_ui, keep"socket": "ui".Test Results
Status: pass (no regressions introduced)
Command: cargo check --workspace && cargo test --workspace
Pre-existing failures (present on base branch before these changes):
New failures introduced by this PR: 0
Implementation Summary
Changes Made
New crate:
crates/hero_shrimp_web/hero_shrimp_ui)web_web.sock— routed by hero_router to/hero_shrimp/web"protocol": "web","socket": "web"Replaced:
crates/hero_shrimp_ui/ui.sock— routed by hero_router to/hero_shrimp/ui/health,/.well-known/heroservice.json,/rpcproxy,/api/*"protocol": "ui","socket": "ui"Modified:
crates/hero_shrimp_types/src/paths.rsdefault_web_socket()→ resolves toweb_web.sockModified:
crates/hero_shrimp/src/service.rshero_shrimp_server,hero_shrimp_web,hero_shrimp_uihero_shrimp_webbinds toweb_web.sock,hero_shrimp_uibinds toui.sockModified:
crates/hero_shrimp/src/main.rs--startprints all three socket paths--stopcleans up all three binariesModified:
crates/hero_shrimp_sdk/src/lib.rsdefault_web_socket()re-exportModified:
Cargo.toml(workspace)crates/hero_shrimp_webto membersRouting After This Change
/hero_shrimp/webweb_web.sock/hero_shrimp/uiui.sock/hero_shrimp/rpcrpc.sockTest Results
cargo check --workspace: clean
cargo test --workspace: 0 new failures (10 pre-existing failures unchanged)