Wire chat_web_app into the same automated deploy pipeline used by dta_webapp. Follow dta_webapp's lead: this is a node-static frontend — do not Dockerize the webapp. Build with npm on the host, write static assets into a document root, serve via the existing web-static nginx container, active/active on adama + roslin + ai-server-4080 behind NPM.
Companion backend work: chat_backend (Docker/Django like dta_service).
Current state
CRA/React app under llm-fe/ (react-scripts).
Scripts today: start, build, test — nobuild:prod / build:beta that copy into /var/www/....
.env.production points API at https://chatbackend.aimloperations.com.
No .gitea/workflows, no integration with server-infraapp_catalog / host_apps.
## Summary
Wire `chat_web_app` into the same automated deploy pipeline used by **`dta_webapp`**. Follow `dta_webapp`'s lead: this is a **node-static** frontend — **do not Dockerize** the webapp. Build with npm on the host, write static assets into a document root, serve via the existing **web-static** nginx container, active/active on **adama + roslin + ai-server-4080** behind NPM.
Companion backend work: `chat_backend` (Docker/Django like `dta_service`).
---
## Current state
* CRA/React app under `llm-fe/` (`react-scripts`).
* Scripts today: `start`, `build`, `test` — **no** `build:prod` / `build:beta` that copy into `/var/www/...`.
* `.env.production` points API at `https://chatbackend.aimloperations.com`.
* No `.gitea/workflows`, no integration with `server-infra` `app_catalog` / `host_apps`.
## How `dta_webapp` works (follow this)
* `app_catalog` type: **`node-static`** (not django/docker).
* Deploy role: git checkout → `npm ci` in `subdir` → `npm run build:<env>`.
* Build scripts write into a host webroot, e.g. dta:
* `build:prod` → `/var/www/prod.app.ditchtheagent/html`
* `build:beta` → `/var/www/beta.app.ditchtheagent/html`
* `web-static` nginx serves those roots on host ports from `host_apps` (8080/8081).
* Gitea workflows: unit tests + deploy-prod / deploy-beta calling `server-infra/scripts/deploy.sh --app dta_webapp --env <env> --ref <sha>`.
**Conclusion:** `chat_web_app` should **not** get a production Dockerfile for serving. Match node-static + web-static.
---
## Target architecture
* One built static tree per env on each host; ports match across hosts for NPM.
* Deploy on **adama + roslin + ai-server-4080** (same as dta_webapp / dta_service).
### Proposed ports
| App | prod | beta |
|-----|------|------|
| dta_webapp (nginx) | 8080 | 8081 |
| **chat_web_app (nginx, new)** | **8082** | **8083** |
| chat_backend (django docker) | 8003 | 8013 |
---
## Part A — Changes in THIS repo (`chat_web_app`)
### A1. Build scripts (mirror dta_webapp)
In `llm-fe/package.json` (or chosen package root), add:
* `build:prod` — production build + install into agreed webroot, e.g.
* `/var/www/prod.chat.aimloperations/html` (exact path TBD; must match `server-infra` `webroot_pattern`)
* `build:beta` — same for beta webroot
Ensure env-specific API URLs (CRA `REACT_APP_*` or equivalent) are set per mode so prod/beta hit the right `chat_backend`.
### A2. Gitea workflows (`.gitea/workflows/`)
Mirror `dta_webapp`:
* Unit / CI tests on push + PR
* Deploy after green tests → `server-infra/scripts/deploy.sh --app chat_web_app --env prod --ref <sha>` (and beta workflow if enabled)
### A3. Docs
* README: local dev, build:prod/beta, how deploy expects `/var/www/...` layout.
---
## Part B — Changes in `server-infra`
### B1. `app_catalog`
```yaml
chat_web_app:
type: node-static
repo: "{{ git_base_url }}/ai_ml_operations/chat_web_app.git"
default_branch: master # confirm actual default branch
subdir: llm-fe
webroot_pattern: "/var/www/{env}.chat.aimloperations/html" # align with package.json
```
### B2. `host_apps` on **adama, roslin, and ai-server-4080**
```yaml
- { name: chat_web_app, env: prod, port: 8082 }
# optional: - { name: chat_web_app, env: beta, port: 8083 }
```
### B3. `web-static`
* Confirm nginx template / compose picks up the new static apps from `host_apps` (same mechanism as dta_webapp).
### B4. NPM
* Point the public chat frontend domain(s) at `adama:8082` + `roslin:8082` + `ai-server-4080:8082`.
### B5. Docs
* Update `IMPLEMENTATION.md` ports/apps/NPM tables for `chat_web_app`.
---
## Acceptance criteria
- [ ] `npm run build:prod` / `build:beta` produce assets in the configured `/var/www/...` paths
- [ ] **Not** dockerized for production serve (node-static + web-static like `dta_webapp`)
- [ ] Gitea tests + auto-deploy via `server-infra/scripts/deploy.sh`
- [ ] Registered in `app_catalog` + `host_apps` on **adama, roslin, and ai-server-4080**
- [ ] Reachable via NPM active/active on the chat frontend domain(s)
## References
* `dta_webapp` — `build:prod` / `build:beta`, `.gitea/workflows`, node-static pattern
* `server-infra` — `app_catalog.dta_webapp`, `roles/app-deploy/tasks/node_static.yml`, `roles/web-static`
* Companion: `chat_backend` ticket (dockerize + Ollama → `10.0.0.128:11434`)
westfarn
self-assigned this 2026-07-14 03:11:33 -07:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Wire
chat_web_appinto the same automated deploy pipeline used bydta_webapp. Followdta_webapp's lead: this is a node-static frontend — do not Dockerize the webapp. Build with npm on the host, write static assets into a document root, serve via the existing web-static nginx container, active/active on adama + roslin + ai-server-4080 behind NPM.Companion backend work:
chat_backend(Docker/Django likedta_service).Current state
llm-fe/(react-scripts).start,build,test— nobuild:prod/build:betathat copy into/var/www/.....env.productionpoints API athttps://chatbackend.aimloperations.com..gitea/workflows, no integration withserver-infraapp_catalog/host_apps.How
dta_webappworks (follow this)app_catalogtype:node-static(not django/docker).npm ciinsubdir→npm run build:<env>.build:prod→/var/www/prod.app.ditchtheagent/htmlbuild:beta→/var/www/beta.app.ditchtheagent/htmlweb-staticnginx serves those roots on host ports fromhost_apps(8080/8081).server-infra/scripts/deploy.sh --app dta_webapp --env <env> --ref <sha>.Conclusion:
chat_web_appshould not get a production Dockerfile for serving. Match node-static + web-static.Target architecture
Proposed ports
Part A — Changes in THIS repo (
chat_web_app)A1. Build scripts (mirror dta_webapp)
In
llm-fe/package.json(or chosen package root), add:build:prod— production build + install into agreed webroot, e.g./var/www/prod.chat.aimloperations/html(exact path TBD; must matchserver-infrawebroot_pattern)build:beta— same for beta webrootEnsure env-specific API URLs (CRA
REACT_APP_*or equivalent) are set per mode so prod/beta hit the rightchat_backend.A2. Gitea workflows (
.gitea/workflows/)Mirror
dta_webapp:server-infra/scripts/deploy.sh --app chat_web_app --env prod --ref <sha>(and beta workflow if enabled)A3. Docs
/var/www/...layout.Part B — Changes in
server-infraB1.
app_catalogB2.
host_appson adama, roslin, and ai-server-4080B3.
web-statichost_apps(same mechanism as dta_webapp).B4. NPM
adama:8082+roslin:8082+ai-server-4080:8082.B5. Docs
IMPLEMENTATION.mdports/apps/NPM tables forchat_web_app.Acceptance criteria
npm run build:prod/build:betaproduce assets in the configured/var/www/...pathsdta_webapp)server-infra/scripts/deploy.shapp_catalog+host_appson adama, roslin, and ai-server-4080References
dta_webapp—build:prod/build:beta,.gitea/workflows, node-static patternserver-infra—app_catalog.dta_webapp,roles/app-deploy/tasks/node_static.yml,roles/web-staticchat_backendticket (dockerize + Ollama →10.0.0.128:11434)Companion backend ticket: ai_ml_operations/chat_backend#6
(
chat_backend= Docker/Django likedta_service; Ollama →http://10.0.0.128:11434.)