Monorepo Layout
calmsharp/
├── apps/
│ ├── web/ (Main brand site & redirects)
│ └── friend/ (Ari AI companion SPA)
├── packages/
│ ├── design-tokens/ (Colors, typography, layout)
│ ├── shared/ (Domain models, prompts, i18n)
│ ├── security/ (Input validation, policy, killswitch)
│ └── evals/ (8 dimensions benchmark suite)
├── workers/
│ ├── site/ (Edge router for calmsharp.com, www, be, lab, evals, docs)
│ └── friend-api/ (D1 database, Workers AI streaming, session management)
└── migrations/ (D1 SQL migrations 0001_initial_schema.sql)
Cloudflare Architecture
Edge Runtime: Cloudflare Workers with Node.js compatibility.
Database: Cloudflare D1 (SQLite distributed edge database with WAL mode and cryptographic isolation).
AI Inference: Cloudflare Workers AI running @cf/meta/llama-3.1-8b-instruct via server-side streaming.
Zero Client Secret Exposure: API tokens and database keys are never shipped to client bundle.