Edward Joseph
Healthcare SaaS

FiveScribe

HIPAA-compliant contextual augmentation platform for Medicaid caregivers, reducing report generation time from 30 minutes to under 2 minutes while maintaining regulatory compliance.

93%
Time Reduction
10x
Cost Reduction
15x
Faster Billing
100%
HIPAA Compliant

The Challenge

Medicaid caregivers spend 30+ minutes per client session manually writing detailed progress notes, interventions, and compliance documentation. This administrative burden reduces time available for actual patient care and creates bottlenecks in billing cycles. The documentation must meet strict HIPAA requirements and Medicaid audit standards while remaining affordable for small healthcare agencies.

Time-Intensive
30 min per report
Compliance Risk
Manual HIPAA adherence
Cost Prohibitive
Existing solutions $200+/mo

The Solution

FiveScribe is a production-ready SaaS platform that transforms caregiver voice notes and observations into compliant Medicaid documentation in under 2 minutes. Built on AWS serverless infrastructure with advanced contextual augmentation, the system provides enterprise-grade security at startup-friendly pricing.

Contextual Augmentation
Advanced contextual augmentation transforms raw caregiver notes into structured Medicaid-compliant reports with interventions, participant responses, progress notes, and next steps.
HIPAA Compliance
End-to-end encryption, audit logging, Cognito authentication, and BAA-eligible AWS services ensure full regulatory compliance.
Usage-Based Pricing
Stripe-integrated tier system with token tracking: Starter (free), Professional ($97/mo), Enterprise ($497/mo) with 99%+ margins.
Real-Time Usage Tracking
DynamoDB atomic counters track reports and tokens per billing period with automatic monthly resets and quota enforcement.
Client Management
Full CRUD for client records with Medicaid ID tracking, goals management, and historical report access.
Secure Architecture
Serverless Lambda functions, API Gateway with Cognito authorizer, encrypted S3 storage, and CloudWatch monitoring.

Product Walkthrough

Dashboard Overview

Clean, accessible interface showing recent reports, quick actions, and usage summary. Built with Next.js, React 19, and Tailwind CSS with full keyboard navigation support.

Generate a Care Note

Transform raw caregiver observations into structured Medicaid documentation in under 2 seconds. The system generates interventions, participant responses, progress notes, and next steps—all formatted for compliance.

Client Management

Full CRUD for client records with Medicaid ID tracking, goals management, and historical report access.

Reports & Compliance

Browse completed notes, review compliance status, and export documentation for Medicaid audits with a 6-year retention trail.

Usage & Billing

Real-time usage dashboard showing reports generated, tokens consumed, and remaining quota. Integrated with Stripe for seamless plan upgrades and billing management.

Data Engineering

Analytics infrastructure behind the application

FiveScribe included a compact healthcare analytics stack to move production data out of DynamoDB, land it in S3, model it in Snowflake with dbt, and expose trustworthy reporting for usage, billing, and operational oversight.

594
Records processed
Clients, reports, and usage events exported into the warehouse pipeline.
7
dbt models
Four staging views and three marts for cost, usage, and visit analytics.
$50-100
Monthly platform cost
Snowflake X-SMALL plus S3 storage, with auto-suspend and low idle overhead.
Delivery evidence
Slide through the core data engineering work shipped for FiveScribe.
1 / 4
FiveScribe dbt lineage graph
dbt + Snowflake7 models / 3 marts
dbt lineage from raw exports to business marts

Operational DynamoDB exports are modeled through bronze, silver, and gold layers to produce agency usage, client visit history, and cost analysis tables.

This platform followed a medallion flow from DynamoDB export to S3 bronze storage, then into Snowflake raw, staging, and mart layers with dbt-tested analytics on top.
FiveScribe Snowflake medallion architecture
Warehouse designRAW -> STAGING -> MARTS
Medallion warehouse layout in Snowflake

The warehouse keeps raw JSON isolated, typed staging views clean, and analytics-ready marts separate so finance, operations, and compliance reporting stay auditable.

