vikaswakde mitralist .cursorrules file for TypeScript (stars: 1)

You are an expert developer proficient in TypeScript, React, TailwindCSS and Next.js, Supabase, Zod, Zustand, TanStack React Query

Authentication

- for this project we are going to use Clerk.dev for our authetication

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 with exported components, subcomponents, helpers, static content, and types.
- Favor named exports for components and functions.

TypeScript and Zod Usage

- Use TypeScript for all code; prefer interfaces over types for object shapes.
- Utilize Zod for schema validation and type inference.
- Implement functional components with TypeScript interfaces for props.

Syntax and Formatting

- Use the `function` keyword for pure functions.
- Write declarative JSX with clear and readable structure.

UI and Styling

- Implement responsive design with a mobile-first approach.
- Ensure styling consistency between web and native applications.

State Management and Data Fetching

- Use Zustand for state management.
- Use TanStack React Query for data fetching, caching, and synchronization.

Error Handling and Validation

- Prioritize error handling and edge cases.
- Handle errors and edge cases at the beginning of functions.

- Utilize guard clauses to handle preconditions and invalid states early.
- Implement proper error logging and user-friendly error messages.
- Use custom error types or factories for consistent error handling.

Performance Optimization

- Optimize for both web and mobile performance.

Backend and Database

- Use Supabase for backend services, including authentication and database interactions.
- Follow Supabase guidelines for security and performance.
- Use Zod schemas to validate data exchanged with the backend.
- We are going to use Uploadthing to store our images

Key Conventions

- Ensure code is clean, well-documented, and follows the project's coding standards.
- Implement error handling and logging consistently across the application.

Follow Official Documentation

- Adhere to the official documentation for each technology used.
- For Next.js, focus on data fetching methods and routing conventions.
- Stay updated with the latest best practices and updates if needed search web.

Output Expectations

- Code Examples Provide code snippets that align with the guidelines above.
- Explanations Include brief explanations to clarify complex implementations when necessary.
- Clarity and Correctness Ensure all code is clear, correct, and ready for use in a production environment.
- Best Practices Demonstrate adherence to best practices in performance, security, and maintainability.
clerk
css
golang
javascript
next.js
react
supabase
tailwindcss
+2 more

First Time Repository

A social media platform with Best UI/UX design inspired by Peerlist (In development)

TypeScript

Languages:

CSS: 2.0KB
JavaScript: 0.2KB
TypeScript: 30.2KB
Created: 12/2/2024
Updated: 12/10/2024

All Repositories (1)

A social media platform with Best UI/UX design inspired by Peerlist (In development)