HOW CAL.COM
ACTUALLY WORKS
Open-source scheduling infrastructure. Conventions, patterns, and architecture extracted from the calcom/cal.com repository by sourcebook.
WHAT_MATTERS
-
→
This is a monorepo — check workspace dependencies before modifying shared code
-
→
Generated files detected — editing them directly will break builds
-
→
packages/trpc/server/types.ts is a hub file (imported by 172 files) — changes here ripple everywhere
-
→
Circular import chains detected — avoid adding to these cycles
KEY_FINDINGS
This is a monorepo. Changes may affect multiple packages. Check workspace dependencies before modifying shared code.
HIGHTests are co-located with source files (*.test.ts next to *.ts). Keep this pattern -- don't create a separate test/ directory.
HIGHProject uses barrel exports (index.ts files that re-export). Import from the directory, not from deep paths.
HIGH40 barrel export files found
Environment variables are documented in .env.example. Copy it to .env.local before running the project.
HIGHProject strongly prefers named exports over default exports. Use `export function` / `export const`, not `export default`.
HIGH26 named vs 2 default exports in sampled files
Use Zod schemas for validation. This is the project's standard validation approach.
HIGH7 files use Zod
Tests use Vitest. Test utilities in: packages/testing/src/lib/fixtures/fixtures.ts.
HIGH12 test files
Styling uses Tailwind CSS utility classes.
HIGH12 files
Database access uses Prisma. Schema/models defined in packages/prisma/schema.prisma.
HIGH19 files
Generated files detected (vitest-mocks/tailwind.generated.css, packages/app-store/video.adapters.generated.ts, packages/app-store/redirect-apps.generated.ts, packages/app-store/payment.services.generated.ts, packages/app-store/crm.apps.generated.ts, ...). Do NOT edit these directly — modify the source/schema they are generated from.
HIGH14 generated files
Route definitions live in: packages/trpc/server/routers, packages/trpc/server/routers/viewer/workflows, packages/trpc/server/routers/viewer/webhook. Add new endpoints here.
HIGH3 route directories
Third-party integrations live under packages/app-store/ (zoomvideo, zohocrm, zohocalendar, zoho-bigin, zapier, wordpress, ...). Each integration has its own directory with components, lib, and API code.
HIGH107 integrations found
Hub files (most depended on): packages/trpc/server/types.ts (imported by 172 files); packages/platform/atoms/lib/http.ts (imported by 72 files); packages/features/di/di.ts (imported by 60 files); packages/app-store/_utils/getAppKeysFromSlug.ts (imported by 53 files); packages/emails/src/renderEmail.ts (imported by 51 files). Changes here have the widest blast radius.
HIGHCircular import chains detected: bookingScenario.ts → getMockRequestDataForBooking.ts; create-event-type.input.ts → CantHaveRecurrenceAndBookerActiveBookingsLimit.ts; handleMarkNoShow.ts → handleSendingAttendeeNoShowDataToApps.ts. Avoid adding to these cycles.
HIGH+ 3 MORE FINDINGS (MEDIUM CONFIDENCE)
4 env vars detected. Public (browser-exposed): NEXT_PUBLIC_WEBAPP_URL. Private (server-only): CI, PLAYWRIGHT_HEADLESS, PWDEBUG.
MEDData fetching uses React Query (useQuery/useMutation). Follow this pattern for new data operations.
MED6 files
UI components live in: packages/ui, packages/ui/components, packages/trpc/components. Add new components here.
MED3 component directories