Commit graph

3 commits

Author SHA1 Message Date
goose
043b4442a7 fix: HTTPS with self-signed cert for Web Crypto API support
Some checks failed
Lint and Build / format (push) Successful in 43s
Lint and Build / clippy (push) Successful in 2m42s
Lint and Build / build (push) Successful in 3m44s
Lint and Build / test (push) Failing after 1s
Browsers disable crypto.subtle on non-localhost HTTP. The frontend server now
generates a self-signed TLS cert at startup and serves over HTTPS by default
(FRONTEND_TLS=true). FRONTEND_TLS=0 disables it for localhost dev.

Added axum-server (tls-rustls) + rcgen deps to the frontend-server crate.
2026-07-14 11:43:56 -03:00
goose
300072a5d3 fix: use Axum 0.7 /*path syntax for API proxy routes 2026-07-05 11:39:41 -03:00
goose
1b5c1e2a06 feat: separate frontend container (Axum static serving + API proxy)
A dedicated Rust/Axum binary (web/frontend-server/) that:
- Serves the built Vite SPA bundle from dist/ via tower-http ServeDir
- Falls back to index.html for SPA routing (deep links work)
- Reverse-proxies /api/* to the backend container (same-origin, no CORS)
- Listens on port 8080 (configurable via FRONTEND_PORT)

Dockerfile (web/normogen-web/Dockerfile): 3-stage build:
1. Node: npm ci + npm run build -> dist/
2. Rust: cargo build --release the frontend-server binary
3. Runtime: debian-slim + binary + dist/

docker-compose.yml: new 'frontend' service on :8080, depends on backend healthy,
proxies to http://backend:6500. Independently scalable (run N replicas behind
a load balancer).

Architecture:
  Browser -> :8080 (frontend container)
    /api/* -> proxy -> backend:6500
    /*     -> static dist/ (SPA)
2026-07-05 11:24:19 -03:00