This is a React + Vite project with TypeScript, TailwindCSS, and shadcn/ui components. When working on this codebase, you must adhere to the established conventions and patterns.
CRITICAL: For ANY change related to the UI/UX, you MUST first refer to rules/design-system.md. This file contains the "Creator's Campus" aesthetic, approved component patterns, color usage, typography, and animation guidelines.
Do not invent new styles. Use the existing patterns defined in the design system.
Page Container Padding & Spacing:
- Mobile: px-3 py-4 (12px/16px)
- Small: sm:px-4 sm:py-5 (16px/20px)
- Medium: md:px-6 md:py-6 (24px/24px)
- Large: lg:px-8 lg:py-8 (32px/32px)
Card Component Padding:
- Mobile: p-3 (12px)
- Medium: md:p-4 (16px)
- Large: lg:p-6 (24px)
Grid Gaps:
- Mobile: gap-3 (12px)
- Medium: md:gap-4 (16px)
- Large: lg:gap-6 (24px)
Internal Spacing (space-y/space-x):
- Mobile: space-y-2 (8px)
- Medium: md:space-y-3 (12px)
Important: Implement Text Responsiveness in every UI development!
ALWAYS follow the structure and conventions defined in README.project-structure.md when:
- Creating new files or folders
- Organizing code modules
- Naming files, folders, functions, types, etc.
- Implementing features or routes
ALWAYS check the rules/ folder for specific implementation patterns before:
- Creating query hooks → See
rules/query-hooks.md - Creating mutation hooks → See
rules/mutation-hooks.md - Creating Zustand stores → See
rules/zustand-store.md - Implementing data access → See
rules/data-access-via-api.md - Creating service layers → See
rules/service-layer.md - Styling components → See
rules/styling.md - Implementing any feature that might have established patterns
When generating or modifying code:
- First, understand the existing patterns in the codebase
- Check if there are similar implementations to reference
- Follow the established naming conventions strictly
- Place files in the correct folders according to the project structure
- Use appropriate patterns based on complexity and requirements
- File/Folder naming:
kebab-case(use_kebab-casefor feature domains,-kebab-casefor route domains) - Types/Classes:
PascalCase - Functions/Variables/Zod Schemas:
camelCase - Database:
snake_casefor tables and columns - Package Manager: Always use
pnpm - State Management: Zustand
- Data Fetching: TanStack Query
- Routing: TanStack Router (file-based)
- Forms: React Hook Form + Zod
- Styling: TailwindCSS + shadcn/ui
- Testing: Vitest + Testing Library
Always:
- Read the relevant documentation in
README.project-structure.md - Check for existing patterns in
rules/folder - Look for similar implementations in the codebase
- Maintain consistency with existing code style
- Run type checking:
pnpm check:types - Run linting:
pnpm lint
Follow this checklist:
- Determine if it's a shared module, route domain, or feature domain
- Create the appropriate folder structure as defined in the project structure
- Follow the naming conventions for all files and exports
- Check rules folder for implementation patterns
- Use existing utilities and shared modules when possible
- Only create service layers when business logic is complex
- Write type-safe code using TypeScript
- Follow TailwindCSS conventions for styling
- Ensure proper error handling in data fetching
pnpm build- Build for productionpnpm test- Run testspnpm format- Format code with Prettierpnpm check:all- Run all checks concurrently for TypeScript, Lint and Check Spell
Remember: Consistency and adherence to established patterns is crucial for maintaining a clean, scalable codebase.