From 6fd1acc9993ff3a1088d3d80c0127ccdb6bacb44 Mon Sep 17 00:00:00 2001 From: ddshi <8811906+ddshi@user.noreply.gitee.com> Date: Tue, 10 Feb 2026 11:11:31 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0=20CLAUDE.md=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..290277c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,67 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +"掐日子" (Qia Rizi) - A Chinese calendar reminder app with anniversaries, reminders, and notes. Built with React 19 + TypeScript + Supabase. + +## Commands + +```bash +# Install dependencies +pnpm install + +# Start dev server +pnpm dev + +# Build for production +pnpm build + +# Run linting +pnpm lint + +# Preview production build +pnpm preview +``` + +## Architecture + +### Frontend (client/) +- **React 19 + TypeScript + Vite** - Core framework +- **Mantine UI v8** - Component library with custom Apple-inspired theme +- **Zustand** - State management with localStorage persistence +- **React Router v7** - Routing +- **Supabase** - Backend (auth, database) + +### Key Directories +- `src/pages/` - Route pages (HomePage, LoginPage, RegisterPage, SettingsPage, ArchivePage) +- `src/components/` - Reusable components, organized by feature +- `src/stores/` - Zustand store (useAppStore for global state) +- `src/services/` - API layer (supabase.ts, api.ts) +- `src/types/` - TypeScript type definitions +- `src/utils/` - Business logic utilities (repeatCalculator, countdown) + +### Data Model +- **Events**: Anniversary/Reminder items with repeat rules, lunar calendar support +- **Notes**: User's personal notes (HTML content) +- **AI Conversations**: Chat history with AI event parsing + +## Key Patterns + +### State Management +- Use `useAppStore` from `src/stores/index.ts` for global state (auth, events, notes) +- Store persists to localStorage via zustand/middleware + +### API Calls +- Direct Supabase calls via `services/supabase.ts` +- Auth token handling with automatic refresh in store's `checkAuth` + +### Components +- Custom date/time pickers in `src/components/common/` (FixedCalendar, WheelTimePicker) +- Event cards use context menus from `src/stores/contextMenu.ts` + +## Chinese Localization +- App uses Simplified Chinese (zh-cn) throughout +- dayjs configured with Chinese locale +- Mantine DatesProvider set to Chinese