Skip to main content

Architecture

info

This page covers the architecture of the Cal.com scheduling stack including component roles, data flow, and external integrations.

Meeting scheduling series

  1. Meeting scheduling
  2. Architecture - You are here
  3. Manifests
  4. Flux integration
  5. Operations

Overview

The stack provides a complete scheduling solution with calendar integration, video conferencing, and email notifications.

Components

Cal.com

Cal.com is the scheduling engine that handles booking pages, availability management, and integrations.

AspectConfiguration
Imagecalcom/cal.com:v6.1.3
Port3000
DatabasePostgreSQL via Prisma ORM
MigrationsInit container on startup

PostgreSQL

PostgreSQL stores all Cal.com data including users, bookings, and configuration.

AspectConfiguration
Imagepostgres:16.4-alpine
Port5432
StorageNFS-backed PVC
Security contextfsGroup: 999

Cloudflare Tunnel

Cloudflare Tunnel provides secure ingress without exposing ports to the internet.

AspectConfiguration
Hostnamecal.example.com
Servicehttps://ingress-nginx-controller.ingress-nginx.svc.cluster.local:443
Origin CACluster-issued certificate

External integrations

Cal.com connects to external services for calendar sync, video meetings, and email.

Google Calendar

AspectDetails
PurposeRead availability, create events
AuthOAuth 2.0 with refresh tokens
Scopescalendar.events, calendar.readonly
Callbackhttps://cal.example.com/api/integrations/googlecalendar/callback

Zoom

AspectDetails
PurposeAuto-generate meeting links
AuthOAuth 2.0
Scopesmeeting:write
Callbackhttps://cal.example.com/api/integrations/zoomvideo/callback

Email via shared email-relay

AspectDetails
PurposeConfirmation and reminder emails
Namespaceemail-relay (shared infrastructure)
Componentsmx-validator → Mailpit → smtp2graph
MX validationRejects emails to domains without MX records
AuthMicrosoft Graph API OAuth (modern authentication)
WhyMicrosoft Security Defaults blocks SMTP AUTH (legacy)

The email-relay is shared infrastructure used by multiple applications. See Email relay for deployment details.

Data flow

Booking flow

OAuth callback flow

OAuth integrations require the public URL to be reachable before configuration.

This creates a two-phase deployment requirement:

  1. Deploy Cal.com first (get domain live)
  2. Configure OAuth redirect URLs after domain is reachable

Access methods

URLPurposeRoute
https://cal.example.comPublic bookingsCloudflare Tunnel → ingress → ClusterIP
http://cal.example.local:3000Internal adminLoadBalancer service (LAN only)

OAuth callbacks always redirect to the public URL. The internal URL is for admin tasks and bypasses Cloudflare WAF rules.

Resource requirements

ComponentMemoryStorageReplicas
Cal.com~512MB-1
PostgreSQL~256MB5Gi1

Total estimates:

  • Memory: ~768MB
  • Storage: ~5Gi

Namespace layout

The namespace contains Cal.com resources with dependencies on:

  • ingress-nginx namespace for ingress controller
  • email-relay namespace for email delivery

Spam protection

Cal.com is protected by multiple layers that prevent spam bookings and unauthorized access.

Protection layers

LayerProtectionBlocks
Cloudflare WAFBlock /signup, /auth pathsUnauthorized account creation
Cloudflare IP RulesAdmin path allowlistUnauthorized admin access
MX ValidatorDNS MX record lookupFake email domains
Email VerificationRequires email round-tripUnverified bookers

How MX validation works

When Cal.com sends a confirmation email:

  1. Email goes to email-relay.email-relay.svc.cluster.local:25
  2. mx-validator extracts the recipient domain
  3. DNS lookup checks for MX records
  4. If no MX records exist, email is rejected with 550 error
  5. Cal.com receives the rejection, blocking the booking confirmation

Combined with Cal.com's "Requires booker email verification" setting, this prevents bookings from fake or non-existent email addresses. See Operations for configuration details.