Skip to content

No. 11Security8 min read2,154 words

Healthtech web app development: stack, risks and timelines

Healthtech web app development for founders: the PHI boundary, a stack that passes vendor review, FHIR integrations, realistic timelines and the traps to avoid.

Written by
Lazy Devs
Published
Updated
Sources
Cited inline

Key takeaways · 05

The short version

  1. 01A healthtech web app is a normal web app plus three non-negotiables: a signed BAA with every vendor that touches PHI, an audit trail nothing can bypass, and role-based access enforced on the server.
  2. 02Draw the PHI boundary in week one. Marketing site, billing and product analytics should live outside it, which shrinks your compliance surface, vendor list and testing effort.
  3. 03Route every read of patient data through one server-only data access function that checks permissions and writes the audit log, so new features cannot skip either.
  4. 04Integrations with EHRs and labs, usually via HL7 FHIR, are the most common cause of schedule slips. Start sandbox access and vendor paperwork on day one.
  5. 05Check early whether any feature makes clinical recommendations, because some software functions are regulated by the FDA as medical devices.
On this page · 12

Building a healthtech web app is mostly normal web development with three extra rules: every vendor that touches protected health information (PHI) must sign a business associate agreement, every access to patient data must be logged in a way nobody can bypass, and access control must be specific to roles and enforced on the server. Decide how you will handle those three things in week one and the rest of the build feels like any other serious product. Bolt them on at the end and you pay for the architecture twice.

Most healthtech projects do not struggle because the engineering is hard. They struggle because the founder learns about audit logs and BAAs a few weeks before a pilot, when the architecture is already set. This guide is the version we wish every founder read first.

This is engineering guidance, not legal advice. Confirm your regulatory obligations with a healthcare compliance professional.

What actually makes healthtech different

A healthtech app has the same building blocks as any SaaS product: authentication, a database, an API, a front end, some background jobs. If you handle PHI, three things change, and they touch almost every layer.

  1. Every system that touches PHI needs a BAA. Database host, file storage, email and SMS, error tracking, logging, support desk. If a vendor will not sign, PHI cannot flow through it. Plenty of popular developer tools will not, and you find out the hard way if you check late.
  2. You need an audit trail. Who viewed which patient record, when, and from where. It must be designed into the data access layer so a new endpoint cannot skip it.
  3. Access control gets specific. "Logged-in user" is not a rule. A nurse, a billing clerk and a patient see different slices of the same record, and the rules are enforced on the server and tested.

None of this is exotic. It is just non-negotiable, and it shapes choices you would otherwise make casually. If you are still working out whether HIPAA applies to you at all, start with our plain-English guide to HIPAA-conscious software, which covers covered entities, business associates and consumer apps.

Draw the PHI boundary first

The single most useful early decision is where PHI lives. A scheduling feature that stores who is seeing which specialist is inside the regulated zone. A marketing landing page is not. The smaller the zone, the smaller your vendor list, your testing burden and your risk.

SystemInside the PHI boundary?Why it matters
Clinical records, appointments, messagesYesNeeds BAA vendors, audit logs, strict access
Patient-facing portal pages behind loginYesNo third-party trackers, careful caching
Marketing site and blogNoCan use normal hosting, CMS and analytics
Subscription billing for clinics (B2B)Usually noKeep patient data out of invoices and payment metadata
Product analyticsKeep it outSend event names and anonymous IDs, never health details
Support deskOften yes, by accidentPatients paste symptoms into tickets; choose a vendor that signs a BAA or route PHI elsewhere

Where you can, put the regulated parts in a separate application, database and deployment from everything else. It costs a little more setup and saves a great deal of review effort, because an auditor or a hospital security team can look at a small system instead of your whole company.

A stack that does not fight you

For most healthtech web apps we build, the shape is unsurprising: a Next.js front end, a TypeScript API and backend, and PostgreSQL. The healthtech-specific choices are about where things run and who signs paperwork.

LayerOur defaultHealthtech-specific concern
HostingA major cloud under its BAAOnly services on the provider's eligible list may handle PHI. AWS publishes its HIPAA eligible services reference; Google Cloud and Azure have equivalents
DatabaseManaged PostgreSQLEncryption at rest, encrypted connections, backups covered by the BAA, point-in-time recovery tested
AuthA managed identity providerMust sign a BAA if it stores PHI; enforce MFA for staff; short sessions on shared clinical devices
File storageObject storage with private bucketsShort-lived signed URLs, no public links, virus scanning on upload
Email and SMSTransactional provider under BAANotifications say "you have a new message", never the content
Logs and errorsError tracker and log platformScrub request bodies and query strings by default; vendor needs a BAA if anything sensitive could slip through

