Metacord is a personal Discord server directory, allowing to keep track of current (and previous) servers, adding notes, keeping track of invite links (so you can leave and rejoin later), etc...
- Discord OAuth Login - One-click authentication with PKCE flow
- Server List - View all servers with icons, names, and join dates
- Organization - Favorites, custom nicknames, and personal notes
- Filters - Partner, Verified, Boosted, Discoverable, Owner
- Search - Filter servers by name in real-time
- Export/Import - Backup and restore your user data (JSON)
- Demo Mode - Preview UI without OAuth setup via
?demo=1
- Frontend: Static SPA (Vite + TypeScript) on Cloudflare Pages
- Backend: Hono catch-all router in Pages Functions (
/api/*) - Auth: Discord OAuth with PKCE, AES-GCM encrypted tokens in Workers KV
- Storage: KV for sessions, localStorage for user preferences
- Node.js 18+ with pnpm
- Cloudflare account
- Discord application (discord.com/developers)
-
Clone and install:
pnpm install
-
Create Discord application:
- Go to Discord Developer Portal
- Create new application, go to OAuth2 settings
- Add redirect URL:
http://localhost:8788/api/auth/callback - Copy Client ID and Client Secret
-
Create KV namespace:
pnpm wrangler kv:namespace create "SESSIONS" pnpm wrangler kv:namespace create "SESSIONS" --preview
Add the IDs to
wrangler.toml -
Configure secrets (requires direnv):
cp .envrc.example .envrc # Edit .envrc with your Discord credentials and SESSION_SECRET direnv allow -
Start development:
pnpm dev
Tip: Use
?demo=1to preview the UI without setting up OAuth. Demo mode loads mock data from aguilds_api.jsonthat you can extract from the Console of your browser in a logged in session.
| Command | Description |
|---|---|
pnpm dev |
Run Vite + Wrangler concurrently |
pnpm build |
Build frontend for production |
pnpm preview |
Preview production build locally |
See docs/deployment.md.
metacord/
├── src/
│ ├── index.html # SPA entry point
│ ├── main.ts # Application logic
│ ├── style.css # Styles with CSS variables
│ ├── components/ # UI components (modal, serverCard, toast)
│ └── lib/ # Frontend helpers (api, storage, utils)
├── functions/
│ ├── api/
│ │ └── [[route]].ts # Hono catch-all router
│ └── lib/ # Backend helpers (session, cache, crypto, cookies, http, types)
├── shared/ # Shared types (placeholder)
├── docs/
│ └── PRD.md # Product requirements
├── vite.config.ts # Vite build config
├── wrangler.toml # Cloudflare config
├── tsconfig.json # TypeScript config
└── .envrc.example # Environment template (direnv)
Private - Personal use only