A Cloudflare Worker service that functions as both an invite gateway and website for Rabble Community.
- Create multi-use, never-expiring invite codes
- Preview page with group metadata from Nostr relay
- Mobile deep-linking support (iOS Universal Links and Android App Links)
- Web fallback for users without the app
- Content-rich landing page
- About page with team information
- Design principles & non-negotiables
- FAQ, roadmap, and developer documentation
- Blog with dedicated posts
- Legal pages (privacy policy, terms of service)
- Proxies plur-app at
/apppath - Transparent URL rewriting
- Deep linking support
-
Install dependencies:
npm install -
Configure Cloudflare
- Create a KV namespace named
INVITES - Update
wrangler.tomlwith your account ID, zone ID, and KV namespace ID - Set the
INVITE_TOKENsecret:npx wrangler secret put INVITE_TOKEN
- Create a KV namespace named
-
Configure DNS
- Point
rabble.communityto Cloudflare
- Point
-
Configure App-Linking
- In iOS app: Enable Associated Domains with
applinks:rabble.community - In Android app: Add intent filters for
https://rabble.community/i/* - Update values in the code:
- Replace
YOUR_APP_FINGERPRINT_HEREin assetlinks.json - Replace
YOUR_TEAM_IDin apple-app-site-association - Replace
YOUR_APP_IDin the install-app link
- Replace
- In iOS app: Enable Associated Domains with
# Run local development server
npm run dev
# This starts a local server at http://localhost:8787
# Changes to the code will be automatically detected and refreshed
# Type check
npm run typecheck
# Deploy to Cloudflare
npm run deploy-
The local development server runs at
http://localhost:8787by default -
Any changes to the code are automatically detected and the server reloads
-
The local server simulates the KV namespace with an in-memory store
-
For faster iteration on styles and UI, you can:
- Edit the CSS in
src/index.tswithin the<style>tags - Update the markdown content in the
PAGESobject - Make changes in small batches to see results quickly
- Edit the CSS in
-
To test specific pages, visit:
- Landing page:
http://localhost:8787/ - Design principles:
http://localhost:8787/design-principles - About page:
http://localhost:8787/about - And other paths defined in the
PAGESobject
- Landing page:
The website content is stored in the PAGES object in src/index.ts as markdown. To add or modify content:
- Edit the markdown in the appropriate section of the
PAGESobject - Use YAML frontmatter for title, description, and image
- Use markdown formatting (headings, lists, tables, quotes)
- To add a new page:
- Add a new entry to the
PAGESobject with the path as the key - Update the navigation menu in the
createPagefunction
- Add a new entry to the
- Headers:
# Heading 1,## Heading 2,### Heading 3 - Emphasis:
*italic*,**bold** - Lists:
- Item 1,- Item 2 - Links:
[Link text](URL)or[Link text](URL){.button-class} - Tables:
| Header | Header |format - Quotes:
> Quote textor:::quote\nQuote text\n::: - Code:
`inline code`or```language\ncode block\n``` - Horizontal rule:
--- - Details/summary:
<details><summary>Title</summary>Content</details>
- POST
/api/invite - Header:
X-Invite-Token: [secret-token] - Body:
{ "groupId": "string", "relay": "string" } - Response:
{ "code": "string", "url": "string" }
- POST
/api/invite/web - Header:
X-Invite-Token: [secret-token] - Body:
{ "groupId": "string", "relay": "string", "name": "string", "description": "string", "avatar": "string", "creatorPubkey": "string" } - Response:
{ "code": "string", "url": "string" }
- POST
/api/invite/short - Header:
X-Invite-Token: [secret-token] - Body:
{ "code": "string" } - Response:
{ "shortCode": "string", "url": "string" }
- GET
/api/invite/:code - Response:
{ "code": "string", "groupId": "string", "relay": "string" }
- GET
/api/invite/web/:code - Response:
{ "code": "string", "groupId": "string", "relay": "string", "name": "string", "description": "string", "avatar": "string", "createdAt": number, "creatorPubkey": "string" }
- GET
/api/invite/short/:shortCode - Response:
{ "code": "string" }
- URL:
/i/:code- Standard invite preview - URL:
/join/:code- Web invite preview with rich metadata - URL:
/j/:shortCode- Short URL that redirects to full invite
All pages show relevant group info and provide options: Open in App, Install App, Continue in Browser