Mail, Drive and an admin console for one domain, on Cloudflare Workers and the free plan, behind Cloudflare Access.
| App | Folder | What it is |
|---|---|---|
apps/mail |
Webmail on your own domain: Email Routing in, Resend out, an AI agent, labels, contacts, offline reading, push notifications, an MCP server. | |
| Drive | apps/drive |
Files in R2 with folders, sharing links, full-text search, and document and spreadsheet editing. Mail attaches from and saves to it. |
| Admin | apps/admin |
A Workspace-style console: users (mailboxes), who can open each, storage, AI and sending use, Drive shares, an audit log. |
Each app is its own Worker with its own wrangler.jsonc, domain and Access app, and deploys on its own. They talk over service bindings, which can't be reached from the internet.
Shared code lives in packages/:
packages/shell: the app bar, navigation, account and apps menus, theme, and the service worker (copied into each app'spublic/before dev and build).packages/contracts: the admin console's RPC contract with Mail and Drive. Both apps implement it, so a change that would break the console fails typecheck.
Node 22.22 or newer.
npm ci
npm run typecheck # every app and package
npm run lint
npm testWork on one app from its folder (cd apps/mail && npm run dev), or from the root with -w apps/mail.
Each app's README covers its first-time setup (R2 bucket, Access app, secrets). Your domain, URLs and Access settings go in each app's wrangler.local.jsonc, copied from wrangler.local.example.jsonc. It's git-ignored and merged over wrangler.jsonc at build time, so the repo only ever holds example.com placeholders. After that:
npm run deploy:mail
npm run deploy:drive
npm run deploy:adminDeploy Mail and Drive before the console, so the entrypoints it binds exist. npm run deploy does all three in that order.
If your Cloudflare login has more than one account, set CLOUDFLARE_ACCOUNT_ID first; Wrangler can't pick one when it isn't interactive.
This repo joins three that were developed separately; each app's folder keeps its full commit history. Mail started from Cloudflare's agentic-inbox example (Apache 2.0, see LICENSE).
Apache 2.0.