# How to Vibe Code Your Own Clockwise (and Stop Paying for It)

> AI-powered calendar assistant to optimize schedules for focus time

- Site: https://getclockwise.com
- Category: Productivity & Scheduling SaaS
- Platforms: Web app
- Verdict: **Serious undertaking** (35/100 vibecodeable)
- Estimated effort: 3-5 weeks of focused engineering

## Verdict

Build a personal subset for managing your own calendar, but expect painful debugging around provider OAuth tokens and graph-solving logic.

Replicating the full enterprise horizontal scheduling machine is a serious undertaking due to the sheer brittleness of two-way calendar API syncs and the algorithmic complexity of constraint-based meeting shifting. For a personal-use clone, you can narrow the scope to a single Google Calendar integration that automatically injects focus blocks and provides basic scheduling links, but expect to spend significant time wrestling with Google API token refreshes, timezone offsets, and edge cases where participants manually override moved events.

### What you can't replicate

- Enterprise trust, brand recognition, and SOC 2 compliance certifications
- Massive multi-tenant organizational scheduling data and team network effects
- Dedicated continuous support and direct integrations with corporate IT directory sync (SCIM/SSO)

## What it does

An intelligent calendar assistant that automatically schedules focus time, manages flexible meetings, and coordinates shared schedules across teams.

### Core features

- Google Calendar & Microsoft Graph OAuth integration
- Two-way calendar event synchronization and webhook listeners
- Heuristic optimization engine for automatic meeting rescheduling
- Focus Time block allocation based on user preferences
- Flexible meeting rules and tolerance constraints
- Custom scheduling links respecting open calendar windows
- Smart breaks, travel time, and buffer injection

## The business

### Pricing

- Free: $0
- Pro: $6.75/mo
- Business: $11.50/user/mo

### Funding

$76M raised.
- Series A: $11.3M (June 2019)
- Series B: $18M (June 2020)
- Later Growth Rounds
Investors: Bain Capital Ventures, Accel, Greylock Partners, Atlassian Ventures, Coatue Management

Founded 2016.
Team size: Mid-sized (~100 employees).

## The hard parts

- Handling brittle two-way calendar sync, token expirations, and timezone edge cases across Google and Microsoft ecosystems
- Solving the NP-hard constraint-satisfaction graph problem for shifting meeting slots across multiple participants' constraints without cascading failures
- Managing robust background job queues for continuous schedule evaluation and webhook retries

## How to vibe code Clockwise

### Prerequisites

- Node.js (free): Runtime environment for building the Next.js web application and backend synchronization jobs.
- GitHub (free): Source code version control and CI/CD connection for deployment.
- Google Cloud Console Account (free): Required to register an OAuth application and obtain client credentials for the Google Calendar API.

### Recommended AI tools

- Claude Code: Best-in-class agentic coding tool for scaffolding multi-file integrations, OAuth flows, and algorithmic scheduler logic directly from the terminal.
- Cursor: Ideal AI-native editor for reviewing complex diffs when fine-tuning the calendar heuristic optimization algorithms and UI views.

### Stack

- Frontend: Next.js with Tailwind CSS and shadcn/ui components
- Backend: Next.js API Routes / Server Actions with Node.js background workers
- Database: Turso (SQLite at the edge for storing user tokens, preferences, and rule configurations)
- Auth: better-auth configured with Google OAuth provider
- Payments: None (personal use clone)
- Other: Google Calendar REST API, Zod for runtime validation, Luxon or date-fns-tz for timezone math

### Hosting

- Cloudflare (Hosting the Next.js frontend and edge API routes via OpenNext adapter): $0-5/mo
- Railway (Running persistent background worker processes for cron-based calendar scanning and rescheduling loops): ~$5/mo

### Build guide

1. **Project Scaffolding & Database Schema** — Initialize the Next.js project with Tailwind CSS, shadcn/ui, Turso database connection, and better-auth setup.

