Enhance documentation for Lightning Wallet integration and real-time features

- Expanded CLAUDE.md to include detailed information about the new Wallet Module, emphasizing its functionality for Lightning wallet management and real-time balance updates.
- Updated README.md to reflect the modular architecture, key features, and real-time wallet capabilities, including WebSocket configuration and connection management.
- Added sections on WebSocket real-time features, including automatic balance updates, live notifications, and battery optimization strategies.

These enhancements improve the clarity and accessibility of the wallet integration documentation, aiding developers in implementation and usage.
This commit is contained in:
padreug 2025-09-18 09:56:55 +02:00
parent 71cec00bfc
commit 23726f09ec
2 changed files with 116 additions and 3 deletions

View file

@ -1,5 +1,81 @@
# Vue 3 + TypeScript + Vite
# Ario Web App
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
A modular Vue 3 + TypeScript application with Nostr protocol integration and Lightning Network wallet functionality.
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
## Features
- **Modular Architecture**: Plugin-based system with dependency injection
- **Nostr Integration**: Decentralized social networking and messaging
- **Lightning Wallet**: Real-time balance updates with LNbits WebSocket integration
- **Event Ticketing**: Lightning-powered event tickets and marketplace
- **PWA Support**: Progressive Web App with offline capabilities
- **Desktop App**: Electron-based desktop application
## Real-Time Wallet Features
The application provides seamless Lightning Network wallet integration:
- **Instant Balance Updates**: WebSocket connection provides real-time balance updates when payments are sent or received
- **Live Notifications**: Toast notifications for incoming payments
- **Connection Management**: Automatic reconnection with exponential backoff
- **Battery Optimization**: Pauses WebSocket when app is not visible to save battery
- **Multi-Wallet Support**: Manages multiple Lightning wallets with the first wallet as default
### WebSocket Configuration
Configure WebSocket behavior in `src/app.config.ts`:
```typescript
modules: {
wallet: {
enabled: true,
config: {
websocket: {
enabled: true, // Enable/disable real-time updates
reconnectDelay: 1000, // Initial reconnection delay (ms)
maxReconnectAttempts: 5 // Maximum reconnection attempts
}
}
}
}
```
## Development
```bash
# Install dependencies
npm install
# Start development server with hot reload
npm run dev
# Build for production
npm run build
# Run Electron desktop app
npm run electron:dev
```
## Environment Setup
Required environment variables:
```bash
# LNbits server URL for Lightning wallet functionality
VITE_LNBITS_BASE_URL=http://localhost:5000
# Nostr relay configuration (JSON array)
VITE_NOSTR_RELAYS='["wss://relay1.example.com","wss://relay2.example.com"]'
```
## Architecture
The application follows a modular architecture with the following core modules:
- **Base Module**: Authentication, Nostr client, PWA functionality
- **Wallet Module**: Lightning payments, WebSocket balance updates, transaction management
- **Events Module**: Event ticketing with Lightning payment integration
- **Market Module**: Nostr marketplace functionality
- **Chat Module**: Encrypted messaging via Nostr
For detailed development guidelines, see [CLAUDE.md](./CLAUDE.md).