This platform followed a medallion flow from DynamoDB export to S3 bronze storage, then into Snowflake raw, staging, and mart layers with dbt-tested analytics on top.
FiveScribe Airflow DAG graph
OrchestrationDaily at 6 AM UTC
Airflow orchestrates the daily ELT run

A compact Airflow DAG moves data from export to load to dbt run/test, giving the platform deterministic refreshes without adding heavy operational overhead.

This platform followed a medallion flow from DynamoDB export to S3 bronze storage, then into Snowflake raw, staging, and mart layers with dbt-tested analytics on top.
FiveScribe S3 bucket contents for bronze layer
AWS data lakeHIPAA-minded storage
S3 bronze layer stores secure source extracts

Raw NDJSON extracts land in S3 before warehouse loading, creating a low-cost replay point for debugging, backfills, and downstream compliance evidence.

This platform followed a medallion flow from DynamoDB export to S3 bronze storage, then into Snowflake raw, staging, and mart layers with dbt-tested analytics on top.

Technical Architecture

Frontend Stack
FrameworkNext.js 16 (App Router)
UI LibraryReact 19
StylingTailwind CSS 4
Componentsshadcn/ui + Radix UI
Authamazon-cognito-identity-js
DeploymentVercel (Edge Network)
Backend Stack
InfrastructureAWS CDK v2 (TypeScript)
ComputeLambda (Node.js 20)
API GatewayREST API + Cognito Auth
DatabaseDynamoDB (on-demand)
StorageS3 (versioned, encrypted)
Contextual AugmentationProprietary
AWS Services & Infrastructure
Compute & API
  • • Lambda (6 functions)
  • • API Gateway (REST)
  • • CloudWatch Logs
Data & Storage
  • • DynamoDB (3 tables)
  • • S3 (reports + assets)
  • • SSM Parameter Store
Security & Auth
  • • Cognito User Pool
  • • IAM roles & policies
  • • KMS encryption
Data Flow Architecture
User Request → API Gateway → Cognito Auth → Lambda
                                               │
                                               ├─ 1. Check usage limits
                                               │     └─ DynamoDB atomic read
                                               │
                                               ├─ 2. Call contextual augmentation API
                                               │     └─ Report generation
                                               │
                                               ├─ 3. Record usage
                                               │     └─ DynamoDB atomic increment
                                               │
                                               └─ 4. Return report + metadata

Key Features & Implementation

Token-Based Usage Tracking

Implemented atomic DynamoDB counters for deterministic cost control. Each report generation tracks prompt tokens, completion tokens, and total usage against tier-based monthly limits.

Starter (Free)
50 reports/mo
100K tokens/mo
Professional ($97/mo)
200 reports/mo
500K tokens/mo
Enterprise ($497/mo)
Unlimited reports
2M tokens/mo
Technical Implementation
  • • Pre-request usage gating prevents overages
  • • Atomic DynamoDB UpdateItem prevents race conditions
  • • Billing period auto-resets monthly (YYYY-MM format)
  • • Real-time quota enforcement with 429 responses
HIPAA Compliance Architecture

Built from the ground up with healthcare compliance requirements. All PHI is encrypted at rest and in transit, with comprehensive audit logging and access controls.

Encryption
  • ✓ DynamoDB AWS-managed encryption
  • ✓ S3 SSE-S3 encryption
  • ✓ TLS 1.2+ for all API calls
  • ✓ SSM SecureString (KMS)
Access Control
  • ✓ Cognito JWT authentication
  • ✓ IAM least-privilege policies
  • ✓ User data isolation (userId scoping)
  • ✓ S3 public access blocked
Audit & Compliance
  • • CloudWatch logs for all Lambda executions
  • • S3 versioning for immutable audit trail
  • • DynamoDB point-in-time recovery (35 days)
  • • BAA-eligible AWS services only

Cost Structure & Economics