```
Create a new Next.js application using TypeScript and Tailwind CSS. Configure better-auth with Turso as the database backend to support Google OAuth sign-in. Set up a database schema with tables for users, user_tokens (storing encrypted OAuth access and refresh tokens), calendar_preferences (working hours, minimum focus block duration, lunch breaks), and scheduled_blocks (tracking AI-generated focus slots and smart holds). Ensure all date and time fields use strict ISO strings with timezone awareness.
```

2. **Google Calendar OAuth & Two-Way Sync Integration** — Implement Google Calendar API integration to fetch events, handle token refreshes, and ingest webhooks.

```
Build a robust Google Calendar API service module in TypeScript. Implement OAuth connection flow requesting offline access and full calendar scopes (https://www.googleapis.com/auth/calendar). Create secure database storage for encrypted refresh tokens and automatic token rotation logic. Implement an endpoint to fetch calendar events for a specified date range and set up a webhook receiver route to handle incoming Google Calendar push notifications for event updates.
```

3. **Calendar Optimization & Focus Time Algorithm** — Develop the core heuristic scheduling engine to identify open windows and inject Focus Time blocks.

```
Write a deterministic scheduling algorithm module in TypeScript that evaluates a user's existing calendar events against their working hours and preferences. The algorithm must identify fragmented gaps of time, group them into continuous blocks meeting the user's minimum focus duration threshold (e.g., 2 hours), and formulate API requests to create 'Focus Time' events on the user's primary Google Calendar. Include conflict resolution logic to ensure focus blocks never overwrite meetings or user-marked busy times.
```

4. **Flexible Meetings & Rescheduling Logic** — Build rules and logic to automatically evaluate and shift flexible meetings to optimal open slots.

```
Extend the backend scheduling engine to support 'Flexible Meetings'. Allow users to flag specific meetings with metadata or custom properties indicating they can be moved. Create a background worker loop that runs periodically to inspect flexible meetings, score alternative available time slots based on attendee overlapping availability and user preferences, and execute calendar patch updates to move meetings to optimal slots while preventing infinite shuffle loops.
```

5. **Scheduling Links & Public Booking Interface** — Create customizable booking pages allowing external users to schedule meetings respecting focus preferences.

```
Build a public scheduling link feature in Next.js. Create an interface where external invitees can view available time slots for a host based on their calendar availability, working hours, and protected focus time blocks. Implement backend logic that validates incoming slot selection requests and automatically creates the corresponding calendar event on the host's Google Calendar via API.
```

6. **Dashboard UI & Preference Management** — Construct the frontend dashboard for managing calendar preferences, viewing created focus blocks, and monitoring optimization stats.

```
Build a clean SaaS dashboard in Next.js using shadcn/ui components. Include views for: (1) Calendar preference settings (working hours, lunch duration, minimum focus block size), (2) A visual calendar overview showing synced focus blocks and scheduled meetings, (3) An analytics summary card displaying total hours of focus time created and meetings rescheduled. Connect all frontend components to the backend API routes with proper loading states and error handling.
```

7. **Background Worker Deployment & Polish** — Deploy background worker tasks to Railway and configure error tracking and cron triggers for continuous optimization.

```
Configure a standalone Node.js background worker script that triggers the calendar optimization routine for all active users every hour. Set up error logging and Sentry integration for monitoring failed API calls to Google Calendar. Prepare Dockerfile configuration for deploying the worker to Railway and verify end-to-end token rotation and focus block insertion.
```

### Cost vs paying

**Starting costs (one-time):**

- Google Cloud Project Setup: $0
- Total: $0 one-time

**Ongoing costs (monthly):**

- Railway Background Worker Hosting: ~$5/mo
- Total: ~$5/mo

- Paying for the SaaS instead: $11.50/mo
- Build time: 40-60 hours
- AI tool credits: $20 (Claude Pro / Cursor)
- Break-even: N/A (Product is defunct; clone built for personal use)

## Sources

- [Clockwise Official Site / Next Chapter Notice](https://www.getclockwise.com)
- [Crunchbase News - Clockwise $18M Series B](https://news.crunchbase.com/news/clockwise-series-b-bain-capital-ventures/)
- [The Register - Clockwise Salesforce Acqui-hire and Shutdown](https://www.theregister.com/2026/03/...)