Files
chat_web_app/README.md
T
westfarn b075006d0f
Unit Tests / test (pull_request) Successful in 11s
Wire node-static deploy for chat_web_app (closes #13).
Add build:prod/beta webroot scripts, Gitea CI/deploy workflows, and bake API
URLs from REACT_APP_* so hosts can deploy via server-infra like dta_webapp.
2026-07-25 04:32:07 -07:00

1.9 KiB

Chat Bot Frontend (chat_web_app)

CRA/React app under llm-fe/. Production serve is node-static (not Docker): hosts build with npm and write into /var/www/...; the shared web-static nginx container serves those roots. Deploy is driven by server-infra.

Local development

cd llm-fe
npm ci
npm start

Uses .env.development (API → local chat_backend, usually http://127.0.0.1:8001).

Environment files (CRA REACT_APP_*)

File When used Backend
.env.development npm start local backend
.env.production npm run build / build:prod https://chatbackend.aimloperations.com
.env.beta npm run build:beta https://beta.chatbackend.aimloperations.com

Baked into the JS bundle at build time. No host secret file needed for this frontend (unlike Django apps under ~/Documents/secrets/).

Required vars:

  • REACT_APP_BACKEND_REST_API_BASE_URL — REST base (trailing /api/)
  • REACT_APP_BACKEND_WS_API_BASE_URL — WebSocket URL (full ws:// / wss:// path)

Production / beta build (host deploy)

server-infra runs npm ci then npm run build:<env> in llm-fe/. Those scripts write static assets into:

Script Document root
npm run build:prod /var/www/prod.chat.aimloperations/html
npm run build:beta /var/www/beta.chat.aimloperations/html

Paths must match server-infra app_catalog.chat_web_app.webroot_pattern.

Manual deploy from the control node:

~/Documents/repos/server-infra/scripts/deploy.sh \
  --app chat_web_app --env prod --ref <sha>

CI / CD (Gitea)

  • .gitea/workflows/unit-tests.yml — tests on push/PR to master
  • .gitea/workflows/deploy-prod.yml — after green Unit Tests on master push
  • .gitea/workflows/deploy-beta.yml — manual (workflow_dispatch)

Tests

cd llm-fe
npm run test:ci