Skip to content

FiveTech_ERP: rama 100% web (opt-in, mismo backend) - #24

Open
russimicro wants to merge 3 commits into
mainfrom
feature/rama-web-100
Open

FiveTech_ERP: rama 100% web (opt-in, mismo backend)#24
russimicro wants to merge 3 commits into
mainfrom
feature/rama-web-100

Conversation

@russimicro

Copy link
Copy Markdown
Collaborator

Resumen

erp_http.prg ya sirve API JSON + estáticos en 0.0.0.0:2222, con el WebView2
de escritorio como un cliente HTTP más. Este PR hace explícita esa dualidad
como tres ramas del mismo build (PC / híbrida / 100% web), sin tocar el
comportamiento por defecto:

  • PC (sin cambios): el exe de siempre.
  • Híbrida: WebView2 por módulo dentro de un shell nativo (mismas rutas /web-*).
  • Web (este aporte): 4 frontends intercambiables (vainilla / Angular 21+PrimeNG /
    React / Vue) servidos como estáticos del propio backend, consumiendo el
    mismo contrato /api/* y la misma cookie DWSESS.

Qué cambia

  • Form1.prg: variable opcional ZWEB_FRONT=<bundle> — sin ella, el exe es
    idéntico a hoy. Con ella, el WebView2 embebido carga un bundle servido en
    vez del shell FWH. Se agrega también WEBVIEW2_ONBIND para abrir enlaces
    en el navegador nativo del SO (no navega el WebView embebido).
  • erp_http.prg:
    • Fix de una race condition real en POST /api/dataset: el
      read-modify-write no era atómico (la lectura vivía fuera del mutex).
      Bajo 10 escrituras concurrentes: 8/10 fallaban con corrupción sin el fix,
      10/10 OK con el fix (ErpMutexGuard, ver
      docs/web-branch/HALLAZGO_CONCURRENCIA_DATASETS.md).
    • Sirve /portal/ igual que cualquier otra carpeta de www/ (selector
      visual de frontend).
    • ErpShellOpenUrl (Windows ShellExecuteA, con fallback multiplataforma)
      para abrir URLs en el navegador por defecto del SO.
  • www/web-{vainilla,angular,react,vue}/ + www/portal/: bundles construidos.
  • frontends/: fuentes de los 4 frontends (vainilla no requiere build).
  • scripts/: api-check.mjs, concurrency*.py, evidence.cjs — pruebas
    reproducibles del contrato, concurrencia y captura Playwright de los 4
    frontends.
  • docs/web-branch/: propuesta técnica, sustento con evidencia medida, y el
    hallazgo de concurrencia documentado.

Garantías

  • Sin cambios en el comportamiento por defecto (nada de esto se activa solo).
  • Sin dependencias nuevas del lado Harbour; los frontends viven como
    estáticos, el servidor no sabe qué framework los sirve.
  • Contrato HTTP existente sin modificar; solo adiciones opt-in.

Evidencia (reproducible)

node scripts/api-check.mjs        # 8/8 OK
python scripts/concurrency.py 10  # 10/10 sesiones concurrentes
node scripts/evidence.cjs         # capturas Playwright de los 4 frontends

Detalle completo, matriz de ramas por modelo de negocio y capturas en
docs/web-branch/PROPUESTA_FIVETECH_RAMA_WEB.md y
docs/web-branch/SUSTENTO_RAMA_100_WEB.md.

🤖 Generado con Claude Code

russimicro and others added 2 commits August 8, 2026 14:02
…, opt-in)

Makes explicit, as three interchangeable branches of the same build, what
erp_http.prg already does: serve JSON API + static files on 0.0.0.0, with
the desktop WebView as just one more HTTP client.

- ZWEB_FRONT env var (Form1.prg, off by default): points the exe's embedded
  WebView2 at a served bundle instead of the FWH shell — PC branch stays
  byte-identical without it.
- www/web-{vanilla,angular,react,vue} + www/portal/: four interchangeable
  SPA bundles (built) consuming the existing /api/* contract, plus their
  sources under frontends/ and a build guide in README.md.
- erp_http.prg: fixes a read-modify-write race in POST /api/dataset under
  concurrent writers (ErpMutexGuard; see docs/web-branch/HALLAZGO_CONCURRENCIA_DATASETS.md),
  and serves /portal/ the same way any other www/ folder is served.
- docs/web-branch/: proposal, evidence and reproducible check scripts
  (api-check.mjs, concurrency*.py, evidence.cjs).

No changes to the default run path, the HTTP contract, or existing build
scripts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Renames the framework-less frontend and every reference to it (folders,
routes, portal/login links, README, docs, evidence screenshots) from
"vanilla" to "vainilla".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Makes the driver-config page reachable from the "PC" branch: this same
portal already loads inside the exe's own embedded WebView2 via
ZWEB_FRONT=portal, so this link surfaces there too, not just in a browser.

Note: db-config.html itself ships in the companion "hdbc" driver PR
(#26), not this one — the link 404s until that lands, same as any other
cross-PR reference would.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
russimicro added a commit that referenced this pull request Aug 8, 2026
… folder

Lets the "PC" branch reach db-config.html directly inside its own embedded
WebView2 (ZWEB_FRONT=db-config.html) instead of only being reachable from a
browser. Backward compatible: ZWEB_FRONT=web-vainilla / =portal (bundle
folders, PR #24) still resolve to <name>/index.html exactly as before —
only a value already ending in ".html" skips that suffix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant