Lightweight analytics for Cal.com workspaces. Callytics gives teams instant visibility into meetings, event types, and booking trends without maintaining a bespoke reporting stack. π
- OAuth 2.0 flow for Cal.com accounts with stateful callback handling π
- Postgres-backed waitlist capture powered by Prisma Accelerate π¨
- Interactive landing hero styled to mirror Cal.com's product aesthetic and OAuth CTA β‘οΈ
- Analytics dashboard refreshed with the Cal.com palette, motion charts, and dark-mode friendly glows π
- Turbopack-enabled Next.js 16 app router with Tailwind CSS v4 styling β‘οΈ
- Next.js 16 (App Router, React 19, Turbopack)
- Tailwind CSS v4 with custom design tokens
- Prisma ORM + Accelerate extension targeting PostgreSQL
- Vercel Analytics snippet for production telemetry π
- Node.js 18.18 or newer (Next.js 16 requirement)
- pnpm 8.x or newer
- PostgreSQL database for the waitlist table π
- Cal.com OAuth client credentials for the token exchange flow π
- Install dependencies:
pnpm install - Duplicate
.env.example(or create.env.local) and set the required variables listed below - Run database migrations:
pnpm prisma migrate dev - Start the dev server:
pnpm devand visit http://localhost:3000 π―
The preinstall script runs prisma generate so the generated client is always in sync. Turbopack handles hot reloading during development.
| Variable | Required | Description | Default |
|---|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string used by Prisma | β |
CAL_OAUTH_CLIENT_ID |
Yes | OAuth client ID from your Cal.com developer app | β |
CAL_OAUTH_CLIENT_SECRET |
Yes | OAuth client secret from Cal.com | β |
CAL_OAUTH_REDIRECT_URI |
Optional | Explicit redirect URI to override the auto-detected callback | http://localhost:3000/api/cal/oauth/callback |
CAL_OAUTH_TOKEN_ENDPOINT |
Optional | Alternate Cal.com token endpoint (sandbox/self-hosted) | https://api.cal.com/v2/oauth/token |
Optional variables only need to be set when you diverge from the default local flow.
- Register a Confidential OAuth App inside the Cal.com developer portal.
- Configure the redirect URI to
http://localhost:3000/api/cal/oauth/callback(or your deployed domain). - Copy the client ID and secret into your
.env.local. - During the auth redirect the callback verifies the
statecookie and exchanges the code for access/refresh tokens atCAL_OAUTH_TOKEN_ENDPOINT. Tokens are returned to the caller and should be persisted securely (e.g., server-side store).
Callytics automatically refreshes expired Cal.com access tokens:
- When server actions request an access token, the system checks if it's expired or within 5 minutes of expiry
- If expired, it automatically calls Cal.com's refresh token endpoint (
POST https://app.cal.com/api/auth/oauth/refreshToken) - The database is updated with new tokens transparently
- No manual intervention required - your API calls just work!
The refresh logic is implemented in lib/auth/refresh-token.ts and integrated into server actions via getValidAccessToken(userId).
- Prisma schema lives in
prisma/schema.prismaand generates the client underapp/generated/prisma. - Migrations are stored in
prisma/migrations. Apply them withpnpm prisma migrate devfor local development orpnpm prisma migrate deployin CI/CD. - The waitlist module writes to the
waitlist_entriestable vialib/dal/waitlist.ts.
pnpm devβ start the Next.js dev server with Turbopackpnpm buildβ run Prisma migrations (viaprebuild) then build for productionpnpm startβ serve the production buildpnpm lintβ execute the repository ESLint configurationpnpm prisma <command>β forward arbitrary Prisma CLI commands (generate, migrate, studio, etc.)
app/β Next.js route handlers, layouts, API routes, and generated Prisma clientmodules/β UI modulescomponents/β shared UI primitives (buttons, cards, theming controls)lib/β Prisma client factory, waitlist data access layer, and schemasprisma/β schema and migrations for the Postgres database.agent/β onboarding docs, Cal.com OpenAPI excerpt, and shared conventions
- Optimized for Vercel; environment variables must be defined in the project settings
- Ensure your production database and Cal.com OAuth redirect URIs match the deployed domain
- Replace or configure
@vercel/analyticsif you use a different analytics provider
- Cal.com OAuth 2.0 Docs
- Next.js App Router Docs
- Prisma Documentation
- AGENTS.md β living brief for contributor onboarding

