Website Worker
Website pages
Shows public pages and the dashboard. It sends API requests through a private link between Cloudflare Workers.
How the website, API, Discord, email, storage, and scheduled jobs connect.
The short version
The website sends requests to the API, the service that checks rules and saves club data. The API then asks the other services to handle Discord, email, or scheduled work.
The API is the only service that changes club records. The website shows the interface, the Discord Worker handles Discord actions, the Email Worker reads receipts, and the Scheduler Worker starts timed jobs.
Each service has one job. A web page cannot change Discord directly. The Scheduler Worker cannot write to the database. The Email Worker cannot create a membership by itself.
System flow
The website, Email Worker, and scheduler call the API. The API owns D1 and R2, and it signs events for Discord. The wiki deploys separately.
A member uses the website
A change reaches Discord
A purchase receipt arrives
Timed jobs run
The wiki deploys
Website Worker
Shows public pages and the dashboard. It sends API requests through a private link between Cloudflare Workers.
API Worker
Checks identity and permissions, applies limits, updates D1 and R2, and adds a digital signature to Discord events.
Discord Worker
Checks Discord interactions and signed messages, then updates roles, DMs, posts, and channels.
Discord Gateway
Keeps Discord’s live connection on a VPS, a private server, and sends a small set of checked events to the Worker.
Email Worker
Checks forwarded receipts, reads their PDF data, tracks retries in KV storage, and sends valid orders to the API.
Scheduler Worker
Runs every thirty minutes and starts seven private API jobs. It cannot access D1 or Discord directly.
The wiki is separate from these services. Astro and Starlight build it as static HTML, Pagefind adds search, and Cloudflare Pages hosts it. You can read this guide even when the member API is unavailable.
The API can check a user’s identity, permissions, club records, and stored files. A request may start on the website, in Discord, from an email, or on a timer. The API still decides whether data can change.
The main rule is:
If club data changes, the request goes through the API.
This means Discord and the dashboard use the same equipment loan, membership, and request records.
The workspace uses several repositories. Each repository is deployed on its own.
| Repository | Built with | Runs on | Connects to |
|---|---|---|---|
website | Astro + React on Workers | Cloudflare Worker | API Worker service binding |
api | TypeScript Worker | Cloudflare Worker | D1, three R2 buckets, Discord Worker, email providers and verification services |
discord | Worker + Node.js Gateway | Cloudflare Worker + VPS | API Worker, Discord REST, Discord Gateway, VPC service |
email-worker | TypeScript Worker | Cloudflare Worker | Email Routing, KV, API Worker |
scheduler-worker | TypeScript Worker | Cloudflare Worker | API Worker only |
wiki | Astro + Starlight | Cloudflare Pages | None; it works on its own |
Service bindings are private links between Cloudflare Workers, so their traffic does not use a public address. The services still use shared secrets and signed messages. These checks tell the receiving service who sent a request and whether it changed on the way.
Technology
Each service has a small, specific job.
Interface
Builds the website shell and the static wiki
Interface
Runs interactive parts of the public site and dashboard
Foundation
Provides one language for every Worker and web app
Interface
Styles the pages and their responsive layouts
Interface
Organizes the wiki and builds its search index
Cloudflare
Runs the website, API, Discord, email, and scheduler services
Cloudflare
Hosts and deploys this static wiki
Cloudflare
Stores the club records used by the API
Cloudflare
Stores gallery, competition, avatar, merchandise, and leadership media
Cloudflare
Tracks receipt intake, leases, and retries
Cloudflare
Sends TooCOOL receipts to the Email Worker
Operations
Builds and deploys Workers, and manages bindings, migrations, and secrets
Identity
Manages sessions, accounts, passkeys, 2FA, and Discord links
Identity
Checks for bots on public account and request forms
Data
Provides typed database access in the API Worker
Automation
Provides commands, roles, DMs, channels, and server events
Automation
Keeps the Discord Gateway connection open on the VPS
Foundation
Runs the VPS Gateway and local development tools
Data
Reads email messages and extracts text from receipt PDFs
Communication
Sends membership and activation emails
Operations
Runs checks and deploys services to Cloudflare
This guide does not include secret values, private IDs, or credentials. Live routes and VPS settings may change before this page is updated.