···5353**Card System (`src/lib/cards/`):**
54545555- `CardDefinition` type in `types.ts` defines the interface for card types
5656-- Each card type exports a definition with: `type`, `contentComponent`, optional `editingContentComponent`, `creationModalComponent`, `sidebarButtonText`, `loadData`, `upload` (see more info and description in `src/lib/cards/types.ts`)
5656+- Each card type exports a definition with: `type`, `contentComponent`, optional `editingContentComponent`, `creationModalComponent`, `sidebarButtonText`, `loadData`, `loadDataServer`, `upload` (see more info and description in `src/lib/cards/types.ts`)
5757+- `loadData` fetches external data on the client (via remote functions). `loadDataServer` is the server-side equivalent used during SSR to avoid self-referential HTTP requests on Cloudflare Workers.
5858+- Cards that need external data use `.remote.ts` files (SvelteKit remote functions) co-located in the card folder (e.g. `GitHubProfileCard/api.remote.ts`, `LastFMCard/api.remote.ts`). These use `query()` from `$app/server` and run server-side, with SvelteKit generating fetch wrappers for client use.
5759- Card types include Text, Link, Image, Bluesky, Embed, Map, Livestream, ATProto collections, and special cards (see `src/lib/cards`).
5860- `AllCardDefinitions` and `CardDefinitionsByType` in `index.ts` aggregate all card types
5961- See e.g. `src/lib/cards/EmbedCard/` and `src/lib/cards/LivestreamCard/` for examples of implementation.
···6971**Caching (`src/lib/cache.ts`):**
70727173- `CacheService` class wraps a single Cloudflare KV namespace (`USER_DATA_CACHE`) with namespaced keys
7272-- Keys are stored as `namespace:key` (e.g. `user:did:plc:abc`, `github:someuser`, `lastfm:method:user:period:limit`)
7373-- Per-namespace default TTLs via KV `expirationTtl`: `user` (24h), `identity` (7d), `github` (12h), `gh-contrib` (12h), `lastfm` (1h, overridable), `npmx` (12h), `meta` (no expiry)
7474-- User data is keyed by DID with bidirectional handle↔DID identity mappings (`identity:h:{handle}` → DID, `identity:d:{did}` → handle)
7575-- `getUser(identifier)` accepts either a handle or DID and resolves automatically
7676-- `putUser(did, handle, data)` writes data + both identity mappings
7474+- Keys are stored as `namespace:key` (e.g. `blento:did:plc:abc`, `github:someuser`, `lastfm:method:user:period:limit`)
7575+- Per-namespace default TTLs via KV `expirationTtl`: `blento` (24h), `identity` (7d), `github` (12h), `gh-contrib` (12h), `lastfm` (1h, overridable), `npmx` (12h), `meta` (no expiry)
7676+- Blento data is keyed by DID with bidirectional handle↔DID identity mappings (`identity:h:{handle}` → DID, `identity:d:{did}` → handle)
7777+- `getBlento(identifier)` accepts either a handle or DID and resolves automatically
7878+- `putBlento(did, handle, data)` writes data + both identity mappings
7979+- Generic `get(namespace, key)` / `put(namespace, key, value, ttl?)` and JSON variants `getJSON` / `putJSON` for all namespaces
7780- `createCache(platform)` factory function creates a `CacheService` from `platform.env`
7881- `CUSTOM_DOMAINS` KV namespace is separate and accessed directly for custom domain → DID resolution
7982···9194- `/edit` - Self-hosted edit mode
9295- `/api/links` - Link preview API
9396- `/api/geocoding` - Geocoding API for map cards
9494-- `/api/instagram`, `/api/reloadRecent`, `/api/update` - Additional data endpoints
9797+- `/api/reloadRecent`, `/api/update` - Additional data endpoints
95989699### Item Type
97100