Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e4259cd
feat(api-v2): add GET /v2/slots/all-of-day to aggregate daily slots
OlivierGuntenaar Oct 1, 2025
324d839
Merge pull request #1 from OlivierGuntenaar/main
Tguntenaar Oct 1, 2025
79a5adf
first test of docker compose for apiv2
Tguntenaar Oct 7, 2025
935c70f
fix setup script from amazon linux
Tguntenaar Oct 7, 2025
2bd526e
added docker compose to setup script
Tguntenaar Oct 7, 2025
31742c0
fix the .env.example
Tguntenaar Oct 7, 2025
4f25f2a
expose database on port 5432
Tguntenaar Oct 8, 2025
f49315f
Retry with version attribute
Tguntenaar Oct 9, 2025
afa0b3f
prebuilt image
Tguntenaar Oct 9, 2025
0d0df18
change the api port to 80
Tguntenaar Oct 9, 2025
117b86b
updated seed file to only add a platform user
Tguntenaar Oct 13, 2025
9c2d7f9
fix the port api v2
Tguntenaar Oct 15, 2025
09d073f
update environment configuration: add VAPID_PUBLIC_KEY to .env.exampl…
Tguntenaar Oct 24, 2025
d4b598c
added docs
Tguntenaar Oct 24, 2025
685f649
added docs
Tguntenaar Oct 24, 2025
8dc57d0
Add endpoint to fetch available slots for specific users on a given day
Tguntenaar Oct 24, 2025
b48d765
revert web app url
Tguntenaar Oct 24, 2025
87be5aa
revert scripts
Tguntenaar Oct 24, 2025
bf9f0d2
Update Docker image reference for API v2 in production configuration
Tguntenaar Oct 24, 2025
f7597db
add docs
Tguntenaar Oct 24, 2025
b5d5e57
update docs
Tguntenaar Oct 24, 2025
f6bb47b
updated docker compose
Tguntenaar Oct 28, 2025
5442ad1
update docs
Tguntenaar Oct 28, 2025
5fce0a0
update docker compose
Tguntenaar Oct 28, 2025
6d9476a
update docker compose
Tguntenaar Oct 28, 2025
838edb5
updated docker compose required env variables
Tguntenaar Oct 29, 2025
6af2a96
updated docker compose prod
Tguntenaar Oct 29, 2025
9723dac
update docker-compose
Tguntenaar Oct 29, 2025
2fd2563
remove event location
Tguntenaar Oct 29, 2025
be16352
godverdomme kut
Tguntenaar Oct 29, 2025
f3a33e4
geen ene kut verfiiene
Tguntenaar Oct 29, 2025
5de4433
add daily api key
Tguntenaar Oct 29, 2025
49436be
revert location stuff
Tguntenaar Oct 29, 2025
2370760
seed the daily app kut
Tguntenaar Oct 29, 2025
28f1792
update redis config
Tguntenaar Oct 30, 2025
1ddcf2d
update turbo config to include redis
Tguntenaar Nov 6, 2025
8edbb90
add migration script - remove unused endpoint all-of-day
Tguntenaar Jan 18, 2026
7c2e564
update doc
Tguntenaar Jan 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
coverage
build
dist
node_modules
*.log
.git
.agents
.husky
.snaplet
.turbo


# Test results and artifacts
test-results/
**/playwright/videos
**/playwright/screenshots
**/playwright/artifacts
**/playwright/results
**/playwright/reports

# Checks and testing infrastructure
__checks__/
tests/performance/
playwright/

docs/
*.md

# IDE and editor files
.vscode/
.idea/
.history/
*.code-workspace
.DS_Store
.claude

# CI/CD and deployment configs
.github/
.changeset/
checkly.config.ts
.vercel/
vercel.json
Procfile

# Build artifacts
.next/
out/
*.tsbuildinfo
lint-results/

# Yarn cache and non-essential yarn files
.yarn/cache/
.yarn/install-state.gz
.pnp.*

# Example and development apps
example-apps/
apps/ui-playground/
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ BLACKLISTED_GUEST_EMAILS=
# Used to allow browser push notifications
# You can use: 'npx web-push generate-vapid-keys' to generate these keys
NEXT_PUBLIC_VAPID_PUBLIC_KEY=
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=

