HOSHCARE API - Backend Data Pipeline
1. the problem
The original backend for HOSHCARE: token verification on every request, four relational data models, encrypted document streaming, and an extraction pipeline that dispatched medical scans to Gemini Vision and returned structured fields for review. Extraction never wrote directly to primary storage - output was buffered in staging, awaiting human review. Query strings in download endpoints leak tokens into server logs and browser history - header-only auth is non-negotiable for medical documents.
ROLE: Streaming HTTP upload handler enforcing strict RFC 6750 Bearer token headers. Query string tokens are rejected at the edge to prevent URL logging in upstream reverse proxies.
2. what i built
The ingestion backend pipeline and verification architecture before the NestJS cutover:
3. problems i had to crack
Click card to view root cause & code diffA column existed in the Prisma schema and in application code but not in the running database. Requests failed on a field that looked present everywhere it was read. Fixed by enforcing that db push and generate run strictly together in CI, never separately.
Gemini was returning {} with a 200 status on some documents. The responseSchema was under-specified - fields not explicitly declared were silently dropped rather than rejected. Fixed by declaring every field explicitly and adding an empty-payload retry guard.
The browser's native download cannot attach an Authorization header, tempting query string tokens. Query strings land in server logs and browser history - unacceptable for medical records. Kept header-only auth and handled downloads client-side via memory Blobs.
Running two backends against one app caused auth sync bugs. Migrated the app to the shared NestJS backend in a day - used migrate deploy rather than db push to avoid corrupting nine already-committed database migrations.
PRIVATE REPO. Happy to walk through the code and architecture in an interview.
| PROJECT | HOSHCARE API (BACKEND) |
| DRAWN BY | BIDYA B. NANDA |
| STATUS | SUPERSEDED JUL 2026 |