Commit graph

6 commits

Author SHA1 Message Date
Vadym Samoilenko
f60b7261b5 Add Azure AD MSAL SSO (SPA token exchange)
- Backend: Azure AD JWKS validator with 24h cache, new POST /api/v1/auth/sso/login
  endpoint, sso_login() in AuthService with auto-provisioning, password_hash made
  nullable, auth_provider column added, Alembic migration c1d2e3f4a5b6
- Frontend: @azure/msal-browser, msal.ts config singleton, ssoLogin() API function,
  login page updated with SSO button and redirect callback handling
- Deploy: frontend Dockerfile and docker-compose.prod.yml updated to bake Azure AD
  vars into the image at build time; deploy.sh validates SSO config on init/deploy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 18:08:46 +01:00
DJP
ff4e7e768e Add seed script to register existing TM/ref files in database
Scans storage/amazon/tm/ and storage/amazon/ref/, creates DB registry
entries for each JSON file so they appear in the TM Registry and
Reference Library pages. Extracts channel from TM filenames, locale
from ref filenames, counts JSONL segments. Idempotent (skips duplicates).

Also added to deploy.sh --init flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 10:08:23 -04:00
DJP
5681ca4acf Always rebuild frontend with --no-cache in deploy script
Next.js builds inside Docker's multi-stage builder get cached even when
source files change, causing stale frontends after deploy. Backend still
uses normal caching since Python doesn't have this issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 20:18:00 -04:00
DJP
b0055c53ab Update deploy script: TM files from git, fix orphan containers
- Removed old import_reference_files.py step from --init (TM/ref files
  are now tracked in git, no separate import needed)
- Added file count verification during --init to confirm TM files arrived
- Added --remove-orphans to docker compose commands to prevent stale
  containers serving old builds
- Standard deploy now does compose down before up to ensure clean restart

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 19:11:09 -04:00
DJP
3fe93c2b22 feat: configure deployment for optical-dev.oliver.solutions/amazon-transcreation
- Apache reverse proxy config (replaces nginx — server already runs Apache)
- Next.js basePath set to /amazon-transcreation for subpath deployment
- Frontend on port 3050 (3000 taken), backend on 8040
- WebSocket URL auto-detects protocol from page location
- Deploy script handles Apache config injection into existing vhost
- All Docker ports bound to 127.0.0.1 (Apache handles external access)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 13:05:12 -04:00
DJP
4a5c1c6dfe feat: add production deployment, fix auth flow, add nginx reverse proxy
- deploy.sh: one-command deploy script (--init for first time, bare for updates)
- docker-compose.prod.yml: production stack with nginx, multi-worker uvicorn, no volume mounts for code
- nginx/nginx.conf: reverse proxy with rate limiting, WebSocket support, static asset caching
- Fix login to use real backend API instead of mock localStorage tokens
- Add auth guard to AppShell (prevents flash-of-content on unauthenticated routes)
- JWT claims decoded client-side for user info (no extra /me call needed)
- Switch logo from missing .jpeg to .svg
- Frontend API URL defaults to same-origin (works behind nginx without CORS)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 12:53:48 -04:00