# Mintlify chat api
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,4 @@ packages/**/.yarn/ci-cache/

# AI
.claude
.env\ prod
3 changes: 2 additions & 1 deletion apps/api/v2/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/node_modules
**/dist
**/dist
.env*
10 changes: 8 additions & 2 deletions apps/api/v2/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NODE_ENV=
NODE_ENV=production
API_PORT=
API_URL=
DATABASE_READ_URL=
Expand Down Expand Up @@ -41,4 +41,10 @@ LOGGER_BRIDGE_LOG_LEVEL="1"

# 1: Rewrite /api/v2 to /v2
# 0: Don't rewrite
REWRITE_API_V2_PREFIX="1"
REWRITE_API_V2_PREFIX="1"

API_URL=https://api.collegecontactcalendar.com

REDIS_URL=
REDIS_PASSWORD=
REDIS_TSL=true
104 changes: 104 additions & 0 deletions apps/api/v2/docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
version: '3.8'

# Local Development Docker Compose
# Simpler setup for testing on your Mac/local machine

services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: calcom-api-v2-postgres-local
restart: unless-stopped
environment:
POSTGRES_USER: calcom
POSTGRES_PASSWORD: calcom_local_password
POSTGRES_DB: calcom
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432" # Exposed for local debugging
healthcheck:
test: ["CMD-SHELL", "pg_isready -U calcom"]
interval: 10s
timeout: 5s
retries: 5
networks:
- calcom-network

# Redis Cache & Queue
redis:
image: redis:7-alpine
container_name: calcom-api-v2-redis-local
restart: unless-stopped
command: redis-server --appendonly yes --requirepass redis_local_password
volumes:
- redis_data:/data
ports:
- "6379:6379" # Exposed for local debugging
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- calcom-network

# Cal.com API v2
api-v2:
build:
context: ../../..
dockerfile: apps/api/v2/Dockerfile
args:
DATABASE_URL: postgresql://calcom:calcom_local_password@postgres:5432/calcom
DATABASE_DIRECT_URL: postgresql://calcom:calcom_local_password@postgres:5432/calcom
container_name: calcom-api-v2-local
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
NODE_ENV: production
API_PORT: 80

# Database
DATABASE_URL: postgresql://calcom:calcom_local_password@postgres:5432/calcom
DATABASE_DIRECT_URL: postgresql://calcom:calcom_local_password@postgres:5432/calcom
DATABASE_READ_URL: postgresql://calcom:calcom_local_password@postgres:5432/calcom
DATABASE_WRITE_URL: postgresql://calcom:calcom_local_password@postgres:5432/calcom

# Redis
REDIS_URL: redis://:redis_local_password@redis:6379

# Auth
NEXTAUTH_SECRET: local_testing_secret_change_in_production_12345

# API Configuration
API_URL: http://localhost
API_KEY_PREFIX: cal_

# Web App URL
WEB_APP_URL: http://localhost:3000

ports:
- "5555:80" # Direct access to API
networks:
- calcom-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s

volumes:
postgres_data:
driver: local
redis_data:
driver: local

networks:
calcom-network:
driver: bridge

163 changes: 163 additions & 0 deletions apps/api/v2/docker-compose.production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
version: '3.8'

services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: calcom-api-v2-postgres
restart: unless-stopped
environment:
POSTGRES_USER: calcom
POSTGRES_PASSWORD: ${DB_PASSWORD:-calcom_secure_password_change_me}
POSTGRES_DB: calcom
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "0.0.0.0:5432:5432" # Exposed on all interfaces, controlled by Security Group
healthcheck:
test: ["CMD-SHELL", "pg_isready -U calcom"]
interval: 10s
timeout: 5s
retries: 5
networks:
- calcom-network

# Redis Cache & Queue
redis:
image: redis:7-alpine
container_name: calcom-api-v2-redis
restart: unless-stopped
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-redis_secure_password_change_me}
volumes:
- redis_data:/data
ports:
- "127.0.0.1:6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD:-redis_secure_password_change_me}", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- calcom-network

