This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Hypergraph is a local-first framework for building web3 consumer applications that focuses on privacy-preserving apps with interoperable data using the GRC-20 standard. The project is currently in Developer Preview status.
# Run specific apps
cd apps/events && pnpm dev # Events demo app
cd apps/privy-login-example && pnpm dev # Privy login example app
cd apps/server && pnpm dev # Backend sync server
cd apps/connect && pnpm dev # Geo Connect auth apppnpm test # Run all tests with Vitest
vitest # Direct vitest usage
vitest run path/to/test.ts # Run specific test filepnpm lint # Check code with Biome
pnpm lint:fix # Auto-fix linting issues
pnpm check # TypeScript type checkingpnpm db:migrate:dev # Run database migrations
pnpm db:studio # Open Prisma Studiopnpm build # Build all packages and apps
pnpm clean # Clean all build artifacts- packages/ - Core libraries
hypergraph/- Main SDK with entity management, encryption, spaces, and inboxeshypergraph-react/- React hooks and componentscreate-hypergraph/- Project scaffolding tool
- apps/ - Complete applications
server/- Backend sync server (Express + Prisma + SQLite/PostgreSQL)events/- Demo app showcasing the framework (Vite + React)privy-login-example/- Privy login example app (Vite + React)connect/- Geo Connect authentication appnext-example/- Next.js integration example
- docs/ - Docusaurus documentation site
-
Local-First with CRDTs
- Uses Automerge for conflict-free replicated data types
- Offline-capable with sync when online
- Data stored locally with optional server sync
-
Privacy-Preserving
- Client-side encryption/decryption
- Uses Noble cryptographic libraries
- Secure key management patterns
-
Space-Based Organization
- User data organized in "spaces" (private/public)
- Each space has its own encryption keys
- Spaces can be shared with other users
-
Identity Management
- Ethereum-based authentication with Privy
- Smart account support via Permissionless
-
Knowledge Graph (GRC-20)
- Structured data format for interoperability
- Entity-based data model
- Schema-driven development with TypeSync
- TypeScript with strict mode
- Effect for functional programming patterns
- React for UI applications
- Automerge for CRDT implementation
- Viem for Ethereum interactions
- Prisma for database ORM
- GraphQL for API queries
- Biome for linting/formatting
-
Effect Usage
- Use Effect for error handling and async operations
- Prefer functional patterns with immutable data
- Use Effect testing utilities in tests
-
Module Structure
- Each module exports clear public API
- Use barrel exports (index.ts)
- Separate concerns by feature
-
Testing Strategy
- Tests in
./testdirectories - Test both success and error scenarios
- Mock external dependencies appropriately
- Tests in
-
Type Safety
- Use branded types for domain identifiers
- Discriminated unions for state management
- Strict TypeScript configuration
-
Naming Conventions
- snake_case for service names and API endpoints
- camelCase for variables and functions
- PascalCase for types and components