diff --git a/AGENTS.md b/AGENTS.md index 7ff02d1..a3638fd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,8 +2,8 @@ ## Project Structure & Module Organization -- `src/routes` contains SvelteKit routes, including dynamic handle pages in `src/routes/[handle]/[[page]]`, edit flows in `src/routes/[handle]/[[page]]/edit` and `src/routes/edit`, and API endpoints under `src/routes/api`. -- `src/lib` holds reusable modules: card implementations in `src/lib/cards`, shared UI in `src/lib/components`, OAuth helpers in `src/lib/oauth`, and site data/loading in `src/lib/website`. +- `src/routes` contains SvelteKit routes. User-facing pages are under `src/routes/[[actor=actor]]/(pages)/` with an optional actor param (double brackets). When omitted, the actor is resolved from custom domain KV or `PUBLIC_HANDLE`. API endpoints live under `src/routes/api` and `src/routes/[[actor=actor]]/api`. +- `src/lib` holds reusable modules: card implementations in `src/lib/cards`, shared UI in `src/lib/components`, ATProto/OAuth helpers in `src/lib/atproto`, and site data/loading in `src/lib/website`. - Root app setup lives in `src/app.html` and `src/app.css`. - `static` is for public assets served as-is. - `docs` includes contributor-facing docs like custom cards and self-hosting. diff --git a/CLAUDE.md b/CLAUDE.md index 94ea249..3ece8fb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -61,12 +61,13 @@ Grid margins: 16px desktop, 12px mobile. - See e.g. `src/lib/cards/EmbedCard/` and `src/lib/cards/LivestreamCard/` for examples of implementation. - Cards should be styled to work in light and dark mode (with `dark:` class modifier) as well as when cards are colorful (= bg-color-500 for the card background) (with `accent:` modifier). -**ATProto Integration (`src/lib/oauth/`):** +**ATProto Integration (`src/lib/atproto/`):** - `auth.svelte.ts` - OAuth client state and login/logout flow using `@atcute/oauth-browser-client` - `atproto.ts` - ATProto API helpers: `resolveHandle`, `listRecords`, `getRecord`, `putRecord`, `deleteRecord`, `uploadImage` - Data is stored in user's PDS under collection `app.blento.card` - **Important**: ATProto does not allow floating point numbers in records. All numeric values must be integers. +- Login redirect: before OAuth redirect, the current path is saved to `localStorage` (`login-redirect`) and restored after callback **Caching (`src/lib/cache.ts`):** @@ -88,13 +89,18 @@ Grid margins: 16px desktop, 12px mobile. ### Routes -- `/` - Landing page -- `/[handle]/[[page]]` - View a user's bento site (loads from their PDS) -- `/[handle]/[[page]]/edit` - Edit mode for a user's site page -- `/edit` - Self-hosted edit mode -- `/api/links` - Link preview API +All user-facing pages live under `src/routes/[[actor=actor]]/(pages)/` using an optional `[[actor=actor]]` param. When the actor param is omitted, the layout resolves the actor from a custom domain (via KV lookup) or the `PUBLIC_HANDLE` env var. + +- `/` - Landing page (or a user's site when on a custom domain) +- `/[actor]` - View a user's bento site (loads from their PDS) +- `/[actor]/edit` - Edit mode for a user's main page +- `/[actor]/p/[page]` - View a named sub-page +- `/[actor]/p/[page]/edit` - Edit mode for a sub-page +- `/[actor]/p/[page]/copy` - Copy a page to your own site +- `/[actor]/og.png` - Dynamic OG image generation +- `/[actor]/api/refresh` - Cache refresh endpoint +- `/[actor]/.well-known/site.standard.publication` - Site publication metadata - `/api/geocoding` - Geocoding API for map cards -- `/api/reloadRecent`, `/api/update` - Additional data endpoints ### Item Type