Brisket
Brisket
Responsibility
Brisket is the Next.js user-facing frontend. It owns app routes, feature UI, tRPC integration, product and billing UI, and browser-side user workflows.
Runtime
Brisket runs on Next.js with Turbopack. It uses Clerk middleware and auth() at the frontend edge.
Primary Source Paths
- apps/brisket/src/app/
- apps/brisket/src/features/
- apps/brisket/src/components/
- apps/brisket/src/server/
- apps/brisket/pkg/
Browser Analytics And Tracking
Third-party browser trackers mount from the App Router root layout in apps/brisket/src/app/layout.tsx, and their components live under apps/brisket/src/features/analytics/.
- Google Tag Manager loads through a Stape container and renders only when BRISKET_STAGE is production.
- PostHog wraps the tree for product analytics on every stage, with autocapture off when NEXT_PUBLIC_DEV_FEATURES is true.
- Klaviyo identifies signed-in users and reports the signup event. It needs NEXT_PUBLIC_KLAVIYO_PUBLIC_KEY and stays off in development unless NEXT_PUBLIC_FORCE_DEV_KLAVIYO is true.
- FirstPromoter attributes referral clicks and signups, production only. apps/brisket/public/fprmain.js installs the call queue and issues the click call, and the CDN script drains that queue. The referral tracker sends the Clerk user id rather than the email address, and marks the signup only once FirstPromoter confirms the submission, so a blocked script is retried on the next visit that still falls inside the one-hour post-signup window. Deduplication is per browser profile, through a
localStoragemarker, not per account.
Referral links carry two unrelated mechanisms. FirstPromoter owns affiliate attribution, while a ref query parameter is stored in the browser and redeemed against sirloin as an internal referral code.
Contracts And Generated References
Brisket uses generated proto packages under apps/brisket/pkg/. Billing and product UI consume sirloin billing product APIs.
Related Flows
Related Standards
Related Decisions
Frontend-affecting ADRs live under docs/src/content/docs/decisions/.
Operations
Build and runtime environment validation is handled by the app-local package scripts and env schema.
Local Commands
- cd apps/brisket && pnpm lint
- cd apps/brisket && pnpm typecheck
- cd apps/brisket && pnpm test
- cd apps/brisket && pnpm check