TypeScript Node.js Next.js .cursorrules prompt file
About .cursorrules prompt file
What you can build
Component Library Generator: A platform offering customizable UI components using Shadcn UI and Tailwind, empowering developers to generate reusable components following specific naming conventions and folder structures.
Next.js Project Boilerplate: Automatically generate a Next.js project setup with a predefined folder structure including
apps/web
,packages
, and server actions, fully integrated with TypeScript, Prisma, and Turborepo.Form Builder with Validation: An app that allows users to create forms using React Hook Form and Zod, ensuring type-safe validation synchronized across client and server, making form creation efficient and error-resistant.
API Call Manager: A tool that leverages swr for data fetching in Next.js apps, providing a dashboard interface to manage API requests and responses, including error handling and loading states.
Responsive Design Assistant: A web app utilizing Tailwind CSS to visually design responsive interfaces in a mobile-first approach, including integration with Shadcn UI components for cohesive styling across devices.
Server Action Scaffold Tool: A service that generates templates for Next.js server actions with type safety using Zod, aligning with pre-defined examples for error handling, validation, and response consistency.
Toast Notification Service: An easy-to-use solution for adding error and success toast notifications utilizing
toastError
andtoastSuccess
, customizable for any application adhering to the guide’s example structure.Database Schema Converter: Transform Prisma models into PostgreSQL schemas, ensuring seamless integration within a Node.js environment while maintaining updates with Turborepo workflows.
Image Optimization Platform: A utility built around
next/image
for optimizing and managing images in Next.js apps, focusing on performance and best practices in various loading conditions.Static Content Management: A microservice for managing and deploying static content files with guidelines for file placement and naming, improving organizational consistency across repositories.
Benefits
- Integrate Turborepo with pnpm workspaces; structure with
apps
andpackages
folders. - Utilize Shadcn UI and Tailwind for UI components; implement responsive, mobile-first design.
- Use Zod and React Hook Form for type-safe validation both client-side and server-side.
Synopsis
Developers building a full-stack application with a modern web tech stack like TypeScript, Node.js, Next.js, React, Prisma, PostgreSQL, can create scalable, type-safe, and well-structured applications, benefiting from the provided guidelines to improve code quality and maintainability.
Overview of .cursorrules prompt
The .cursorrules file provides guidelines for a development environment utilizing TypeScript, Node.js, Next.js, and React with various supporting libraries such as Prisma, PostgreSQL, Turborepo, Shadcn UI, Radix UI, and Tailwind. It emphasizes writing concise and accurate TypeScript code, using functional and declarative programming patterns, and favoring code modularization. It specifies best practices for file structuring, naming conventions, type safety, and error handling. The file also outlines the use of specific tools and libraries for tasks like API requests, server actions, and validation, promoting a consistent and efficient development workflow.