# Cal.com API v2
api-v2:
image: 194266086878.dkr.ecr.us-east-2.amazonaws.com/collegecontact/calcom-api-v2:latest
# build:
# context: ../../.. # Build from repo root to include monorepo
# dockerfile: apps/api/v2/Dockerfile
# args:
# DATABASE_URL: postgresql://calcom:${DB_PASSWORD:-calcom_secure_password_change_me}@postgres:5432/calcom
# DATABASE_DIRECT_URL: postgresql://calcom:${DB_PASSWORD:-calcom_secure_password_change_me}@postgres:5432/calcom
container_name: calcom-api-v2
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
NODE_ENV: production
API_PORT: 80

# Database
DATABASE_URL: postgresql://calcom:${DB_PASSWORD:-calcom_secure_password_change_me}@postgres:5432/calcom
DATABASE_DIRECT_URL: postgresql://calcom:${DB_PASSWORD:-calcom_secure_password_change_me}@postgres:5432/calcom
DATABASE_READ_URL: postgresql://calcom:${DB_PASSWORD:-calcom_secure_password_change_me}@postgres:5432/calcom
DATABASE_WRITE_URL: postgresql://calcom:${DB_PASSWORD:-calcom_secure_password_change_me}@postgres:5432/calcom

# Redis
REDIS_URL: redis://:${REDIS_PASSWORD:-redis_secure_password_change_me}@redis:6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-redis_secure_password_change_me}
REDIS_TLS: ${REDIS_TLS:-false}

# Auth
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-generate_a_secure_random_32_char_string}
JWT_SECRET: ${JWT_SECRET:-${NEXTAUTH_SECRET}}

# API Configuration
API_URL: ${API_URL:-https://api.collegecontactcalendar.com}
API_KEY_PREFIX: ${API_KEY_PREFIX:-cal_}

# License (optional for self-hosted)
CALCOM_LICENSE_KEY: ${CALCOM_LICENSE_KEY:-}

# Web App URL
WEB_APP_URL: ${WEB_APP_URL:-https://api.collegecontactcalendar.com}
NEXT_PUBLIC_WEBAPP_URL: ${NEXT_PUBLIC_WEBAPP_URL:-https://api.collegecontactcalendar.com}

LOG_LEVEL: ${LOG_LEVEL:-info}

# RESEND
EMAIL_FROM: ${EMAIL_FROM}
EMAIL_SERVER_HOST: ${EMAIL_SERVER_HOST}
EMAIL_SERVER_PORT: ${EMAIL_SERVER_PORT}
EMAIL_SERVER_USER: ${EMAIL_SERVER_USER}
EMAIL_SERVER_PASSWORD: ${EMAIL_SERVER_PASSWORD}
# Will override smtp server settings
RESEND_API_KEY: ${RESEND_API_KEY:-}

# Stripe (optional)
STRIPE_API_KEY: ${STRIPE_API_KEY:-}
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET:-}

# Sentry (optional)
NEXT_PUBLIC_SENTRY_DSN: ${NEXT_PUBLIC_SENTRY_DSN:-}
SENTRY_DSN: ${SENTRY_DSN}
SENTRY_TRACES_SAMPLE_RATE: ${SENTRY_TRACES_SAMPLE_RATE:-1.0}
SENTRY_PROFILES_SAMPLE_RATE: ${SENTRY_PROFILES_SAMPLE_RATE:-1.0}

# Web Push VAPID Keys (required)
NEXT_PUBLIC_VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY:-}
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY:-}

# Logging
AXIOM_TOKEN: ${AXIOM_TOKEN}
AXIOM_DATASET: ${AXIOM_DATASET}

DAILY_API_KEY: ${DAILY_API_KEY}
DAILY_SCALE_PLAN: ${DAILY_SCALE_PLAN:-false}

ports:
- "127.0.0.1:5555:80"
networks:
- calcom-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s

# Nginx Reverse Proxy (Cloudflare handles SSL)
nginx:
image: nginx:alpine
container_name: calcom-api-v2-nginx
restart: unless-stopped
depends_on:
- api-v2
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
networks:
- calcom-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3

# Note: No Certbot needed - Cloudflare handles SSL/TLS termination

volumes:
postgres_data:
driver: local
redis_data:
driver: local

networks:
calcom-network:
driver: bridge

Loading
Loading