This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
pnpm dev- Start development server with Turbopackpnpm devsafe- Clean .next directory and start development serverpnpm build- Build for production (includes dependency checking and graph generation)pnpm lint- Run ESLintpnpm start- Start production server
pnpm generate:types- Generate TypeScript types for PayloadCMS collectionspnpm generate:importmap- Generate import map for PayloadCMSpnpm payload- Run PayloadCMS CLI commands
This project does not currently have a test framework configured. When implementing tests, check the README or ask the user for the preferred testing setup.
- Framework: Next.js 15 with App Router
- Frontend: React 19, Tailwind CSS v4, Framer Motion
- Backend: Next.js API Routes, PayloadCMS as headless CMS
- Database: PostgreSQL via Vercel Postgres
- Package Manager: pnpm (required - do not use npm or yarn)
- Node Version: 22.14+ or 24.0+
src/
├── app/
│ ├── (frontend)/ # Frontend application
│ │ ├── components/ # React components organized by feature
│ │ ├── pages/ # Page components
│ │ ├── api/ # Frontend API routes
│ │ ├── hooks/ # Custom React hooks
│ │ ├── providers/ # React context providers
│ │ └── utils/ # Utility functions
│ └── (payload)/ # PayloadCMS admin and API
├── collections/ # PayloadCMS data models
└── payload.config.ts # PayloadCMS configuration
- Users: Authentication with role-based access (admin/user)
- Media: File uploads with S3 storage
- Posts: Blog posts with rich text content
- GuestBookComments: Visitor comments with moderation
- UberComments: Service reviews with ratings
Components are organized by feature in src/app/(frontend)/components/:
common/- Reusable UI components and layoutsanimation/- Framer Motion animationsgames/- Interactive games (TypoSync, Dino)tools/- Utility tools (background remover, image converter)guest-book/- Guest book functionalityuber/- Uber delivery service portfoliowelcome/- Welcome page with AI chat bot
- Tailwind CSS v4: Primary styling framework
- CSS Modules: Component-specific styles (use .module.css extension)
- CSS Variables: Theme system in globals.css with dark mode support
- Framer Motion: Animations and interactions
- React Context: Global state management
- TanStack React Query: Server state and caching
- Zustand: Complex state management where needed
- React hooks: Local component state
ai-chat/- AI chat bot with JWT authenticationcontact/- Contact form handlinggithub/- GitHub API integrationwakatime/- WakaTime code statisticsweather/- Weather data integrationquery-functions/- Data fetching utilities
- REST API at
/api/[...slug] - GraphQL API at
/api/graphql - Admin panel at
/admin
- Cloudflare Turnstile: Spam protection
- JWT Authentication: AI chat security
- Input Validation: Zod schemas for all API inputs
- XSS Protection: Input sanitization with DOMPurify
- Use TypeScript with explicit typing
- Group imports: external libraries first, then internal
- Use barrel exports (
index.ts) for cleaner imports - Keep components focused on single responsibility
'use client' // For client components
import { ExternalLibrary } from 'external-library'
import { InternalComponent } from '@/frontend/components/common'
import styles from './Component.module.css'
interface ComponentProps {
// Explicit prop types
}
export default function Component({ prop }: ComponentProps) {
// Component logic
}- Use Tailwind utility classes for standard styling
- Use CSS modules for component-specific styles
- Follow theme system for colors and spacing
- Use CSS variables for consistent theming
- Use Framer Motion for page transitions and interactions
- Common patterns:
initial,animate,transition,whileHover - Implement scroll-based animations with
useScrollanduseTransform
- Use React.memo for expensive components
- Implement proper dependency arrays in useEffect/useMemo
- Use Next.js Image component for optimized images
- Implement code splitting via dynamic imports
# Database
POSTGRES_URL=your_database_url
# PayloadCMS
PAYLOAD_SECRET=your_payload_secret
# Security
TURNSTILE_SECRET_KEY=your_turnstile_secret
NEXT_PUBLIC_TURNSTILE_SITE_KEY=your_turnstile_site_key
# S3 Storage
S3_BUCKET=your_s3_bucket
S3_ACCESS_KEY_ID=your_access_key
S3_SECRET_ACCESS_KEY=your_secret_key
S3_REGION=your_region
# AI Chat (Optional)
AI_CHAT_JWT_SECRET=your_jwt_secret
N8N_WEBHOOK_URL=your_n8n_webhook_url- Use
docker-compose up -dfor local PostgreSQL - Update
POSTGRES_URLin .env for Docker setup
- Terminal-style interface in
/welcome - JWT authentication with Turnstile verification
- Markdown response support
- Command system with help utilities
- TypoSync: Rhythm-based typing game with audio analysis
- Dino Game: Chrome dinosaur game recreation
- Background Remover: AI-powered image background removal
- Image Converter: Multi-format image conversion
- File Type Detector: Advanced file type detection
- Guest Book: Visitor comment system with moderation
- Uber Portfolio: Delivery service showcase with reviews
- GitHub Integration: Real-time repository statistics
- WakaTime Integration: Coding activity visualization
The build command includes:
- Dependency checking with depcheck
- Dependency graph generation with dependency-cruiser
- Next.js production build
- Type checking and optimization
- Always use pnpm for package management
- PayloadCMS admin panel is at
/admin - Frontend routes are under the
(frontend)route group - All API routes include proper error handling and validation
- Images are optimized using Next.js Image component with Sharp
- The project uses Node.js 22.14+ or 24.0+ with specific pnpm build dependencies