Project 13 of ~34

πŸ“Š Due Diligence Lite β€” Architecture

Technical specification for Due Diligence Lite β€” investor research service. SvelteKit dashboard + Deno backend + Supabase + Ollama (Mac Mini) for research agents.

SvelteKit Deno Mac-native AI Research Pipeline

πŸ—οΈ Architecture Overview

Due Diligence Lite is primarily a research pipeline with a web dashboard. The core intelligence is the research agent that aggregates data from multiple sources, synthesizes findings, and compiles a PDF report. The Mac Mini serves as the永远-on research server for nightly data refreshes and async report generation.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ USER INTERFACE β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Web Dashboard β”‚ β”‚ Order Form β”‚ β”‚ Report Viewerβ”‚ β”‚ β”‚ β”‚ (SvelteKit) β”‚ β”‚ (pitch deck β”‚ β”‚ (PDF embed) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ APPLICATION LAYER (Deno) β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Order Mgmt β”‚ β”‚ Research β”‚ β”‚ Report Gen β”‚ β”‚ β”‚ β”‚ Service β”‚ β”‚ Orchestratorβ”‚ β”‚ (PDF output) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Customer β”‚ β”‚ Financial β”‚ β”‚ Notification β”‚ β”‚ β”‚ β”‚ Outreach β”‚ β”‚ Sanity β”‚ β”‚ Service β”‚ β”‚ β”‚ β”‚ Agent β”‚ β”‚ Checker β”‚ β”‚ (Resend) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ DATA SOURCES β”‚ β”‚ DATA STORES β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ LinkedIn API β”‚ β”‚ β”‚ β”‚ Supabase (Postgres) β”‚ β”‚ β”‚ β”‚ Crunchbase β”‚ │◄────│ β”‚ Orders, Reports, β”‚ β”‚ β”‚ β”‚ IBISWorld β”‚ β”‚ β”‚ β”‚ Research Cache, β”‚ β”‚ β”‚ β”‚ News API β”‚ β”‚ β”‚ β”‚ Customer Outreach β”‚ β”‚ β”‚ β”‚ PitchDeck (PDF)β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ Cloudflare R2 β”‚ β”‚ β”‚ β”‚ Pitch decks, PDFs β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ AI RUNTIME β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Ollama (Mac Mini)β”‚ β”‚ β”‚ β”‚ Mistral 7B β”‚ β”‚ β”‚ β”‚ Research agent β”‚ β”‚ β”‚ β”‚ synthesis β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ MiniMax API β”‚ β”‚ β”‚ β”‚ (report polish)β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚

πŸ› οΈ Tech Stack

Frontend

ComponentTechnologyWhy
Dashboard + OrderSvelteKitWeb app: order form (upload pitch deck), report viewer (embedded PDF), order status tracking
PDF GenerationPuppeteer (server-side)Generate investor report as HTML β†’ PDF using a headless Chromium render. Deployed on Mac Mini or Deno Deploy.
PDF Viewerpdf.js (Mozilla)Embed PDF reports directly in browser. No download required.

Backend

ComponentTechnologyWhy
RuntimeDeno 2Runs on Mac Mini. TypeScript-first, clean permission model for running agents.
PDF GenerationPuppeteer + ChromiumHeadless browser renders report HTML at high quality. LaTeX-style report formatting possible.
QueueUpstash QStashReport generation jobs queued async. Customer calls scheduled. Email triggers.
PaymentsStripeCheckout session per order. Deep Dive tier includes customer outreach.
File StorageCloudflare R2Store pitch decks (uploaded by investors) and generated PDF reports.

Data Sources

SourceWhat It ProvidesAccess
LinkedIn APIFounder profiles, employment history, connectionsRestricted. Use PhantomBuster or Airtable social scraping as fallback.
CrunchbaseFunding history, investor list, company milestonesBasic free tier. Airtable LinkedIn data enrichment.
IBISWorldIndustry reports, market size, growth ratesSubscription. Use Statista free tier as alternative.
Google NewsCompany and founder news mentionsGoogle News API or RSS.
G2 / CapterraCompetitor reviews, pricing, market share signalsPublic scraping.
Hunter.ioFind verified email addresses for customer outreachAPI access.
Apollo.ioContact data + enrichment for customer outreachSubscription.

AI Stack

πŸ€– AI Philosophy: Research Agent on Mac Mini, Polish in Cloud
  • Research synthesis: Ollama Mistral 7B on Mac Mini β€” good enough for pulling data together and drafting findings
  • Customer call analysis: Ollama Whisper (if available) for transcription, Mistral for synthesis
  • Report writing quality: MiniMax M2.1 API β€” final polished prose for investor-facing document
  • Financial sanity check: Local Python scripts + Ollama for scenario modeling

πŸ—„οΈ Data Model

deals
iduuidPrimary key
company_namevarchar(255)
founder_namesvarchar[]
industryvarchar(100)
stageenum('pre-seed','seed','Series A')
pitch_deck_urlvarchar(500)R2 URL to uploaded deck
requested_byuuid (FK, users)Investor who ordered
tierenum('standard','deep-dive')
statusenum('ordered','in_progress','customer_outreach','report_pending','delivered')
ordered_attimestamp
delivered_attimestamp
stripe_payment_idvarchar(255)
research_reports
iduuidPrimary key
deal_iduuid (FK)
founder_report_mdtextFounder background check
market_report_mdtextMarket size analysis
competitive_report_mdtextCompetitive landscape
financial_review_mdtextProjection sanity check
customer_calls_mdtextCustomer interview synthesis (deep-dive only)
executive_summary_mdtext1-page overview
red_flags_mdtextKey concerns
pdf_urlvarchar(500)R2 URL to final PDF
confidence_scoreinteger (0–100)Research completeness confidence
customer_outreaches
iduuidPrimary key
deal_iduuid (FK)
customer_namevarchar(255)
customer_titlevarchar(255)
customer_companyvarchar(255)
outreach_email_sentboolean
agreed_to_callboolean
call_notestext
call_recording_urlvarchar(500)
synthesistextAI-synthesized pattern analysis
users (investors)
iduuid
emailvarchar(255)
namevarchar(255)
stripe_customer_idvarchar(255)
monitoring_activebooleanFor portfolio monitor subscribers

πŸ”Œ API Design

Orders

POST /api/orders
Create new deal research order. Body: {company_name, founder_names[], industry, stage, tier, pitch_deck_base64?}. Creates Stripe checkout session. Returns order ID.
GET /api/orders/:id
Get order status and details.
GET /api/orders/:id/report
Get generated report (PDF URL + section previews).

Research (Internal)

POST /internal/research/deal/:id
Trigger full research pipeline for a deal. Async via QStash. Returns job ID.
GET /internal/research/deal/:id/status
Check research pipeline status per section.
POST /internal/outreach/start/:dealId
Start customer outreach for deep-dive orders. Triggers email sequence to 5 customers.

Portfolio Monitoring

GET /api/portfolio
List monitored companies for subscriber.
POST /api/portfolio/company
Add company to portfolio monitoring.
GET /api/portfolio/:companyId/alerts
Get recent news alerts and signals for a monitored company.

πŸ€– Research Agent Pipeline

Step 1: Founder Background Check
Agent takes founder names β†’ searches LinkedIn (via PhantomBuster/Airtable), Crunchbase, Twitter/X, Google News. Compiles: employment timeline, education, funding history, news mentions. Identifies red flags: timeline gaps, credential discrepancies, negative news. Drafts 1-page founder bio. Runs on Ollama Mistral 7B on Mac Mini.
Step 2: Market Size Analysis
Agent queries IBISWorld/Statista for industry data. Builds TAM/SAM/SOM model. Calculates 3-year projections using CAGR from public comps. MiniMax API for final narrative polish.
Step 3: Competitive Landscape
Agent searches G2, Capterra, LinkedIn for direct/indirect competitors. Maps positioning matrix. Extracts pricing from public sources. MiniMax API for competitive narrative.
Step 4: Customer Interview Synthesis (Deep-Dive)
For each of 5 customers: agent sends outreach email via Hunter.io β†’ schedules call β†’ takes notes (manual or transcribed via Whisper) β†’ Ollama synthesizes patterns across all 5 calls. Highlights: what users love, what they wish was different, why they chose this over alternatives.
Step 5: Financial Projection Sanity Check
Agent parses pitch deck numbers (or uploaded financial model). Benchmarks against public SaaS comparables at similar stage (from MicroCapCampbell, OpenView reports). Generates 3 scenarios: bear/base/bull. Identifies top 3 most aggressive assumptions.
Step 6: Report Assembly + PDF
All sections compiled into report HTML template. Puppeteer renders HTML β†’ PDF. Uploaded to R2. Link shared with investor via email. MiniMax API writes executive summary and red flags sections.

πŸš€ Deployment

ComponentWhereNotes
Dashboard (SvelteKit)Cloudflare Pages (free)Auto-deploys from Git
Backend API (Deno)Mac Mini (local) or Deno DeployRuns research pipeline. Mac Mini is always-on server.
PDF GenerationMac Mini + PuppeteerHeadless Chromium. Can run on same Mac Mini.
DatabaseSupabase (free tier: 500MB)Sufficient for <100 active reports.
File StorageCloudflare R2 (free tier)Pitch decks + PDF reports.
AI (local)Mac Mini Ollama (Mistral 7B)Research synthesis. Free.
AI (cloud)MiniMax APIReport polish. Pay per report ~$0.10.

← Requirements  |  All Projects  |  Presentation β†’