TypeScript Next.js React .cursorrules prompt file
About .cursorrules prompt file
What you can build
Monorepo Management Tool for TypeScript Projects: Develop a tool or service to automate the setup and management of TypeScript monorepos using Lerna or Nx, with preset configurations for
express-services
,nextjs-apps
, andreact-vite-apps
.Tailwind CSS Component Library: Create a shared component library using Shadcn UI, Radix UI, and Tailwind that can be integrated into Next.js and React Vite apps for consistent UI styling across a monorepo.
TypeScript Interface Sharing Service: A tool for sharing and managing TypeScript interfaces and types across multiple services within a monorepo, ensuring consistency and reducing duplication.
Online Linter and Formatter for Consistent Code Style: Provide a web-based service that automatically applies consistent Prettier and ESLint configurations based on these guidelines for typescript codebases.
CI/CD Workflow for Monorepos using GitHub Actions: Develop a pre-configured CI/CD pipeline template using GitHub Actions to automate testing, integration, and deployment across complex monorepo structures.
Next.js API Optimization Service: Create a service for optimizing Next.js API performance that implements caching strategies, rate limiting, and dynamic loading of components.
Responsive Design Checker: A tool that tests and ensures all components in Next.js and React Vite apps adhere to responsive design principles using a mobile-first approach with Tailwind CSS.
Database Management Console for MongoDB with Mongoose: Develop a tool to visually manage MongoDB objects using Mongoose schema abstraction, providing an intuitive interface for database operations within TypeScript monorepos.
REST API Documentation Generator: Offer a service that automatically generates and updates REST API documentation conforming to OpenAPI specifications, integrated with Express.js services.
Automated Codebase Analyzer for Performance Metrics: Provide a tool that analyzes a monorepo's codebase to identify and suggest optimizations related to Web Vitals like LCP, CLS, and FID.
Functional Programming Playground for TypeScript: An interactive platform for learning and experimenting with functional and declarative programming patterns in TypeScript as outlined in the guidelines.
Environment Variable Configuration Manager: A service that securely manages and injects environment variables into multiple services within a monorepo, useful for handling configuration in Express, Next.js, and Vite environments.
Error Handling Middleware Pack for Express: Develop a collection of pre-built middleware for common error handling, logging, and authentication functionalities to plug into Express services.
SEO and Performance Optimization Tool for Next.js Apps: A service to analyze SEO and performance metrics for Next.js applications, providing actionable recommendations to optimize server components.
Automated Test Coverage Analyzer: Develop a service that integrates with Jest and React Testing Library to provide a comprehensive report on test coverage across different ts services in a monorepo.
Benefits
- Comprehensive monorepo structure, leveraging Lerna or Nx for efficient management, versioning, and script execution across packages.
- Enforces a mobile-first, responsive strategy utilizing Shadcn UI, Radix, and Tailwind for consistent styling.
- Emphasizes performance with React Server Components, dynamic loading, and comprehensive caching for API responses.
Synopsis
Developers creating a scalable and maintainable TypeScript-based monorepo with multiple services would benefit, enabling them to standardize structure, coding style, and optimize performance using these guidelines.
Overview of .cursorrules prompt
The .cursorrules file provides a comprehensive set of TypeScript development guidelines for a monorepo project with multiple services. It covers a variety of areas essential for efficient development within a monorepo, including monorepo structure and management, code style, naming conventions, TypeScript usage, syntax and formatting, UI styling, performance optimizations, API development, database integration, and service-specific guidelines for Express services, Next.js apps, and React with Vite apps. Additionally, it details testing and quality assurance practices, as well as documentation standards to ensure consistency and maintainability across the entire project. The guidelines emphasize modern engineering practices such as functional programming, shared configurations, and the use of consistent naming and styling conventions.