Marketplace — Master Roadmap (v1.0 Hero Implementation) #1
Labels
No labels
meeting-notes
meeting-sensitive
meeting-transcript
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coopcloud_code/home#1
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?
Vision
Align
projectmycelium_marketplacewith the Hero white-label pattern — schema-driven, code-generated, OSIS-native — following theznzfreezonereference implementation. The freezone proves the pattern works at scale (95+ RPC methods, 20+ services, full CRUD code generation from.oschema, admin dashboard, K3s HA deployment). The marketplace must follow the same closed DevOps flow.Current State
What exists today (v0.2.0):
osis_client.rs) — no SDK, no code generation/specs/(marketplace, products, slices, TFP points, apps, nodes, gateways, names)What's missing vs the freezone pattern:
.oschemafilefreezone.oschema(2881 lines, 50+ enums, 20+ root objects, 20+ services)hero_rpc_generator→OsisFreezonedomain + RPC traits + Rhai bindingsOsisClientrhai_types_generated.rs(from .oschema)AxumRpcServer(fromhero_rpc_osis)/rpcendpoint, 95 methods)Architecture — Target State
Roadmap Phases
P0 — Foundation (CLAUDE.md + Schema + Data Pipeline)
CLAUDE.mdformarketplace_workworkspace (includes data pipeline flow, Rhai strategy)marketplace.oschemafrom existing 14 service traits + modelssrc/models/into OSchema enums + embedded typesUser,Product,Order,Cart,WalletLedger,Message,SSHKey,ServiceProvider,AppProvider,ResourceProvider,NodeRental,SliceRental,SliceAssignmentOrderStatus,PaymentMethod,ProductCategory,NodeStatus,NodeRentalType, etc.#[cfg(feature = "rhai")]).oschemacompiles withhero_rpc_generatorand produces:osis_server_generated.rs— OsisMarketplace domain with DBTyped fieldsrpc_generated.rs— service traits + error typesrhai_types_generated.rs— auto-generated Rhai type bindings (.validate(),.json(),.otoml())types.rs— shared types for core/server/clientP1 — Hero-Native Backend
hero_rpc_osisandhero_rpc_generatoras Cargo dependenciesOsisMarketplacedomain from.oschema_get(),_set(),_find(),_new()methods for all root objectsProductServiceError,AuthServiceError, etc.ProductServiceTrait,AuthServiceTrait, etc.AxumRpcServer/api/v1/marketplace/main/rpc/api/v1/marketplace/main/docOsisClientwith generated domain methodsP1b — Rhai Scripting Layer
scripts/seed-hero-osis.sh(2595 lines bash+Python) with Rhai scripts:scripts/rhai/seed_marketplace.rhai— full OSIS data seeding usinghero_rpc_osis::rhaimodulescripts/rhai/seed_demo.rhai— lightweight demo data for local devrhai_types_generated.rsregisters all marketplace types in hero_do enginerhai_builders = ["rhai"]src/models/user/rhai.rs— User builder for scriptingsrc/models/product/rhai.rs— Product buildersrc/models/order/rhai.rs— Order builderscripts/rhai/health_check.rhai— endpoint health validation (replaces curl-based checks)scripts/rhai/migrate_data.rhai— data migration templatescripts/rhai/admin_ops.rhai— batch admin operations (user suspend, bulk export, etc.)hero_doREPL for interactive adminhero_do_marketplacebinary)hero_do scripts/rhai/seed_marketplace.rhaifor seedingP2 — Admin Dashboard
projectmycelium_marketplace_admincrate (or repo)AES-256-GCM)ADMIN_SEED_USERSenv varPOST /rpc→ backend/api/v1/marketplace/main/rpcmarketplace-admin add-user,list-users,remove-userP3 — Frontend Evolution
Two options (decide based on team expertise and timeline):
Option A — Keep Tera SSR, add JSON-RPC client (incremental, lower risk)
rpc()function)apiJson()call JSON-RPC instead of REST endpointsOption B — Yew/WASM migration (full alignment with freezone pattern)
projectmycelium_marketplace_frontendcrate.oschemagenerated client SDKP4 — HA Deployment & Production Hardening
projectmycelium_marketplace_backend— Axum + AxumRpcServerprojectmycelium_marketplace_frontend— SSR or WASMprojectmycelium_marketplace_admin— Admin dashboardprojectmycelium_marketplace_deploy— Docker + TFGrid + K3sdev/,prod/,prod-tfgrid/marketplace.projectmycelium.org→ frontendapi.marketplace.projectmycelium.org→ backendadmin.marketplace.projectmycelium.org→ adminscripts/rhai/deploy_k3s.rhai— K3s cluster setup usingherolib_virt::kubernetesmodulescripts/rhai/deploy_stack.rhai— full stack deployment (containers, networking, storage)scripts/rhai/setup_storage.rhai— Kadalu GlusterFS Replica3 provisioninghero_do scripts/rhai/health_check.rhai)P5 — Documentation & Ship
docs/architecture.mdto reflect hero-native architecture.oschemaKey Architectural Decisions
1. REST → JSON-RPC migration strategy
Decision: Incremental. Add JSON-RPC alongside REST, migrate controllers one by one, deprecate REST when all consumers are ported.
2. Frontend approach
Decision: Start with Option A (keep Tera SSR, add JSON-RPC client). Evaluate WASM migration after backend is hero-native. This avoids a two-front rewrite.
3. Mono-repo vs multi-repo
Decision: Keep mono-repo for P0-P2. Evaluate split at P4 when admin dashboard is a separate crate. The freezone uses multi-repo because backend/frontend/admin are different tech stacks with different build pipelines.
4. Fixture backend
Decision: Remove after P1. Replace with Rhai seed scripts (
scripts/rhai/seed_marketplace.rhai) that populate hero_osis with demo data using the OSIS Rhai module bindings. Maintaining two parallel implementations is costly. Rhai scripts are ~10x more concise than bash+Python (2595 lines → ~200 lines) and type-safe via generated bindings.5. Rhai scripting scope
Decision: Rhai replaces bash+Python for all operational scripting (seeding, deployment, health checks, admin ops). The
hero_dobinary provides the runtime. Generatedrhai_types_generated.rsfrom.oschemaensures all marketplace types are available in Rhai with.validate(),.json(),.otoml()methods. This aligns with the hero ecosystem where Rhai is the standard scripting layer for all SAL (System Abstraction Layer) operations.Reference Implementation
The freezone (
znzfreezone_code) is the reference for this pattern:znzfreezone_backend/schemas/freezone.oschema(2881 lines)OsisFreezonewith 27+DBTyped<T>fieldsAuthServiceTrait,CompanyServiceTrait, etc. (inrpc_generated.rs)AuthServiceHandler,CompanyServiceHandler, etc. (inrpc.rs, 270KB)znzfreezone_admin(Axum + Askama, 9 tabs, K8s monitoring)znzfreezone_deploy(Docker Compose → K3s, Kadalu Replica3)znzfreezone_code/home/issues/11Dependency Map
Rhai Scripting Strategy
What Rhai replaces
scripts/seed-hero-osis.sh(2595 lines)scripts/rhai/seed_marketplace.rhaiscripts/seed-demo.sh(136 lines)scripts/rhai/seed_demo.rhaiscripts/smoke-test.sh(curl-based)scripts/rhai/health_check.rhaideploy/single-vm/scripts/setup.shscripts/rhai/deploy_stack.rhaihero_doREPL with marketplace typesWhat code generation provides for Rhai
From
marketplace.oschema,hero_rpc_generatorauto-producesrhai_types_generated.rs:let u = marketplace_user(); u.set_email("a@b.com"); u.set_name("Alice");u.json(),u.otoml(),u.validate()Example: seed script comparison
Current (
seed-hero-osis.sh— bash+Python, 2595 lines):Target (
seed_marketplace.rhai— ~200 lines):Marketplace-Specific Concerns
Beyond the freezone pattern, the marketplace has domain-specific requirements:
NearRpcClient)APP_BASE_PATHfor/marketplace/demoprefix (already working)Definition of Done (v1.0)
.oschemadefines all marketplace types and services.oschema(all root objects, enums, embedded types)hero_do scripts/rhai/seed_marketplace.rhaihero_doREPL for interactive adminP0 Foundation:
marketplace.oschemaCompleteWhat was done
Designed and wrote
schemas/marketplace.oschema— the complete schema definition for the marketplace, following the Hero ecosystem OSchema pattern (reference:znzfreezone_backend/schemas/freezone.oschema).Schema summary
Coverage
.set_object(),.find(),.get_by_sid(),.list_sids(), and.delete_by_sid()call insrc/services/impl_hero/.find()query fields have@indexannotationsmarketplace.ledger,marketplace.staking) documented with key patterns and value shapessrc/services/traits/mod.rsRoot objects by domain
Known issue documented
user_profile.rsqueriesbusiness/bookingwith fieldclient_email, but the seed script only populatesbusiness/servicebookingwith fieldcustomer_email. The code fails gracefully (returns empty). Documented in schema comments for future cleanup.Next steps (P1)
hero_rpc_osis/hero_rpc_generatordependencieshero_rpc_generatoragainstmarketplace.oschemato generate typedOsisMarketplacedomainOsisClientcalls with generated typed clientsP1a: Code Generation Infrastructure Complete
Commit:
29ef20dWhat was done
hero_rpc_osis,hero_rpc_generator,herolib_sid, and Axum dependenciessrc/bin/generate.rs(marketplace_generate binary)make generateMakefile targetosis_server_generated.rs(9,630 lines) — OsisMarketplace struct + CRUDrhai_types_generated.rs(5,148 lines) — Rhai bindingsrpc.rs(1,711 lines) — Service handler stubstypes_generated.rs(1,683 lines) — 23 typed structs + 37 enumshero-nativefeature flaghero-nativebuilds compile cleanNext: P1b
Implement business logic in generated
rpc.rs— migrate 14impl_hero/managers to use typedOsisMarketplacedomain CRUD methods.P1 Complete: Hero-Native Backend
P1a: Code Generation Infrastructure
Commit: schema fixes +
marketplace_generatebinary +make generatetargetmarketplace.oschemaOsisMarketplacedomain with 23 typedDBTyped<T>fieldshero-nativefeature flag (both builds compile clean)P1b: Business Logic Migration
rpc.rsimpl_hero/*.rsfiles to generated typed domainP1c: Dual-Stack Server
marketplace_rpcbinary on port 8001 (AxumRpcServer)/api/v1/marketplace/main/rpcP1e: Rhai Scripting Layer
marketplace_rhaibinary with all 23 types registeredseed_marketplace.rhai(844 lines) replaces 2,595-line bash+Pythonseed_demo.rhai(89 lines) for quick dev testinghealth_check.rhai(105 lines) for diagnosticsArchitecture after P1
Next: P2 (Admin Dashboard), P3 (Frontend), P4 (HA), P5 (v1.0)
All Phases Complete — v1.0.0
Total code produced
~40,000+ lines across schema, generated code, business logic, controllers, admin dashboard, Rhai scripts, K8s manifests, and frontend.
Version: 1.0.0
All commits on
development, signedmik-tf.Roadmap update — v0.3.0-dev released (2026-03-24)
Closed today:
Still open:
v0.3.0-dev release highlights:
Next priorities:
Signed-off-by: mik-tf
v0.3.2-dev released — SPA 100% complete (2026-03-24)
45 routes covering all SSR functionality. All issues closed (#11, #14, #15, #16).
Release: https://forge.ourworld.tf/mycelium_code/projectmycelium_marketplace_frontend/releases/tag/v0.3.2-dev
Signed-off-by: mik-tf
v0.4.0-dev — Pixel-perfect SPA complete (2026-03-24)
All issues closed (#11, #14, #15, #16, #17). SPA has 45 routes, SVG charts, marketplace-item cards, full auth flow.
Release: https://forge.ourworld.tf/mycelium_code/projectmycelium_marketplace_frontend/releases/tag/v0.4.0-dev
Signed-off-by: mik-tf