Turn the mock backend + UI into a public, click-to-play demo deployable as a
Portainer stack, gated behind DEMO=1 (classic single-user mock unchanged when off).
Backend (neode-ui/mock-backend.js):
- Per-session state isolation via AsyncLocalStorage + Proxy: every visitor gets
an isolated, deep-cloned copy of mockData/walletState/userState/etc., keyed by
a demo_sid cookie. Per-session WebSocket fan-out, idle reaper, session cap.
- Real per-session file storage (upload/folder/rename/delete) with a 50MB quota,
replacing the no-op filebrowser handlers; adds the missing app.filebrowser-token RPC.
- Force simulation mode (never touch a host Docker/Podman socket).
- Testnet (signet) flavor; shared login password "entertoexit".
- Report the real app version suffixed with -demo.
Frontend:
- VITE_DEMO build flag (useDemoIntro.ts): replay the intro once per calendar day
per browser; prefill + show the "entertoexit" login hint.
Deploy:
- docker-compose.demo.yml wired for DEMO, UI on :2100 (build-from-repo).
- demo-deploy/ thin stack (prebuilt :demo image refs + .env.example + README).
- .github/workflows/demo-images.yml builds/pushes archy-demo-{web,backend} images.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
name: Demo images
|
|
|
|
# Builds and pushes the public-demo images on every change to the UI / mock
|
|
# backend, so the separated `archy-demo` Portainer stack auto-tracks the real
|
|
# code (see demo-deploy/ and docs/demo-deployment-design.md).
|
|
#
|
|
# Required repo configuration:
|
|
# vars.DEMO_REGISTRY e.g. 146.59.87.168:3000/lfg2025
|
|
# secrets.DEMO_REGISTRY_USER
|
|
# secrets.DEMO_REGISTRY_TOKEN
|
|
# Optional:
|
|
# secrets.PORTAINER_WEBHOOK redeploy hook called after a successful push
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'neode-ui/**'
|
|
- 'docker-compose.demo.yml'
|
|
- '.github/workflows/demo-images.yml'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build & push demo images
|
|
runs-on: ubuntu-latest
|
|
# Skip cleanly on forks / before registry config is set.
|
|
if: ${{ vars.DEMO_REGISTRY != '' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.DEMO_REGISTRY_HOST || vars.DEMO_REGISTRY }}
|
|
username: ${{ secrets.DEMO_REGISTRY_USER }}
|
|
password: ${{ secrets.DEMO_REGISTRY_TOKEN }}
|
|
|
|
- name: Build & push backend
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: neode-ui/Dockerfile.backend
|
|
push: true
|
|
tags: |
|
|
${{ vars.DEMO_REGISTRY }}/archy-demo-backend:demo
|
|
${{ vars.DEMO_REGISTRY }}/archy-demo-backend:${{ github.sha }}
|
|
|
|
- name: Build & push web
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: neode-ui/Dockerfile.web
|
|
push: true
|
|
build-args: |
|
|
VITE_DEMO=1
|
|
tags: |
|
|
${{ vars.DEMO_REGISTRY }}/archy-demo-web:demo
|
|
${{ vars.DEMO_REGISTRY }}/archy-demo-web:${{ github.sha }}
|
|
|
|
- name: Trigger Portainer redeploy
|
|
if: ${{ success() && secrets.PORTAINER_WEBHOOK != '' }}
|
|
run: curl -fsS -X POST "${{ secrets.PORTAINER_WEBHOOK }}"
|