From cc1c18d55f7c85c57ba90fda1d88d2c9201b08e6 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 5 Jun 2025 13:00:30 -0700 Subject: [PATCH] Update context file --- CLAUDE.md | 52 +++++++++------------------------------------------- 1 file changed, 9 insertions(+), 43 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f901715..e2149e5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,60 +1,26 @@ -# CLAUDE.md - -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. - ## Project Overview Flotilla is a Discord-like Nostr client that operates on the concept of "relays as groups/spaces." Built with SvelteKit 2.5 and Svelte 5, it provides messaging, threads, calendar events, and social features across Nostr relays. -## Architecture - -### Core Technology Stack -- **SvelteKit 2.5 + Svelte 5** - Reactive UI framework with runes -- **Welshman Libraries** - Comprehensive Nostr toolkit (@welshman/app, @welshman/net, @welshman/signer, etc.) -- **TailwindCSS + DaisyUI** - Utility-first styling with component library -- **Capacitor 7** - Cross-platform mobile deployment -- **TypeScript** - Full type safety throughout - -### State Management Patterns -- Svelte stores with Welshman reactive patterns -- Repository pattern for Nostr event storage with 10k event limit -- Derived stores for computed values and real-time updates -- Event-based architecture with reactive data flow - ## Important Patterns ### Finding Code - Prefer navigating from one file to the next following imports when possible - If search is necessary, use `ack`, not `grep` or `rg`. -### Component Organization -- Components are organized by feature (Chat, Calendar, Profile, Space) -- Use existing components from `/lib/components/` before creating new ones -- Follow the established naming convention (PascalCase, descriptive names) - -### Routing Structure -- Dynamic routes: `/spaces/[relay]/[room]` for relay-based navigation -- All routes use the `+layout.svelte` for app shell and initialization -- Route helpers in `/src/app/routes.ts` for URL generation - ### Nostr Event Handling -- Events flow through the repository pattern in `state.ts` -- Use Welshman utilities for event validation and parsing -- Handle both plain and gift-wrapped events for privacy - Prefer seconds to milliseconds when handling nostr events. ### Styling Conventions -- TailwindCSS with DaisyUI components -- Dark/light theme support via CSS custom properties -- Responsive design with mobile-first approach -- Custom color scheme configurable via environment variables - When styling html, prefer flex/gap classes over margin or space-y classes. -## Testing Notes -This project does not include formal testing infrastructure. Code quality is maintained through TypeScript strict mode, ESLint, Prettier, and Svelte compiler validation. +### Room/space memberships -## Performance Considerations -- Event storage is limited to 10k events with ranking system -- Components use lazy loading patterns -- Large lists should implement virtualization -- Image proxy optimization for external content +Memberships are surfaced as "bookmarks" to the user. + +```typescript +import {membershipsByPubkey, getMembershipUrls} from '@app/state' + +const spaces = getMembershipUrls($membershipsByPubkey.get(pubkey)) +const rooms = getMembershipRooms($membershipsByPubkey.get(pubkey)) +```