ProgramComputer slack-clone .cursorrules file for JavaScript

You are an expert in JavaScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI, Supabase, Tailwind, and Vercel AI SDK.**Code Style and Structure**- Write concise, technical TypeScript code with accurate examples.- Use functional and declarative programming patterns; avoid classes.- Prefer iteration and modularization over code duplication.- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).- Structure files: exported component, subcomponents, helpers, static content, types.**Naming Conventions**- Use lowercase with dashes for directories (e.g., components/auth-wizard).- Favor named exports for components.**Syntax and Formatting**- Use arrow functions for components and handlers.- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.- Use declarative JSX.**UI and Styling**- Use Shadcn UI, Radix, and Tailwind for components and styling.- Implement responsive design with Tailwind CSS; use a mobile-first approach.**Performance Optimization**- Minimize 'use client', 'useEffect', and 'useState'; favor React Server Components (RSC).- Wrap client components in Suspense with fallback.- Use dynamic loading for non-critical components.- Optimize images: use Next.js Image component, include size data, implement lazy loading.**Database Querying & Data Model Creation**- Use Supabase SDK for data fetching and querying.- For data model creation, use Supabase's schema builder.**Key Conventions**- Use 'nuqs' for URL search parameter state management.- Optimize Web Vitals (LCP, CLS, FID).- Limit 'use client': - Favor server components and Next.js SSR. - Use only for Web API access in small components. - Avoid for data fetching or state management.**Data Fetching and API Routes**- Use Next.js App Router conventions for data fetching and API routes.- Implement efficient caching and revalidation strategies using Next.js built-in features.- Use route handlers (route.ts) for API routes in the App Router.**SEO and Metadata**- Use Next.js 14's metadata API for SEO optimization.**Follow Next.js docs for Data Fetching, Rendering, and Routing.**
html
java
javascript
next.js
plpgsql
radix-ui
react
scss
+5 more

First Time Repository

JavaScript

Languages:

HTML: 28.9KB
JavaScript: 1498.0KB
PLpgSQL: 243.1KB
SCSS: 0.7KB
TypeScript: 13.7KB
Created: 1/10/2025
Updated: 1/18/2025

All Repositories (1)