Appearance
Stack
What is used
| Layer | Choice | Notes |
|---|---|---|
| Monorepo | Better-T-Stack scaffold, Bun, Nx | apps/native is removed from task pipelines while on hold. |
| Web app | TanStack Start (apps/web) + TanStack Router | One app, role-based spaces. Public pages (form, quote, contract, set-password) live in the same app under /p/*. |
| API | Hono + oRPC (apps/server, logic in packages/api) | All access checks live in packages/api, never only in the UI. |
| Database | Cloudflare D1 + Drizzle (packages/db) | Migrations are append-only. |
| Auth | Better Auth (packages/auth) | Plugins: username (client logins), organization (client business + sub-accounts), two-factor (TOTP), admin (owner manages users). |
| Payments | Stripe (Checkout Sessions over REST, plus a signed webhook for paid events) | The manual "record payment" fallback runs the same path. See ADR 0010. |
| Files | Cloudflare R2 (multipart uploads, short-lived signed download links) | Footage and edits are large; never store them in D1. Provisioned through Alchemy. |
| Background work | Cloudflare Queues for jobs, Cron Triggers for scheduled sweeps (or Cloudflare Workflows for multi-step jobs) | Every job idempotent: a retry changes nothing. |
| A transactional provider callable from Workers (Cloudflare Email Service) | Behind one sendEmail interface so it can be swapped. | |
| Infra | Alchemy (packages/infra/alchemy.run.ts) | R2 bucket, Queues and Cron Triggers live here. |
| Clipper AI | Workers AI (AI binding), or OpenAI-compatible transcription when OPENAI_API_KEY is set; a research LLM for scoring (Clipper) | Metered per user. Rendering and video stay on the user's machine. |
| Lint/format | Oxlint + Oxfmt | Unchanged. |
Workers constraints to design around
- Workers have CPU-time limits per request. Scraping/research and video processing must not run inside a request: enqueue a job, and if a job needs a long-running browser or heavy processing, call an external service from the job.
- Large uploads go browser → R2 directly via presigned multipart URLs; the Worker only signs and records. Presigning needs R2 S3-compatible credentials (an access key pair) as deployment secrets, added in milestone 7.
- Clipper AI calls are small, chunked requests: compressed audio, transcript text, candidate windows and, when the model accepts images, up to four still frames (384 px JPEG) per candidate, never video. Rendering runs on the user's machine (ADR 0011, ADR 0013).
UI: beUI replaces shadcn
beUI is a copy-the-source animated component set for React, built on Motion and Tailwind CSS, with 58 components, 24 blocks and 18 AI-agent components. Migration steps and the how-to are in UI and beUI.
beUI components that map directly onto this product: Button, Input, Select, Combobox, Multi Select, Checkbox, Radio Group, Switch, Tabs, Card, Table, Drawer, Bottom Sheet, Morphing Modal, Popover, Tooltip, Animated Toast Stack, Animated Sidebar, Timeline, Date Range Picker, Sortable List, File Tree, Animated Badge, Number Animation, Adaptive Stepper (multi-step public form), and the blocks File Upload, OTP Input (authenticator codes), Sign Up Form, Command Palette, Notification Stack, Availability Scheduler (crew availability), Swipeable List (mobile to-do lists), Feedback Widget, plus the AI Agents set's Todo List and Approval Card.
Built in-house
beUI has no full calendar or video-annotation player. Both are core to this product and must be built in-house (Global calendar, Production pipeline), styled with the same tokens.