import { NDKKind } from '@nostr-dev-kit/ndk'; import * as Collapsible from '@radix-ui/react-collapsible'; import { appConfigDir } from '@tauri-apps/api/path'; import { invoke } from '@tauri-apps/api/primitives'; import { useEffect, useState } from 'react'; import { toast } from 'sonner'; import { DepotContactCard } from '@app/depot/components/contact'; import { DepotMembers } from '@app/depot/components/members'; import { DepotProfileCard } from '@app/depot/components/profile'; import { DepotRelaysCard } from '@app/depot/components/relays'; import { useArk } from '@libs/ark'; import { ChevronDownIcon, DepotIcon, GossipIcon } from '@shared/icons'; export function DepotScreen() { const ark = useArk(); const [dataPath, setDataPath] = useState(''); const [tunnelUrl, setTunnelUrl] = useState(''); const openFolder = async () => { await invoke('show_in_folder', { path: dataPath + '/nostr.db', }); }; const updateRelayList = async () => { try { if (tunnelUrl.length < 1) return toast.info('Please enter a valid relay url'); if (!tunnelUrl.startsWith('ws')) return toast.info('Please enter a valid relay url'); const relayUrl = new URL(tunnelUrl.replace(/\s/g, '')); if (!/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/.test(relayUrl.host)) return; const relayEvent = await ark.getEventByFilter({ filter: { authors: [ark.account.pubkey], kinds: [NDKKind.RelayList] }, }); let publish: { id: string; seens: string[] }; if (!relayEvent) { publish = await ark.createEvent({ kind: NDKKind.RelayList, tags: [['r', tunnelUrl, '']], }); } const newTags = relayEvent.tags ?? []; newTags.push(['r', tunnelUrl, '']); publish = await ark.createEvent({ kind: NDKKind.RelayList, tags: newTags, }); if (publish) { await ark.createSetting('tunnel_url', tunnelUrl); toast.success('Update relay list successfully.'); setTunnelUrl(''); } } catch (e) { console.error(e); toast.error('Error'); } }; useEffect(() => { async function loadConfig() { const appDir = await appConfigDir(); setDataPath(appDir); } loadConfig(); }, []); return (
nostr.db (SQLite)
Make your Depot visible in the Internet, everyone can connect into it.
ngrok
Cloudflare Tunnel
Local Tunnel
By adding to Relay List, other Nostr Client which support Gossip Model will automatically connect to your Depot and improve the discoverability.
Backup all your data to Depot, it always live on your machine.