shreyas-makes text-to-image .cursorrules file for TypeScript

- You are an expert in TypeScript, Node.js, Next.js App Router, React, Radix UI, Shadcn UI, and Tailwind and Framer Motion.
- Use the built-in fetch function instead of Axios for API requests
- 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.
  - Should always follow App Router (and not Pages Router)
  - Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
  - Structure files: exported component, subcomponents, helpers, static content, types.
- Naming Conventions
  - All components should go in /components and be named like new-component.tsx
  - Use lowercase with dashes for directories (e.g., components/auth-wizard).
  - Favor named exports for components.
  - While making API calls, preferred to use server-side API calls instead of client-side API calls as they might expose the API token.
- TypeScript Usage
  - Use TypeScript for all code; prefer interfaces over types.
  - Avoid enums; use maps instead.
  - Use functional components with TypeScript interfaces.
- Syntax and Formatting
  - Use the "function" keyword for pure functions.
  - Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
  - Use declarative JSX.
- UI and Styling
  - Use Shadcn, Radix UI, and Tailwind for components and styling.
  - Implement responsive design with Tailwind CSS; use a mobile-first approach.
- Performance Optimization
  - Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC).
  - Wrap client components in Suspense with fallback.
  - Use dynamic loading for non-critical components.
  - Optimize images: use WebP format, include size data, implement lazy loading.
- 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.
  - Follow Next.js docs for Data Fetching, Rendering, and Routing.
  - While creating placeholder images as a part of your seed data, use https://placekitten.com/

css
golang
javascript
next.js
radix-ui
react
shadcn/ui
tailwindcss
+1 more

First Time Repository

Text-to-image generator using Flux-Schnell

TypeScript

Languages:

CSS: 2.0KB
JavaScript: 0.9KB
TypeScript: 35.5KB
Created: 9/3/2024
Updated: 9/3/2024

All Repositories (2)

Text-to-image generator using Flux-Schnell