Pablo's Architecture Proposal

A faithful write-up of what Pablo wants to build and change in the Call Analyst architecture, framed so Mark can decide. Pablo's case is presented in full; an honest assessment section follows so the tradeoffs are visible.

Subject: Call Analyst (callanalyst.app) · Proposed by: Pablo (senior-engineer collaborator) · Companions: the build docs and the refactor plan.

Executive summary

Pablo is proposing to take Call Analyst from a solo proof-of-concept (a single-file PWA on managed serverless) to a production-grade, AWS-native, compliance-ready product. The proposal has two halves that reinforce each other:

The engineering half

Split the monolith into proper HTML/JS/CSS modules, host the frontend on a CDN (CloudFront + S3), move the backend to VPC-isolated Lambdas, containerize where needed, and express the whole thing as AWS CDK / CloudFormation. He has spot-optimized, ready-to-go CDK templates for both the CDN frontend and the isolated backends, and offers to own the infra.

The legal half

Treat this as a meeting-recorder that handles sensitive personal data: add GDPR/CCPA compliance, all-party recording consent, data residency, geofencing, retention and deletion, and subprocessor agreements. This is the part a POC skips and a real release cannot.

His stated goals: reliability, scalability, predictable cost, security, and the legal standing to actually operate. His core argument: use the right tools and "do it right" now, with infra he already has battle-tested, rather than ship a centralized POC and retrofit later.

The core thesis

"The decisions taking this into a localized monolith are not what we need. We need a grown-up build. From a legal perspective as well as an engineering one, are you sure this is a full release? Is a 20k single HTML file OK to ship just because it's centralized?"

Pablo's central point is that "it works and it's centralized" is not the same as "it's a product." Shipping a POC as a full-fledged product means crossing a set of engineering and legal thresholds that the current build has not crossed. He is arguing the gap is real, the tooling to close it already exists (his CDK templates), and the closing is "not a large lift" when the right tools are used and he carries the infra.

He also reframed an earlier reliability debate: the headline isn't a specific number of nines, it's whether the product is built to be operated, audited, and trusted at production standard. On that framing, the productionization gap is the real subject.

Where it stands today (what Pablo wants to move off of)

LayerToday
FrontendOne ~20,000-line single-file PWA (index.html), HTML+CSS+JS inline, no build step
HostingNetlify (managed); the app auto-publishes from main
BackendNetlify Node functions + Deno edge functions (managed serverless)
Data / authSupabase (managed Postgres + auth + storage), plus Cloudflare R2
Build segregationConsumer vs internal via a runtime flag and a drifting git branch
SecretsScattered as per-site env vars; some keys in plaintext config; no rotation
ComplianceNot yet addressed — no consent framework, GDPR, residency, retention, or DPAs
Network posturePublic managed endpoints; no VPC / private subnets (there is no network to isolate in a managed-SaaS model)

1 · Decompose the monolith

Separate the HTML, JS, and CSS into distinct files and modules. End the single 20k-line file. Pablo frames this as table stakes for a "grown-up" build, and as a prerequisite for any security or privacy review (an opaque single file is effectively unauditable).

Point of agreement. Both Pablo and the prior refactor plan call for this. The open sub-question is monorepo modules vs multiple repos (see §6).

2 · Frontend on a CDN (CloudFront + S3)

Serve the static frontend from Amazon S3 behind CloudFront, defined by a spot-optimized, ready-to-go CDK template Pablo already has. This replaces Netlify hosting for the consumer app with AWS-native, globally cached delivery under unified AWS control.

3 · VPC-isolated Lambda backends

Move the backend from Netlify/Deno functions to AWS Lambda, deployed inside a VPC with private subnets (network isolation), via Pablo's second CDK template. The goal is a controlled network boundary, fine-grained IAM, and a single, auditable security perimeter for everything that touches user data. Pablo considers the Lambda lift small given the templates already exist.

4 · Containers & images

Pablo wants container images as part of the build ("we need our images"). In a Lambda-centric design this most directly means container-image-packaged Lambdas and/or a path to ECS/Fargate for any workload that needs it. It standardizes how code is packaged and deployed, and gives a clean home for any long-running worker (for example agentic background jobs or media/transcription processing that exceeds serverless time limits).

