calcom/cal.com architecture diagram
How calcom/cal.com is built, drawn from its code at 2eb48ec on 2026-11-08 by Plotix's agent.
Components
How the apps and packages of Cal.diy talk to each other and to outside systems.
Open the picture for full size (SVG).
Parts
- Booker
- Host
- Web app
Pages and routes · Booking and event views - API proxy
/ goes to API v1 on :3003 · /v2 goes to API v2 on :3004 - API v2
Controllers per module - tRPC routers
Viewer router for the web app - Booking domain logic
Bookings and slots · Round-robin hosts · No-show handling - App store
Calendar, video and payment apps - Emails
Booking and reminder templates - Shared UI
Buttons, forms, tables - Prisma data layer
schema.prisma: all models · Generated client and zod types - PostgreSQL
Users and event types · Bookings and credentials - Calendar providers
- Email and video providers
How they connect
- Booker → Web app Books a slot
- Host → Web app Manages event types
- Web app → tRPC routers tRPC queries
- Web app → Shared UI
- API proxy → API v2 Routes /v2 traffic
- API v2 → Booking domain logic Runs booking logic
- tRPC routers → Booking domain logic Runs booking logic
- Booking domain logic → Prisma data layer Queries models
- Prisma data layer → PostgreSQL
- Booking domain logic → App store Syncs calendars and video
- App store → Calendar providers Creates and updates events
- Booking domain logic → Emails Sends notification emails
- Emails → Email and video providers Sends through provider
Data model
The core scheduling tables: users, teams, event types, hosts, bookings and credentials.
Open the picture for full size (SVG).
Parts
- User
id: Int PK · email: String UQ · username: String? · timeZone: String - Team
id: Int PK · name: String · slug: String · isOrganization: Boolean - Profile
userId: Int FK · organizationId: Int FK · username: String - Event type
id: Int PK · title: String · slug: String · length: Int (minutes) - Host
userId: Int FK · eventTypeId: Int FK · isFixed: Boolean · priority, weight: Int? - Booking
id: Int PK · uid: String UQ · startTime, endTime: DateTime · status: String - Credential
userId: Int FK · teamId: Int FK · appId: String FK · invalid: Boolean - Schedule
userId: Int FK · name: String · timeZone: String - Destination calendar
integration: String · externalId: String · userId or eventTypeId: Int FK
How they connect
- User → Profile has profiles
- Team → Profile has members
- User → Event type owns
- Team → Event type owns
- User → Host is host in
- Event type → Host has hosts
- Event type → Booking receives
- User → Booking hosts
- User → Credential connects
- Team → Credential connects
- User → Schedule defines
- User → Destination calendar writes to
Booking flow
What happens from the moment a booker picks a slot to the confirmed booking.
Open the picture for full size (SVG).
Parts
- Booker opens a slot
- Load free slots
Reads availability and bookings · Applies booking limits - Slot still free?
- Show slot taken
- Pick host
Round-robin or collective · Weights and priority - Create booking
Writes booking row · Writes attendee and references - Needs host confirmation?
- Mark pending and email host
- Awaiting host approval
- Sync calendars and video
Creates calendar event · Creates meeting link - Send emails and webhooks
- Booking confirmed
How they connect
- Booker opens a slot → Load free slots
- Load free slots → Slot still free?
- Slot still free? → Show slot taken no
- Slot still free? → Pick host yes
- Pick host → Create booking
- Create booking → Needs host confirmation?
- Needs host confirmation? → Mark pending and email host yes
- Mark pending and email host → Awaiting host approval
- Needs host confirmation? → Sync calendars and video no
- Sync calendars and video → Send emails and webhooks
- Send emails and webhooks → Booking confirmed
Draw your own repo
Plotix's agent reads your code and draws its architecture, and the diagram warns you when the code moves on.
Try Plotix