From 1d214110555c5436dc735c84772d696e137f710d Mon Sep 17 00:00:00 2001 From: songtianlun Date: Tue, 29 Jul 2025 09:10:00 +0800 Subject: [PATCH] update claude --- CLAUDE.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index b233766..88dd4df 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,4 +1,71 @@ -# 项目概况 +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Development Commands + +**Development server:** +```bash +npm run dev # Start development server on http://localhost:3000 +``` + +**Build and deployment:** +```bash +npm run build # Build production application +npm run start # Start production server +npm run lint # Run ESLint for code quality checks +``` + +**Database operations:** +```bash +npx prisma generate # Generate Prisma client after schema changes +npx prisma db push # Push schema changes to database +npx prisma studio # Open Prisma Studio database GUI +``` + +## Architecture Overview + +This is a **Next.js 15** application with **App Router** using: + +- **Authentication**: Supabase Auth with custom UI components +- **Database**: PostgreSQL via Supabase with Prisma ORM +- **Styling**: TailwindCSS v4 with custom theme system +- **State Management**: React Context for auth and theme +- **File Storage**: Configured for Cloudflare R2 (images) +- **Deployment**: Configured for Vercel + +### Key Architectural Decisions + +1. **Authentication Flow**: Supabase handles auth, middleware manages sessions, useAuth hook provides client state +2. **Database Design**: Prisma schema defines relationships between Users, Prompts, Versions, Tags, Albums, and TestRuns +3. **Theme System**: Custom ThemeProvider with localStorage persistence and system preference detection +4. **Component Structure**: Reusable UI components in `/components/ui/`, layout components in `/components/layout/` + +### Core Data Models + +The application centers around these main entities: +- **User**: Profile information and authentication +- **Prompt**: AI prompts with versioning and organization features +- **PromptVersion**: Version control for prompt iterations +- **PromptTag**: Categorization system +- **PromptAlbum**: Collection/organization system +- **PromptTestRun**: Testing and validation results + +### Environment Setup + +Required environment variables: +- `NEXT_PUBLIC_SUPABASE_URL` +- `NEXT_PUBLIC_SUPABASE_ANON_KEY` +- `DATABASE_URL` + +### Component Patterns + +- Use `'use client'` directive for interactive components +- Theme-aware components should use TailwindCSS dark mode classes +- Authentication state accessed via `useAuth()` hook +- Navigation handled through the Header component with mobile responsiveness + +## 项目概况 - Github: Prmbr - Domain: prmbr.com - Name: Prmbr - AI Prompt Studio