Update documentation to reflect new authentication architecture

Remove legacy references to global auth composable and document the new
dependency injection pattern with single source of truth.

Key Documentation Updates:
• Update authentication.md with DI architecture details and usage patterns
• Update chat integration docs to reference AuthService and remove legacy patterns
• Add comprehensive authentication-architecture.md with full technical details
• Document migration path from legacy global auth to current DI pattern

Content Changes:
• Replace useAuth.ts references with useAuthService.ts
• Document AuthService as singleton with dependency injection
• Add code examples for both component and service usage
• Explain benefits of new architecture (single source of truth, no timing issues)
• Update chat integration to reflect service-based architecture

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
padreug 2025-09-07 00:53:42 +02:00
parent 4feb5459cc
commit 6cb10a31db
3 changed files with 311 additions and 11 deletions

View file

@ -24,14 +24,15 @@ A Vue component that provides the chat interface with:
- Encrypted message exchange
- Connection status indicators
### 2. useNostrChat.ts
**Location**: `src/composables/useNostrChat.ts`
### 2. ChatService
**Location**: `src/modules/chat/services/chat-service.ts`
A composable that handles:
- Nostr relay connections
A service-based architecture that handles:
- Nostr relay connections via dependency injection
- Message encryption/decryption
- User authentication with LNBits
- User authentication through AuthService
- Real-time message subscription
- Integration with modular service architecture
### 3. ChatPage.vue
**Location**: `src/pages/ChatPage.vue`
@ -83,9 +84,10 @@ Response:
## Features
### 1. User Integration
- Automatically loads peers from LNBits user database
- Uses existing `pubkey` and `prvkey` fields
- Admin-only access to private keys for messaging
- Automatically loads peers from LNBits user database via dependency injection
- Uses existing `pubkey` and `prvkey` fields from AuthService
- Authentication managed through centralized AuthService
- No dual authentication issues - single source of truth
### 2. Nostr Relay Integration
- Connects to multiple Nostr relays for redundancy