5 · Everything as CDK / CloudFormation

Express the entire stack as AWS CDK / CloudFormation — infrastructure as code — so the frontend, backend, network, and security are unified, versioned, reproducible, and owned in one place. This is the backbone of the proposal: one selected infrastructure that unifies security and operations, rather than a spread of managed SaaS each with its own controls.

6 · Repo & ownership structure

Pablo proposes feature-grouped separate repos rather than one general, multi-faceted repo, to force focus and a more mature build. Critically, he offers to own the AWS infrastructure himself. That ownership is a central variable: it changes who carries the operational burden of the migration (see §assessment).

7 · The legal / compliance layer the part a POC skips

Pablo's strongest point: Call Analyst records people's meetings, which makes it a processor of voice and transcript data full of personal information, often including people who never opted in. That front-loads a legal layer from the first real user, independent of how clean the code is:

Why the two halves connect. Controlled AWS infra gives genuinely better primitives for the legal layer: region-pinned storage for residency, KMS for key management and rotation, fine-grained IAM for least privilege, VPC + WAF for network controls, and real geofencing. The infra argument and the compliance argument reinforce each other.

Before → after, at a glance

LayerToday (POC)Pablo's target
Frontend code20k-line single file split HTML/JS/CSS, modular
Frontend hostingNetlify S3 + CloudFront (CDK)
BackendNetlify + Deno functions VPC-isolated Lambdas (CDK)
Packagingraw files container images
Infra definitionconsole + scattered env CDK / CloudFormation, unified
Networkpublic managed endpoints VPC, private subnets, IAM
Reposone repo feature-grouped repos
Secretsplaintext / per-site env KMS + rotation + least privilege
Compliancenone consent, GDPR, residency, retention, DPAs
OwnershipMark + AI Pablo owns the infra

What Pablo is optimizing for

Reliability

A stack built to production standard: isolated, monitored, reproducible.

Scalability

Infra that grows with the user base under one control plane.

Predictable cost

Spot-optimized, IaC-defined spend rather than ad-hoc managed-SaaS bills.

Security

Network isolation + unified IAM + proper secret management.

Legal standing

The compliance layer that lets the product legally operate, especially in the EU.

"Do it right"

Use the right tools now, on infra he has already proven, rather than retrofit.

Honest assessment (so the tradeoffs are visible)

Where Pablo is clearly right

The distinctions Mark should hold onto

Proposed sequencing (do it right without blowing the launch)

  1. Scope the launch by geography. US-first, recording consent handled per two-party states, GDPR deferred by deliberate geofence. Makes a near-term launch legal without boiling the ocean.
  2. Stand up Pablo's CDK foundation — S3 + CloudFront frontend, VPC-isolated Lambda backend, KMS for secrets, region-pinned storage. The skeleton he already has.
  3. Run the legal / data track in parallel — consent capture, a real deletion pipeline, subprocessor DPAs, privacy policy + ToS. The part no infra does for you.
  4. Split the frontend into modules as it lands on the CDN, so it is auditable for the review compliance will trigger.
  5. Port functions to Lambda and migrate auth/data off Supabase — the genuine labor, sequenced after the skeleton, with a tested cutover and rollback.

Decisions for Mark

DecisionThe choice
Migrate to AWS now, or after PMF?Pablo owning the infra + ready templates makes "now" reasonable. The gate is sequencing it so it doesn't consume the launch window.
Launch scopeUS-first geofence (defer GDPR) vs full EU readiness on day one.
ReposFeature-grouped repos (Pablo) vs one monorepo with module boundaries.
Who owns the infra long-termPablo carries AWS — confirm this is durable, since reliability follows ownership.
Compliance track owner + budgetThe legal work (consent, deletion, DPAs, policy) needs an owner and likely outside counsel. This is the non-optional half.
Report compiled 2026-06-17 from the Mark–Pablo architecture consultation. Pablo's proposal presented in full; assessment added for decision support. Companions: build docs · refactor plan. Behind the Daxos password gate.