Solidity Next.js TypeScript .cursorrules prompt file
About .cursorrules prompt file
What you can build
Solidity DeFi Platform: Develop a decentralized finance platform using Solidity for smart contracts to enable users to lend, borrow and earn interest on cryptocurrency assets with high security and great UX.
React Component Library: Create a component library using React, TypeScript, Radix UI, and Tailwind Aria that simplifies building modern and accessible web applications with a consistent design system.
Next.js E-commerce Site: Build a robust e-commerce platform using Next.js 14 App Router for optimized performance, integrating payment gateways and a secure user authentication system.
Vite PWA Toolkit: Develop a Progressive Web App toolkit based on Vite that helps developers quickly bootstrap and deploy fast, responsive web applications with offline capabilities.
Node.js Microservices Framework: Implement a lightweight, TypeScript-based framework for building scalable and efficient microservices architecture using Node.js with a strong focus on error handling and validation.
AI-driven Code Review Bot: Create a browser extension or a VSCode plugin that assists developers by providing AI-driven reviews of their TypeScript and React code, suggesting best practices and improvements.
Dynamic Form Builder: Design an application using Zod validation and react-hook-form to create dynamic and adaptive forms for data collection, automatic validation, and error handling in real-time.
Crypto Wallet Dapp: Develop a cryptocurrency wallet decentralized application (Dapp) using Solidity, Viem, and Wagmi for seamless transaction handling and real-time balance updates.
Educational Coding Game: Create an interactive coding game that teaches Solidity and TypeScript programming through practical challenges, leveraging Next.js and React for an engaging user experience.
API Design Platform: Build a web-based platform that helps developers design, test, and document APIs using Node.js and TypeScript with auto-generated client code and responsive UI using Tailwind CSS.
Benefits
- Emphasis on functional, declarative programming with concise TypeScript examples and avoidance of classes.
- Prioritization of comprehensive error handling and edge case management with early returns and guard clauses.
- Extensive use of Next.js 14 App Router, along with Shadcn UI, Radix UI, and Tailwind Aria for responsive, accessible design.
Synopsis
Developers using the technologies and best practices outlined could build scalable, efficient, and responsive web applications with optimized performance and robust error handling in Next.js.
Overview of .cursorrules prompt
The .cursorrules file provides guidelines and best practices for developers working with Solidity, TypeScript, Node.js, Next.js 14 App Router, React, and related technologies. It emphasizes concise, technical responses, and TypeScript examples, leveraging functional programming and avoiding class-based approaches. Key principles include using descriptive naming conventions, favoring iteration over duplication, employing named exports, and adhering to the RORO pattern. In JavaScript/TypeScript, it suggests the use of TypeScript, the "function" keyword for pure functions, interfaces over types, and optimizing file structures. The file also outlines error handling strategies, encouraging early error detection, use of guard clauses, and custom error types for consistency. For React/Next.js, the file recommends the use of functional components, mobile-first responsive design, and optimizing images. It highlights the importance of using tools like Shadcn UI, Radix, and Tailwind Aria for styling, minimizing 'use client' usage, and implementing error boundaries and robust form validation with libraries like Zod and react-hook-form. Key conventions focus on using Next.js App Router for state changes, prioritizing Web Vitals, and consulting Next.js documentation for best practices.