TypeScript Next.js React Tailwind Supabase .cursorrules prompt file
About .cursorrules prompt file
What you can build
Code Quality Analysis Tool: An online platform that analyzes TypeScript code for adherence to predefined conventions, such as function declaration preference, naming conventions, and usage of interfaces over types. It provides detailed feedback and suggestions for improvements.
Next.js Optimization Platform: A tool that helps optimize Next.js applications with a focus on server components, lazy loading, and minimizing the use of client-side effects. This platform could provide actionable insights and recommendations for performance improvements.
Responsive Design Assistant: A web app that integrates with Tailwind CSS to assist developers in creating responsive UIs. It provides templates and style guides aligned with mobile-first design principles, using Radix UI and Shaden VI components.
Supabase Schema Builder: A graphical user interface tool for creating and managing database schemas in Supabase. It visualizes the structure and relationships within a database, making it easier for developers to build data models.
TypeScript Interface Generator: An application that automatically generates TypeScript interfaces from JSON objects or database schemas, emphasizing the use of interfaces rather than types and avoiding enums.
Web Performance Tracker: A service that monitors and provides analytics on web vitals (LCP, CLS, FID) for applications, offering specific strategies to improve load times, rendering, and user interaction metrics.
React Component Suspense Wrapper: A component library that helps developers easily wrap React components in Suspense, providing customizable loading states and fallbacks.
Dynamic Component Loader: A next.js plugin that optimizes application performance by dynamically loading non-critical components based on user interaction or other triggers, reducing initial load times.
Image Optimization Service: A web-based utility that converts images to WebP format, includes size data, and implements lazy loading for integration into web projects, enhancing page load performance.
State Management Helper: A tool for managing search parameters and state using hooks that align with the key conventions of limiting client-side data fetching and state management, adhering to the principles of Next.js and server-side rendering.
Benefits
- Emphasizes functional and declarative TypeScript patterns, avoiding classes, with concise, technical code.
- Utilizes Radix UI, Tailwind for responsive design, focusing on mobile-first with optimization strategies.
- Advocates for Supabase for database queries and state management with practical conventions like "nugs."
Synopsis
Developers building modern web applications using TypeScript, React, and Next.js would benefit by establishing a clear, concise coding standard and optimization practices, enhancing the application's performance and maintainability.
Overview of .cursorrules prompt
The .cursorrules file outlines best practices and conventions for developing applications using TypeScript, Node.js, Next.js, React, and associated tools like Radix UI and Tailwind CSS. It emphasizes concise, technical TypeScript code using functional programming patterns while avoiding classes and code duplication. It suggests naming conventions, such as using lowercase with dashes for directories, and favors interfaces over types and enums. The file also details performance optimization strategies, including minimizing client-side state and using React Server Components and dynamic loading. For database interactions, it recommends Supabase for data fetching and schema management. Additionally, it provides guidance on responsive design, leveraging Tailwind CSS, and optimizing web vitals.