No description
Find a file
padreug 0da23e9332 Replace complex UnreadMessageData system with elegant path-based wildcard notification tracking inspired by Coracle's pattern. This simplifies the codebase while adding powerful batch "mark as read" capabilities.
Key changes:
  - Add notification store with path-based wildcard support (chat/*, chat/{pubkey}, *)
  - Remove UnreadMessageData interface and processedMessageIds Set tracking
  - Implement timestamp-based "seen at" logic with wildcard matching
  - Add markAllChatsAsRead() for batch operations
  - Integrate ChatNotificationConfig for module configuration
  - Create useNotifications composable for easy notification access

  Benefits:
  - Simpler architecture (removed processedMessageIds complexity)
  - Flexible wildcard-based "mark as read" operations
  - Future-proof for Primal-style backend sync
  - User-scoped storage via StorageService
  - Clean separation of concerns

refactor: enhance chat service with activity tracking and sorting

- Updated the ChatService to track lastSent, lastReceived, and lastChecked timestamps for peers, improving message handling and user experience.
- Implemented sorting of peers by last activity to prioritize recent conversations.
- Adjusted message handling to update peer activity based on message direction.
- Ensured updated peer data is saved to storage after modifications.

These changes streamline chat interactions and enhance the overall functionality of the chat service.

refactor: improve ChatService and notification store initialization

- Updated ChatService to ensure the notification store is initialized only after user authentication, preventing potential errors.
- Introduced a new method to safely access the notification store, enhancing error handling.
- Enhanced peer activity tracking by calculating last activity based on actual message timestamps, improving sorting and user experience.
- Added debounced saving of notification state to storage, optimizing performance and reducing unnecessary writes.
- Improved logging for better debugging and visibility into notification handling processes.

These changes enhance the reliability and efficiency of the chat service and notification management.

refactor: clean up logging in ChatService and notification store

- Removed unnecessary console logs from ChatService to streamline the code and improve performance.
- Simplified the initialization process of the notification store by eliminating redundant logging statements.
- Enhanced readability and maintainability of the code by focusing on essential operations without excessive debug output.

These changes contribute to a cleaner codebase and improved performance in chat service operations.

FIX BUILD ERRORS

refactor: update chat module notification configuration

- Refactored the notification settings in the chat module to use a nested structure, enhancing clarity and organization.
- Introduced `wildcardSupport` to the notification configuration, allowing for more flexible notification handling.
- Maintained existing functionality while improving the overall configuration structure.

These changes contribute to a more maintainable and extensible chat module configuration.

refactor: optimize ChatComponent and ChatService for improved performance

- Removed unnecessary sorting of peers in ChatComponent, leveraging the existing order provided by the chat service.
- Updated the useFuzzySearch composable to directly utilize the sorted peers, enhancing search efficiency.
- Cleaned up logging in ChatService by removing redundant console statements, streamlining the codebase.
- Added critical checks to prevent the current user from being included in peer interactions, improving user experience and functionality.

These changes contribute to a more efficient and maintainable chat module.

refactor: simplify message publishing in ChatService

- Removed unnecessary variable assignment in the message publishing process, directly awaiting the relayHub.publishEvent call.
- This change streamlines the code and enhances readability without altering functionality.

These modifications contribute to a cleaner and more efficient chat service implementation.
2025-10-04 10:29:22 +02:00
.vscode initial post-installation commit 2025-01-30 13:26:56 +01:00
docs Enhance README and wallet module documentation with new payment features 2025-09-20 10:31:12 +02:00
electron chore: Set up Electron configuration and update dependencies 2025-03-20 17:26:15 +01:00
public Update index.html and vite.config.ts for dynamic app name and manifest adjustments 2025-09-06 19:16:24 +02:00
src Replace complex UnreadMessageData system with elegant path-based wildcard notification tracking inspired by Coracle's pattern. This simplifies the codebase while adding powerful batch "mark as read" capabilities. 2025-10-04 10:29:22 +02:00
.cursorrules update cursor rules to follow semantic/theme aware color patterns 2025-08-14 15:19:13 +02:00
.env.example feat: implement image upload functionality with new components and service 2025-09-28 04:08:41 +02:00
.gitignore add .obsidian 2025-09-14 17:16:52 +02:00
CLAUDE.md FIX: CRITICAL use nullish coalescing for product quantity in useMarket composable 2025-10-02 09:43:16 +02:00
components.json update shadcn/tailwind config 2025-03-09 15:40:32 +01:00
forge.config.js chore: Set up Electron configuration and update dependencies 2025-03-20 17:26:15 +01:00
index.html Update index.html and vite.config.ts for dynamic app name and manifest adjustments 2025-09-06 19:16:24 +02:00
nginx.conf.example add nginx.conf example 2025-07-12 19:06:09 +02:00
package-lock.json Add QR code scanning functionality with new QRScanner component 2025-09-18 23:01:01 +02:00
package.json Add QR code scanning functionality with new QRScanner component 2025-09-18 23:01:01 +02:00
README.md Enhance README and wallet module documentation with new payment features 2025-09-20 10:31:12 +02:00
tailwind.config.js refactor: Update color definitions in Tailwind configuration to use oklch color space 2025-08-03 11:20:57 +02:00
test-formatting.html feat: Enhance RelayHub component with subscription count details (still not working) 2025-08-10 18:19:18 +02:00
tsconfig.app.json update shadcn/tailwind config 2025-03-09 15:40:32 +01:00
tsconfig.json initial post-installation commit 2025-01-30 13:26:56 +01:00
tsconfig.node.json initial post-installation commit 2025-01-30 13:26:56 +01:00
vite.config.ts Update index.html and vite.config.ts for dynamic app name and manifest adjustments 2025-09-06 19:16:24 +02:00

Ario Web App

A modular Vue 3 + TypeScript application with Nostr protocol integration and Lightning Network wallet functionality.

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:

  • Lightning Invoice Creation: Create BOLT11 invoices for receiving payments with QR codes
  • Smart Payment Scanning: QR code scanner for Lightning invoices, LNURL, and Lightning addresses
  • Universal Payment Support: Send to Lightning invoices, Lightning addresses (user@domain.com), and LNURL
  • Smart Amount Fields: Amount input only appears when needed (LNURL, Lightning addresses, or zero-amount invoices)
  • 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:

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

# 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:

# 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.