feat: Integrate Relay Hub for centralized Nostr connection management

- Introduce a new composable, useRelayHub, to manage all Nostr WebSocket connections, enhancing connection stability and performance.
- Update existing components and composables to utilize the Relay Hub for connecting, publishing events, and subscribing to updates, streamlining the overall architecture.
- Add a RelayHubStatus component to display connection status and health metrics, improving user feedback on the connection state.
- Implement a RelayHubDemo page to showcase the functionality of the Relay Hub, including connection tests and subscription management.
- Ensure proper error handling and logging throughout the integration process to facilitate debugging and user experience.
This commit is contained in:
padreug 2025-08-10 11:48:33 +02:00
parent df7e461c91
commit 7d7bee8e77
14 changed files with 1982 additions and 955 deletions

View file

@ -33,6 +33,7 @@ const navigation = computed<NavigationItem[]>(() => [
{ name: t('nav.events'), href: '/events' },
{ name: t('nav.market'), href: '/market' },
{ name: t('nav.chat'), href: '/chat' },
{ name: 'Relay Hub', href: '/relay-hub-demo' },
])
// Compute total wallet balance
@ -149,6 +150,10 @@ const handleLogout = async () => {
<Ticket class="h-4 w-4" />
My Tickets
</DropdownMenuItem>
<DropdownMenuItem @click="() => router.push('/relay-hub-demo')" class="gap-2">
<MessageSquare class="h-4 w-4" />
Relay Hub Demo
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem @click="handleLogout" class="gap-2 text-destructive">
<LogOut class="h-4 w-4" />
@ -230,6 +235,11 @@ const handleLogout = async () => {
<Ticket class="h-4 w-4" />
My Tickets
</Button>
<Button variant="ghost" size="sm" @click="() => router.push('/relay-hub-demo')"
class="w-full justify-start gap-2">
<MessageSquare class="h-4 w-4" />
Relay Hub Demo
</Button>
<Button variant="ghost" size="sm" @click="handleLogout"
class="w-full justify-start gap-2 text-destructive">
<LogOut class="h-4 w-4" />