# Building an internal tool on Cloudflare Workers + D1

> How I built a property management system for a short-stay operator on Cloudflare: Hono API, D1, cron-based Airbnb sync, push alerts and role-based access.

By Tommy Pham · 2026-11-14 · https://tommydev.web.app/blog/cloudflare-workers-d1-internal-tool

**Short answer:** Cloudflare Workers, D1 and a Cron Trigger can carry a real internal tool with no server to maintain. I built [StayFlow](/work/stayflow-pms), a property management system for a short-stay operator, this way: a React frontend, a Hono API on Workers, D1 for data, a cron that syncs Airbnb calendars every 15 minutes, and Web Push for staff alerts. It suits internal tools well because traffic is modest, the cost is low, and there's one platform to learn.

Part of my guide on [where to host a vibe-coded app](/blog/where-to-host-vibe-coded-app).

## What did the tool need to do?

The client is an Airbnb host growing into a multi-property operation. Bookings came from Airbnb and direct channels, and staff needed one place to see:

- a reservations calendar and a front desk view per property,
- housekeeping tasks created automatically when guests check out,
- revenue by sales channel, after platform fees, VAT and expenses,
- different access for managers, front desk and housekeeping.

It's a private client project, so this post covers architecture, not client data.

## Why Cloudflare instead of Supabase + Vercel?

| Need | Cloudflare piece |
|---|---|
| API | Workers + [Hono](https://hono.dev) |
| Database | D1 (SQLite) |
| Scheduled Airbnb sync | Cron Trigger |
| Staff notifications | Web Push from the Worker |
| Frontend | React + TypeScript + Tailwind, installable as a PWA |

Everything lives on one platform with one deploy and one bill. There's no database connection pool to manage, because D1 is bound directly to the Worker. And for an internal tool used by a small team, the free and entry paid tiers go a long way.

The trade-off is that D1 is SQLite and Workers aren't Node.js. Both were fine here. They'd matter more for an app needing Postgres extensions or Node-only libraries ([database comparison](/blog/supabase-vs-neon-vs-d1-vs-firestore)).

## How does the Airbnb sync work?

Airbnb exposes each listing's calendar as an iCal feed. A Cron Trigger runs every 15 minutes, fetches each property's feed, and updates the reservations in D1. Staff can also hit a reload button that calls the same sync code, for when they can't wait 15 minutes.

```toml
# wrangler.toml
[triggers]
crons = ["*/15 * * * *"]
```

```ts
export default {
  fetch: app.fetch, // Hono app for the API
  async scheduled(_event, env, ctx) {
    ctx.waitUntil(syncAllCalendars(env));
  },
};
```

Things this pattern has to get right:

- **Crons run in UTC.** Anything date-based has to convert to the property's local time zone explicitly.
- **Make the sync idempotent.** Running it twice shouldn't create duplicate bookings, because the manual reload and the cron can overlap.
- **iCal is limited.** Calendar feeds carry dates and a short summary, not full guest or payment details, so treat them as an availability feed.

More on scheduling: [Cloudflare Cron vs Trigger.dev](/blog/background-jobs-cron-trigger-dev-vs-cloudflare).

## Housekeeping and push notifications

When a reservation's checkout passes, the tool creates a cleaning task for that property, and staff get a push notification on their phones. The frontend is an installable PWA, so housekeeping staff add it to their home screen like an app, with no app store involved. Web Push works on Android and, for home-screen web apps, on iOS.

## Access control

Three roles (manager, front desk, housekeeping) see different screens and data. Sessions use **HttpOnly cookies**, so the browser's JavaScript never touches the session token, and every API route checks the role on the server. Hiding a button in the UI isn't access control. The Worker has to refuse the request.

## When does this stack fit?

For internal tools of this size: one platform, no servers, low running cost, and a deploy is one `wrangler deploy`. Postgres is the better pick once reporting gets complex, and a VPS once you need long-running processes.

## FAQ

### Can D1 handle a production app?

For internal tools and small SaaS apps, yes. Check the [current limits](https://developers.cloudflare.com/d1/platform/limits/): 500 MB per database on the free plan and 10 GB on paid, as of November 2026.

### Do I need Hono?

No, a Worker can handle requests directly. Hono adds routing, middleware and typed handlers with very little overhead, which helps once you have more than a few endpoints.

### Can a vibe-coded app be moved to this stack?

Yes, if it's a React frontend. The backend calls need rewriting as Worker routes, and the data moves from Supabase or Firebase into D1. It's a migration, not a redeploy.

---

Need an internal tool for bookings, staff or operations? This is the kind of thing I build. See [my work](/#work) or get in touch below.

## Sources

- Cloudflare docs: [Cron Triggers](https://developers.cloudflare.com/workers/configuration/cron-triggers/) and [D1 limits](https://developers.cloudflare.com/d1/platform/limits/) (checked November 2026)
- [Hono documentation](https://hono.dev)