M1-F: end-to-end LLM marketplace lifecycle on Vector testnet
Bonded-escrow marketplace for prompt → response between buyers and
local-LLM suppliers, settling on Vector (UTxO) via Aiken Plutus V3
validators. Lifecycle PostEscrow → Claim → Submit → Accept proven on
Vector testnet 2026-05-06; AcceptEscrow tx 125e3cfe…7dc100d distributes
payment + bonds per the validator's distribution rule.
Workspace layout (pnpm + TypeScript):
contracts/marketplace/ Aiken validators (advert + escrow) + plutus.json
packages/shared/ Tx-builders (lucid-evolution), CBOR codecs,
chain providers (mock / read-only / live Ogmios)
supplier/ OpenAI-compatible HTTP node (Ollama by default;
vLLM / llama.cpp / OpenRouter / OpenClaw all
swap-in via OLLAMA_URL); 202+poll chat handler
buyer/ Express + React SPA; server-side runs the full
chain lifecycle via /v1/submit-prompt and
/v1/accept; SPA never holds the buyer key
indexer/ Chain-follower (extends apex-dashboard pattern),
SSE event stream + REST queries
indexer-ui/ Operator dashboard (events + suppliers + escrow
lookup)
tests/ 1098 vitest unit + integration tests (10 skipped
under M1-F-D-defer for UPLC test plumbing)
deploy/testnet/ Per-service docker-compose for the Hetzner stack
docs/EXECUTIVE_SUMMARY.* Marp deck (PDF + PPTX) — 11 slides, mermaid
diagrams pre-rendered for portable export
docs/CLOUDFLARE_WAF_BYPASS.md CF Skip-rule runbook for /v1/* paths
docs/ARCHITECTURE.md canonical spec
Live demo (testnet, 2026-05-06):
https://mp-buyers.vector.testnet.apexfusion.org (buyer SPA)
https://mp-suppliers.vector.testnet.apexfusion.org (supplier API)
https://mp-indexer.vector.testnet.apexfusion.org (indexer + UI)
This commit is contained in:
49
buyer/vite.config.ts
Normal file
49
buyer/vite.config.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* buyer/vite.config.ts — Vite config for the React UI bundle.
|
||||
*
|
||||
* The UI source lives at buyer/src/ui (with index.html alongside). The build
|
||||
* output goes to buyer/dist; the Express server in production mounts that
|
||||
* directory via createApp({ distPath }).
|
||||
*
|
||||
* SPEC FIX 2026-04-27 (M1-F-1): alias array uses regex `find` for the bare
|
||||
* `@marketplace/shared` so it does NOT prefix-match sub-paths like
|
||||
* `@marketplace/shared/chain`. The previous object-form aliases were matched
|
||||
* in insertion order; the broad `@marketplace/shared` would rewrite
|
||||
* `@marketplace/shared/chain` to `…/index.ts/chain` (a path under a file)
|
||||
* which broke the production Vite build. Sub-path aliases come BEFORE the
|
||||
* bare-name regex regardless, so the order here is robust either way.
|
||||
*/
|
||||
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { resolve } from "path";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
root: resolve(__dirname, "src/ui"),
|
||||
build: {
|
||||
outDir: resolve(__dirname, "dist"),
|
||||
emptyOutDir: true,
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
},
|
||||
resolve: {
|
||||
alias: [
|
||||
// Sub-path aliases first (longest prefixes win on string matching).
|
||||
{ find: "@marketplace/shared/chain", replacement: resolve(__dirname, "../packages/shared/src/chain/index.ts") },
|
||||
{ find: "@marketplace/shared/cbor", replacement: resolve(__dirname, "../packages/shared/src/cbor/index.ts") },
|
||||
{ find: "@marketplace/shared/receipt", replacement: resolve(__dirname, "../packages/shared/src/receipt/index.ts") },
|
||||
{ find: "@marketplace/shared/tx", replacement: resolve(__dirname, "../packages/shared/src/tx/index.ts") },
|
||||
{ find: "@marketplace/shared/network", replacement: resolve(__dirname, "../packages/shared/src/network.ts") },
|
||||
// Bare alias as a regex anchored to end — only matches exact
|
||||
// `@marketplace/shared`, never a sub-path.
|
||||
{ find: /^@marketplace\/shared$/, replacement: resolve(__dirname, "../packages/shared/src/index.ts") },
|
||||
// Browser stub for tx/blueprint.ts. The real module reads plutus.json
|
||||
// via fs/path/url; the SPA transitively imports `loadBlueprint` but
|
||||
// never calls it (tx construction is server-side via /v1/*). Aliasing
|
||||
// to a stub keeps Node builtins out of the Rollup browser bundle.
|
||||
{ find: /\/packages\/shared\/src\/tx\/blueprint\.ts$/, replacement: resolve(__dirname, "src/ui/stubs/blueprintStub.ts") },
|
||||
],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user