claude-code-dashboard Data Flow

Anthropic APIs to S3 archive, Athena, Bedrock AI layer, and the 19-page React dashboard

claude-code-dashboard Data Flow Anthropic APIs to S3 archive, Athena, Bedrock AI layer, and the 19-page React dashboard 01 / Sources 02 / Ingest & AI 03 / Archive & Query 04 / Serve 05 / Present Analytics API · engagement + cost · 01 / Sources · 90-day window Analytics API engagement + cost 90-day window Compliance API · audit events · 01 / Sources · 35+ types Compliance API audit events 35+ types Spend Report CSV · manual upload · 01 / Sources · fallback Spend Report CSV manual upload fallback Lambda Collector · daily snapshot · 02 / Ingest & AI · EventBridge Lambda Collector daily snapshot EventBridge Amazon Bedrock · Claude Sonnet 4.6 · 02 / Ingest & AI · 5 chat tools Amazon Bedrock Claude Sonnet 4.6 5 chat tools S3 Archive · NDJSON partitions · 03 / Archive & Query · raw sidecar S3 Archive NDJSON partitions raw sidecar Glue + Athena · 6 tables x2 orgs · 03 / Archive & Query · SQL Glue + Athena 6 tables x2 orgs SQL SQL Sanitizer · SELECT-only · 03 / Archive & Query · allowlist SQL Sanitizer SELECT-only allowlist Express Proxy · ECS Fargate · 04 / Serve · S3-first Express Proxy ECS Fargate S3-first CloudFront + WAF · Cognito auth · 05 / Present · Lambda@Edge CloudFront + WAF Cognito auth Lambda@Edge React SPA · 19 pages · 05 / Present · KO / EN React SPA 19 pages KO / EN daily snapshot 14:00 UTC 5 endpoints audit walk 00:30 UTC cursor pages NDJSON + raw sidecar date partitions partition projection Glue catalog S3-first reads ~150ms range queries live calls on miss 60 rpm org budget spend CSV fallback period totals generated SQL tool use allowlisted SELECT 12 tables result rows archive SQL API JSON + SSE cache hints authenticated pages Cognito session Legend primary data policy / PII async batch data store data flow

Beyond the 90-Day Window

  • • A Node 20 Lambda snapshots Analytics and Compliance daily into S3 NDJSON partitions
  • • Raw record sidecars under raw/ keep unmapped API fields recoverable
  • • Glue partition projection exposes six tables per org to Athena

S3-First Serving

  • • Range queries hit the archive first; only missing dates go to the live API
  • • Responses carry s3_hits / live_calls hints for freshness diagnosis
  • • splitCostWindow() merges 31-day chunks into windows up to 186 days

AI Guardrails

  • • Bedrock Claude Sonnet 4.6 answers via ConverseStream with five chat tools
  • • User and LLM SQL pass the same SELECT-only, allowlist sanitizer
  • • Emails are masked in UI and LLM output as a data contract