Skip to content

About

Mail, Drive and an admin console for one domain on Cloudflare Workers, behind Cloudflare Access

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

159 Commits

Folders and files

Repository files navigation

agentic-workspace

Mail, Drive and an admin console for one domain, on Cloudflare Workers and the free plan, behind Cloudflare Access.

App Folder What it is
Mail 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's public/ 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.

Develop

Node 22.22 or newer.

npm ci
npm run typecheck   # every app and package
npm run lint
npm test

Work on one app from its folder (cd apps/mail && npm run dev), or from the root with -w apps/mail.

Deploy

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:admin

Deploy 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.

History

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).

License

Apache 2.0.

About

Mail, Drive and an admin console for one domain on Cloudflare Workers, behind Cloudflare Access

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages