Commit Graph
5 Commits
Author SHA1 Message Date
westfarn 3162ed1f7f Make auth JWT-only for Capacitor WebView origins (#22) (#26)
Unit Tests / test (push) Successful in 10s
## Summary
- Closes #22
- Drop CSRF cookie / `js-cookie` path; axios uses JWT `Authorization` only (`withCredentials: false`)
- Unified token storage: `localStorage` sync source of truth + optional Capacitor Preferences mirror/hydrate for native shells
- Request interceptor always attaches fresh bearer token; 401 refresh + sign-in redirect use hash-safe native paths
- Companion backend PR: `ai_ml_operations/chat_backend` branch `capacitor-cors-csrf-22` (CORS/CSRF Capacitor origins)

## Test plan
- [x] Unit tests: `tokenStorage`, `nativePlatform`, `jwtHelpers`, Auth/SignIn/WebSocket (`npm run test:ci`)
- [ ] Login from Capacitor Android (`https://localhost`) and iOS (`capacitor://localhost`)
- [ ] Token refresh after access expiry; logout blacklist; password reset; 401 → sign-in
- [ ] Confirm browser build at `chat.aimloperations.com` unchanged
- [ ] Merge companion backend PR so prod CORS includes Capacitor origins when `CORS_ORIGIN_ALLOW_ALL=false`Reviewed-on: #26
2026-07-26 14:09:19 -07:00
westfarn 5a7a4dd4eb Deploy chat_web_app via server-infra (node-static) (#15)
Unit Tests / test (push) Successful in 10s
## Summary

Implements [chat_web_app#13](#13) Part A: wire the CRA frontend into the same **node-static** deploy path as `dta_webapp` (no Docker for serving).

- `build:prod` / `build:beta` write into `/var/www/{env}.chat.aimloperations/html`
- API/WS URLs come from `REACT_APP_*` (`.env.production` / `.env.beta`) instead of hardcoded localhost
- Gitea unit tests + auto deploy-prod on `master`; deploy-beta via `workflow_dispatch`
- README documents local dev, env files, and webroot layout

Branch includes the #11 unit-test commit (`test:ci`) so CI has a green suite.

Companion server-infra branch (Part B): `issue-13-register-chat-web-app` on `ai_ml_operations/server-infra`.

## Test plan

- [ ] `cd llm-fe && npm run test:ci`
- [ ] Merge + ensure Unit Tests workflow passes on PR
- [ ] Merge server-infra `issue-13-register-chat-web-app`, then sync/pull on runner
- [ ] Redeploy web-static (or full host provision) so nginx listens on **8082**
- [ ] Manual: `server-infra/scripts/deploy.sh --app chat_web_app --env prod --ref <sha>`
- [ ] NPM: point `chat.aimloperations.com` at `adama:8082` + `roslin:8082` + `ai-server-4080:8082`
- [ ] Confirm built assets hit `https://chatbackend.aimloperations.com`Reviewed-on: #15
2026-07-25 04:34:12 -07:00
westfarn c0d83359cc Add unit tests (#11) (#14)
## Summary
- Add Jest/RTL unit tests for data models, Card, Footer, CustomTextField/PasswordField, CustomToastMessage, ConversationCard, AuthContext, and SignIn
- Remove the broken CRA `App.test.tsx` placeholder that expected "learn react"
- Add `npm run test:ci` for non-interactive CI runs

Closes #11

## Test plan
- [ ] `cd llm-fe && npm install`
- [ ] `npm run test:ci` — expect 9 suites / 32 tests passing

Reviewed-on: #14
2026-07-14 18:03:24 -07:00
westfarn 004153617b Tons of updates. Rags paginated tables, site tracking 2025-05-14 03:23:18 -05:00
westfarn 626d471a15 inital check in 2025-03-07 12:21:37 -06:00