| Two deployment topologies, one repo |
Picking only one target trades away either fast iteration (Vercel) or predictable always-on hosting (App Runner) |
Vercel serverless for day-to-day development speed; Dockerized App Runner for a traditional always-on deployment — both built from the same codebase, both with full feature parity. |
| AWS path collapses to one container |
Running Next.js as its own Node server alongside FastAPI means two processes, two health checks, more moving parts on a cost-capped instance |
Next.js is pre-built to static assets at image-build time and served directly from FastAPI — one process, one health check, simpler to reason about at 0.25 vCPU. |
| Token-by-token SSE on every route |
Returning one blocking JSON response after several seconds of generation reads as a frozen app |
Streaming keeps the app feeling responsive throughout generation, even though total time to a complete summary hasn't changed. |
| Native per-language translation |
Templating a translated patient letter risks losing the tone and formality appropriate to that language's clinical register |
Each translation is generated fresh in the target language, so tone holds up across languages as different as French, Mandarin, Farsi, and Tagalog. |
| No database, no persistence layer |
Storing clinical notes without a compliance pass first would be a real risk for a healthcare-adjacent product |
Note content is only ever in-flight to OpenAI for generation and never written to disk — a deliberate scope boundary ahead of any formal HIPAA hardening work. |
| App Runner sized to 1 instance, 0.25 vCPU |
Leaving autoscaling at defaults on a demo project risks surprise cost |
min = max = 1 instance pins the always-on deployment to a predictable, low, known monthly cost (~$5–10). |