Dan Trapp

Standalone business / Healthcare

TrialLayer

A production clinical-trial intelligence platform with 500k+ trials, proprietary Trial Health Scores, authenticated dashboards, billing, AI analysis, and background data infrastructure.

A live clinical-trial intelligence platform that turns public trial data into decision-ready analysis across trial likelihood of success, site overload, sponsor portfolios, investigator history, protocol density, alerts, reports, and AI-assisted research workflows.

Status

Live

Timeline

Live clinical-trial intelligence platform

Domain

Healthcare

Why

Standalone business

TrialLayer sponsor portfolio detail for AstraZeneca
Sponsor analysis and portfolio healthLive

Stack

Languages, services, data sources, and operating pieces behind the build.

Next.jsTypeScriptPostgresDrizzleClerk OAuthStripeAnthropicTrigger.dev cronPython / TS data jobsVPS sync pipelineAACTClinicalTrials.govFDA / SEC / PubMed

Code Proof

What The Build Actually Contains

LOC

52k+

Source files

318

Migrations

18

Auth

Clerk

Billing

Stripe

AI

Anthropic

Sync

Cron/VPS

Product proof

TrialLayer sponsor portfolio detail for AstraZeneca
Sponsor analysis and portfolio health
TrialLayer site reliability profile for University of Michigan
Site reliability, overload, and protocol density

Implementation

Code Behind The Surface

Nightly Trial Sync

ts

The platform is not a static data wrapper. It depends on scheduled ingestion, normalization, snapshots, and recalculated scores.

export const ctgovSync = task({
  id: "ctgov-full-sync",
  cron: "0 7 * * *",
  run: async () => {
    const trials = await fetchClinicalTrialsGov();
    const normalized = trials.map(parseTrialRecord);

    await upsertTrials(normalized);
    await createHistoricalSnapshots(normalized);
    await recalculateTrialHealthScores(normalized);
  },
});

Billing And Access Control

ts

Clerk, Stripe, usage limits, and protected routes turn the intelligence layer into an actual SaaS product.

const { userId } = await auth();
if (!userId) redirect("/sign-in");

const access = await getUserAccess(userId);
if (!access.canUseAiQuery) {
  return NextResponse.json(
    { error: "AI queries require a paid subscription" },
    { status: 402 },
  );
}

Anthropic Analysis

ts

AI is used where it belongs: summarizing, querying, briefing, and explaining dense clinical context.

const response = await anthropic.messages.create({
  model: AI_MODEL,
  max_tokens: MAX_TOKENS_SYNTHESIZE,
  messages: [
    {
      role: "user",
      content: buildClinicalIntelligencePrompt(context),
    },
  ],
});

Project Logic

Why This Exists

The point is not to show another screen. It is to show the gap, the build constraint, and the proof of work.

Mission

Can public clinical-trial data show which trials, sites, sponsors, and investigators are positioned for success or overload?

Clinical trial data is public, but the signal is buried across protocols, statuses, sponsors, investigators, sites, conditions, enrollment patterns, and trial outcomes. The market needs an intelligence layer for health, risk, reliability, overload, and likely success.

Build

What Had To Work

I built the full product and operating layer: a Next.js application with Clerk OAuth, Stripe subscriptions and webhooks, gated dashboards, watchlists, alerts, reports, Anthropic-powered analysis, proprietary scoring, Drizzle/Postgres schema work, Python and TypeScript import jobs, nightly sync infrastructure, and a separate VPS-backed data pipeline for large clinical datasets.

Why It Matters

500k+ trials / THS

Makes trial, sponsor, site, and investigator risk visible before teams commit time, capital, or protocol strategy.

Hard Parts

The Dataset Is Huge

ClinicalTrials.gov and AACT are not small lookup tables. The build needed import scripts, migrations, snapshots, sync logs, and background jobs so hundreds of thousands of trials could stay usable.

The Product Has A Real Business Layer

TrialLayer includes Clerk OAuth, protected routes, Stripe checkout, subscription state, billing portal access, usage gates, and webhook handling. It is built like a SaaS product, not a demo.

AI Needed Guardrails And Context

Anthropic analysis sits on top of structured clinical context: trial records, sponsor history, site data, external signals, and generated briefs. The point is judgment, not chatbot theater.

Decisions

Use public clinical data as the foundation, then build proprietary scoring and entity intelligence on top.
Keep paid product mechanics in the app: auth, billing, usage limits, dashboards, reports, watchlists, and alerts.
Run ingestion and enrichment as background infrastructure instead of making the UI wait on expensive data work.
Use AI for synthesis and analysis only after the structured data layer is strong enough to support it.

Next Move

I would continue expanding predictive validation, add alerting for score and status changes, deepen sponsor and investigator benchmarking, and split private demo builds like the Paradigm Health command center into their own connected product surfaces.

Tell Me About Your Project

Bring Me The Bottleneck.
I’ll Build The Answer.

Tell me what people are trying to do, where the current path breaks, and what kind of useful answer should exist.

Market Gap

Demand exists, but the answer is missing.

Workflow Drag

The work is still too manual, slow, or scattered.

Product Wedge

A small surface could prove the larger opportunity.

Quick Note