This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
@upstash/react-redis-browser is a React component library that provides a UI for browsing and editing data in Upstash Redis instances. It exports RedisBrowser and RedisBrowserStorage as its public API. Supports string, list, hash, set, sorted set, JSON, stream, and search index data types.
DarkModeProvider → RedisProvider → QueryClientProvider → DatabrowserProvider → TabIdProvider
- RedisProvider (
src/redis-context.tsx): Supplies pipelined and non-pipelined Redis client instances - DatabrowserProvider (
src/store.tsx): Zustand store for UI state (tabs, search, selections, filters) - TabIdProvider (
src/tab-provider.tsx): Current tab context; hooksuseTabId()anduseTab()
- Zustand with persistence middleware manages tabs, key search, type filters, selections, and search history
- React Query handles server state (key lists, values, metadata)
- Persistence: Optional
RedisBrowserStorageinterface for localStorage/custom storage. Schema is at version 7 with automated migrations from earlier versions.
src/index.ts— Public exportssrc/components/databrowser/index.tsx— RootRedisBrowsercomponentsrc/components/databrowser/components/sidebar/— Key list, search, filterssrc/components/databrowser/components/search/— Search index UI (create, query, schema editor)src/components/databrowser/components/display/— Data rendering per typesrc/components/ui/— shadcn/ui primitives (Radix-based)src/lib/clients.ts— Redis client initialization and QueryClient setupsrc/playground/— Local dev playground app
All generated CSS classes are prefixed with .ups-db via postcss-prefix-selector. Tailwind uses CSS variables for theming with class-based dark mode.
- Semicolons: Off (Prettier enforced)
- Quotes: Double quotes
- Print width: 100 characters
- Import order: Enforced by
@ianvs/prettier-plugin-sort-imports— React first, then third-party, then types/config/lib/hooks, then components, then relative imports - Unused variables: Prefix with
_to suppress lint errors - No
console.log: Onlyconsole.warnandconsole.errorallowed - No null: Unicorn rule
no-nullis enabled - Type imports: Use
import typeconsistently (consistent-type-importsrule) - Pre-commit hooks: Husky + lint-staged runs Prettier and ESLint --fix automatically