For authentication in particular, use a provider rather than rolling your own. Our guide to authentication patterns in Next.js covers the trade-offs; in healthtech, add BAA availability to the comparison.

One data access layer for every PHI read

The pattern that saves the most grief is boring: never query patient tables directly from route handlers, Server Actions or components. Route every read and write through a small server-only module that checks permissions and writes the audit entry. The Next.js data security guide recommends the same "data access layer" shape, and the server-only package makes the build fail if that module is ever imported into client code.

// lib/dal/patients.ts
import "server-only";
import { getSession } from "@/lib/auth";
import { db } from "@/lib/db";
import { auditLog } from "@/lib/audit";
import { assertCanViewPatient } from "@/lib/permissions";
 
export async function getPatientRecord(patientId: string) {
  const session = await getSession();
  if (!session) throw new Error("Not authenticated");
 
  // Role and relationship check, enforced on the server.
  await assertCanViewPatient(session.user, patientId);
 
  const record = await db.patient.findUnique({ where: { id: patientId } });
 
  // Log the access, not the PHI itself.
  await auditLog.write({
    actorId: session.user.id,
    action: "patient.view",
    patientId,
    at: new Date(),
  });
 
  return record;
}

It is not clever code, and that is the point. The permission check and the audit log live in one place every feature must go through, so a developer adding a screen next year cannot accidentally leak data or skip the log. Remember that Server Actions are reachable as public endpoints, so they need the same checks; calling the data access layer from them gives you that for free.

Integrations: FHIR, EHRs and labs

Most healthtech products eventually need to talk to an electronic health record (EHR), a lab or a payer. The common language is HL7 FHIR, a REST-style standard that models patients, encounters, observations and appointments as resources. For apps that launch from inside an EHR or need a patient's authorisation, SMART on FHIR layers OAuth-based authorisation on top.

In the US, federal rules on information blocking have pushed providers and EHR vendors toward standard, API-based access, which makes integration more feasible than it used to be. Feasible is not the same as fast, though:

  • Sandbox access takes time. EHR vendors have app programmes with registration and review steps. Apply on day one.
  • Real data is messier than the spec. Optional fields are missing, codes vary between sites, and test environments are flaky.
  • Every hospital is slightly different. A FHIR integration that works at one site often needs mapping work at the next.

Treat integrations as their own workstream with their own buffer, and build them behind an adapter layer so site-specific quirks do not leak into your core data model. The retry and idempotency discipline from webhooks done right applies to these feeds just as much as to payment events.

Check whether you are building a medical device

This one surprises founders. The FDA regulates some software as a medical device, known as Software as a Medical Device (SaMD), when it is intended to diagnose, treat, mitigate or prevent disease. Scheduling, messaging, billing and general wellness features usually fall outside that. A feature that interprets clinical data and recommends a treatment may not.

You do not need to resolve this alone, but you do need to ask the question before you build the feature, because the answer changes your development process, documentation and timeline significantly.

Timelines and what makes them slip

These are rough planning ranges, not quotes. Every project differs, and anyone who gives you a fixed price before understanding your data flows is guessing.

ScopeTypical shapeWhat dominates the schedule
Focused pilotOne core workflow, real PHI, auth, audit logging, clean boundaryVendor BAAs, access rules, testing
Multi-role platformPatient and staff views, several roles, notificationsPermission design, UX for each role
Integrated platformAll of the above plus EHR, lab or payer integrationsThird-party sandboxes, data mapping, site-by-site rollout

For a small senior team, a focused pilot is usually a matter of a few months; integrated platforms run considerably longer and then continue. The compliance work itself rarely dominates. What dominates is rework caused by skipping the boundary decisions at the start, and waiting on other organisations.

Two things blow up healthtech timelines more than anything else. The first is vendor paperwork: getting a BAA signed can take days or weeks, so start those conversations immediately. The second is integrations, for the reasons above. Budget slack for both.

Passing a hospital or health plan security review

If you sell to clinics, hospitals or health plans, the first serious customer will send a security questionnaire before any pilot starts, often with a draft BAA attached. These questionnaires are long and specific, and a weak answer can stall a deal for months. Build the evidence while you build the product, not the week the questionnaire arrives.

Expect to be asked about most of the following:

