···53**Card System (`src/lib/cards/`):**
5455- `CardDefinition` type in `types.ts` defines the interface for card types
56-- 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`)
0057- Card types include Text, Link, Image, Bluesky, Embed, Map, Livestream, ATProto collections, and special cards (see `src/lib/cards`).
58- `AllCardDefinitions` and `CardDefinitionsByType` in `index.ts` aggregate all card types
59- See e.g. `src/lib/cards/EmbedCard/` and `src/lib/cards/LivestreamCard/` for examples of implementation.
···69**Caching (`src/lib/cache.ts`):**
7071- `CacheService` class wraps a single Cloudflare KV namespace (`USER_DATA_CACHE`) with namespaced keys
72-- Keys are stored as `namespace:key` (e.g. `user:did:plc:abc`, `github:someuser`, `lastfm:method:user:period:limit`)
73-- Per-namespace default TTLs via KV `expirationTtl`: `user` (24h), `identity` (7d), `github` (12h), `gh-contrib` (12h), `lastfm` (1h, overridable), `npmx` (12h), `meta` (no expiry)
74-- User data is keyed by DID with bidirectional handle↔DID identity mappings (`identity:h:{handle}` → DID, `identity:d:{did}` → handle)
75-- `getUser(identifier)` accepts either a handle or DID and resolves automatically
76-- `putUser(did, handle, data)` writes data + both identity mappings
077- `createCache(platform)` factory function creates a `CacheService` from `platform.env`
78- `CUSTOM_DOMAINS` KV namespace is separate and accessed directly for custom domain → DID resolution
79···91- `/edit` - Self-hosted edit mode
92- `/api/links` - Link preview API
93- `/api/geocoding` - Geocoding API for map cards
94-- `/api/instagram`, `/api/reloadRecent`, `/api/update` - Additional data endpoints
9596### Item Type
97
···53**Card System (`src/lib/cards/`):**
5455- `CardDefinition` type in `types.ts` defines the interface for card types
56+- 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`)
57+- `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.
58+- 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.
59- Card types include Text, Link, Image, Bluesky, Embed, Map, Livestream, ATProto collections, and special cards (see `src/lib/cards`).
60- `AllCardDefinitions` and `CardDefinitionsByType` in `index.ts` aggregate all card types
61- See e.g. `src/lib/cards/EmbedCard/` and `src/lib/cards/LivestreamCard/` for examples of implementation.
···71**Caching (`src/lib/cache.ts`):**
7273- `CacheService` class wraps a single Cloudflare KV namespace (`USER_DATA_CACHE`) with namespaced keys
74+- Keys are stored as `namespace:key` (e.g. `blento:did:plc:abc`, `github:someuser`, `lastfm:method:user:period:limit`)
75+- Per-namespace default TTLs via KV `expirationTtl`: `blento` (24h), `identity` (7d), `github` (12h), `gh-contrib` (12h), `lastfm` (1h, overridable), `npmx` (12h), `meta` (no expiry)
76+- Blento data is keyed by DID with bidirectional handle↔DID identity mappings (`identity:h:{handle}` → DID, `identity:d:{did}` → handle)
77+- `getBlento(identifier)` accepts either a handle or DID and resolves automatically
78+- `putBlento(did, handle, data)` writes data + both identity mappings
79+- Generic `get(namespace, key)` / `put(namespace, key, value, ttl?)` and JSON variants `getJSON` / `putJSON` for all namespaces
80- `createCache(platform)` factory function creates a `CacheService` from `platform.env`
81- `CUSTOM_DOMAINS` KV namespace is separate and accessed directly for custom domain → DID resolution
82···94- `/edit` - Self-hosted edit mode
95- `/api/links` - Link preview API
96- `/api/geocoding` - Geocoding API for map cards
97+- `/api/reloadRecent`, `/api/update` - Additional data endpoints
9899### Item Type
100