A simple SPA that serves as a landing page for a nostr nsite. When deployed to an nsite domain, it parses the current host, fetches the owner's profile (kind 0) from relays, and lists the owner's root site, named nsites, and manifest snapshots.
- Parses root, named-site, or snapshot hosts from the hostname
- Queries bootstrap relays for the user's relay list (kind 10002)
- Streams in profile (kind 0), nsite manifests (kinds
15128and35128), snapshots (kind5128), and theme events as they arrive - Renders the profile card and a site list with expandable version history
Data is fully reactive — there's no loading state or waiting. Events stream into an applesauce EventStore and the UI updates as data arrives.
- SvelteKit with
adapter-static(client-side SPA, no SSR) - Tailwind CSS v4
- applesauce-core / applesauce-relay for EventStore and relay connections
- nostr-tools for npub decoding
- rxjs for reactive event streams
pnpm installCreate a .env file with a test npub for local development:
VITE_DEV_NPUB=npub1...Then start the dev server:
pnpm devOn localhost, the app uses VITE_DEV_NPUB since there's no npub in the hostname. Without it, an error message is shown.
pnpm buildOutputs a static SPA to dist/ with index.html as the fallback entry point. Deploy the contents of dist/ to your nsite.
src/
lib/
nostr/
bootstrap.ts # host parsing, site/snapshot URL builders, bootstrap relays
store.ts # EventStore + RelayPool singletons
loaders.ts # relay subscriptions, nsite/snapshot extraction
components/
ProfileCard.svelte
NsiteList.svelte
ErrorMessage.svelte
LoadingSpinner.svelte
routes/
+layout.ts # SPA mode (ssr=false)
+layout.svelte
+page.svelte # main page orchestrator