Question areaWhat reviewers want to see
Risk analysisA documented, current HIPAA risk analysis and what you did about the findings
Access controlRole-based access, MFA for staff, how access is granted and removed, periodic access reviews
Audit loggingWhat is logged, how long it is kept, who can read it, and whether it can be altered
EncryptionAt rest and in transit, including backups and file storage, and who manages the keys
VendorsA list of subprocessors that touch PHI, each with a signed BAA
Incident responseA written plan, who is on call, and how quickly you will notify the customer
TestingRecent penetration test results and how you track fixes
Business continuityBackup frequency, tested restores and recovery objectives

Some larger buyers also ask for an independent attestation such as a SOC 2 report or HITRUST certification. Neither is required by HIPAA, but both are common shortcuts for a customer's security team, so ask your first prospects early what they will expect. A tidy, honest answer to a questionnaire, backed by the audit log and access controls described above, is often worth more than any badge.

The traps we see most often

When we review or take over a healthtech codebase, the same issues come up again and again.

  • PHI in places nobody thinks of as systems. Spreadsheet exports, support tickets, screenshots in a shared drive, a chat channel where someone pasted a record to debug. Compliance covers the whole flow, not just the database.
  • Session replay on clinical screens. Replay tools can record a clinician typing notes. Disable them inside the boundary, or use one that masks all input and signs a BAA.
  • Caching patient pages. A CDN or framework cache serving one patient's page to another is a breach. Patient-specific pages must be rendered per request and marked private.
  • "The doctor can see everything." Can a doctor see a patient who is not theirs? Across clinics? After the patient leaves the practice? Write the access rules down with whoever owns the clinical workflow before anyone codes them.
  • Over-engineering. You do not need a fleet of microservices to run a pilot. A well-structured monolith on eligible infrastructure, with a clean boundary and honest audit logging, covers most early-stage products.

Most of the remaining issues are general web security, and our web application security checklist covers them.

Your first 30 days

  1. Confirm your regulatory position and whether any feature could be a medical device.
  2. Map every place PHI is collected, stored, sent or displayed.
  3. Draw the boundary and list every vendor inside it; request BAAs now.
  4. Write the access matrix per role, with real edge cases.
  5. Stand up the data access layer and audit log before the first feature.
  6. Apply for EHR or lab sandbox access if you need integrations.
  7. Ship the first workflow to a test environment with role-based tests passing.

Patient-facing products have one more layer: the people using them are often stressed, unwell or older. Our guide to designing patient portals people actually use covers that side.

Build it right the first time

Healthtech building is normal web development with a clear boundary around regulated data, signed paperwork with every vendor that touches it, and an audit trail nothing can bypass. We have built to these constraints before and we know where the schedule risk hides. Take a look at our work for healthtech teams, or tell us what you are building and we will give you a straight read on architecture, scope and timeline.

FAQ · 04 questions

Frequently asked questions

How long does it take to build a healthtech web app?

As a rough planning guide rather than a quote, a focused pilot with one core workflow, real patient data, proper authentication and audit logging is usually a matter of a few months for a small senior team. A platform with several user roles, patient and staff views, and EHR integrations takes considerably longer. Integrations and vendor paperwork are what usually stretch the schedule, not the application code.

What tech stack is best for a healthcare web app?

There is no special healthcare stack. A mainstream setup such as Next.js and React on the front end, a TypeScript API, and PostgreSQL works well, as long as every component handling PHI runs on infrastructure whose vendor will sign a business associate agreement. Vendor eligibility matters more than framework choice.

What is FHIR and do I need it?

FHIR (Fast Healthcare Interoperability Resources) is the HL7 standard API format for exchanging health data such as patients, observations and appointments. If your product needs to read from or write to electronic health record systems, you will almost certainly work with FHIR, often through SMART on FHIR for authorisation. If you do not integrate with clinical systems yet, you do not need it on day one.

Is my health app a medical device?

It might be. The FDA regulates some software as a medical device when it is intended to diagnose, treat, mitigate or prevent disease, while general wellness apps and many administrative tools fall outside that scope. If your product interprets clinical data or recommends treatment, get regulatory advice before you build that feature.

Related service

API & Backend Engineering

Secure, well-documented APIs that scale.

Learn more

Next step

Want this built right?

This is the work we do every day. Tell us what you are building and we will show you exactly how we would ship it.

First reply
Within 1 business day
Typical start
1–2 weeks
Pricing
Fixed price per phase
You own
All code and accounts