Monthly Infrastructure Cost
API Gateway (50k requests)$0.18
Lambda (50k invocations)$0.50
DynamoDB (on-demand)$1.00
S3 (5GB storage)$0.15
Cognito (< 50k MAU)$0.00
Contextual Augmentation API (~5M tokens)$50.00
Total (small agency)~$53/month
Unit Economics
Per Report Cost
~$0.001
(800 input + 1,200 output tokens @ optimized pricing)
Gross Margin
99%+
Across all pricing tiers
Scalability
Serverless architecture scales automatically with zero idle costs. DynamoDB on-demand billing ensures cost efficiency at any scale.

Results & Impact

Operational Efficiency
93%
Reduction in documentation time (30 min → 2 min per report)
15x
Faster report generation compared to manual writing
100%
Medicaid compliance maintained with structured output
Technical Excellence
$53
Monthly infrastructure cost for small agency (3 nurses, 10 clients)
99%+
Gross margin across all pricing tiers
Zero
Idle costs with serverless architecture

Implementation Highlights

Infrastructure & Deployment
CloudFormation Stacks
Deployed 4 stacks (Auth, Data, API, Budget) with AWS CDK v2
Interactive Deployment
Created automated script reducing setup from 30 min to 5 min
Budget Monitoring
Email alerts at 50%, 80%, 100% thresholds
Key Lesson
Deployment automation reduces friction—invest time upfront for faster iterations
Reliability & Error Handling
Error Handling
Implemented comprehensive error handling and validation
Data Isolation
Created separate user contexts to prevent race conditions
Defensive Coding
Added null checks and optional field handling
Key Lesson
Data isolation prevents flakiness—shared state causes unpredictable failures
Cost Optimization
Model Selection
Tested premium vs optimized models—identical quality, 67x cheaper
Token Tracking V2
Implemented atomic counters with pre-request gating
Usage Enforcement
Implemented quota enforcement with dedicated limit validation
Key Lesson
Don't assume expensive solutions are necessary—validate cheaper alternatives first
Documentation & Infrastructure
Documentation Consolidation
Organized 50+ scattered docs into coherent system
VPC Infrastructure
Built feature-flagged VPC stack (zero cost when disabled)
Portfolio Materials
Created presentation, case study, and elevator pitches
Key Lesson
Good documentation is a force multiplier—makes onboarding and maintenance effortless

Critical Technical Decisions

1. Optimized Contextual Augmentation Selection
67x Cost Reduction
Original Plan
  • • Premium model: $10/$30 per 1M tokens
  • • Cost per report: $0.067
  • • Gross margin: 85%
  • • Response time: 3-5 seconds
Final Implementation
  • • Optimized model: $0.15/$0.60 per 1M tokens
  • • Cost per report: $0.001
  • • Gross margin: 99%+
  • • Response time: 1-2 seconds
Why It Worked

For structured template-based generation with clear instructions, the optimized model produces identical quality. The key was testing before assuming the expensive option was necessary.

2. Serverless over Containers
94% Cost Reduction
Container Option (ECS/Fargate)
  • • Base cost: $50+/month
  • • Always-on compute
  • • Manual scaling
  • • Connection pooling required
Serverless (Lambda)
  • • Base cost: $3/month
  • • Pay-per-use
  • • Automatic scaling
  • • Zero idle costs
Trade-offs

Cold starts are 100ms without VPC, 1-2s with VPC. For our use case (user-initiated report generation), this latency is acceptable. The cost savings far outweigh the minor UX impact.

3. Feature-Flagged VPC
Flexibility Without Cost

VPC isolation provides network security but adds $32/month for NAT Gateway. Not all customers need this—only those with private databases or strict compliance requirements.

Implementation

Built complete VPC infrastructure with Flow Logs and VPC endpoints, but gated deployment behind a feature flag. Zero cost when disabled, easy to enable when needed.

ENABLE_VPC=true ./deploy.sh

Technologies & Tools

Next.js 16
React 19
TypeScript
Tailwind CSS
AWS CDK
Lambda
DynamoDB
S3
API Gateway
Cognito
CloudWatch
SSM
Contextual Augmentation
Stripe
Playwright
shadcn/ui

Need a similar solution?

Whether you're building a healthcare SaaS, implementing HIPAA compliance, or need serverless architecture expertise, we can help you ship production-ready systems.