Next.js React TypeScript .cursorrules prompt file
About .cursorrules prompt file
What you can build
Decentralized Finance (DeFi) Dashboard: Create a web application that uses Solidity for smart contract interactions and displays real-time analytics of a user's DeFi portfolio using Next.js for SSR and Radix UI for component design.
Tokenized Asset Marketplace: Develop a platform where assets are tokenized using Solidity, and users can trade them. Use Next.js with server-side rendering for a fast user experience and Wagmi for Ethereum integration.
NFT Collection Viewer: Build an app that allows users to view their NFT collections by connecting their wallets. Utilize TypeScript for type safety and Shadcn UI for a responsive design.
Automated Solidity Code Review Tool: Create a service that analyzes Solidity code for potential vulnerabilities and optimizations, providing feedback with concise examples. Use Node.js for the backend processing.
Collaborative Coding Environment with Compiler Features: Develop a real-time collaborative coding platform that supports Solidity, TypeScript, and other languages. Use Vite for fast builds and Tailwind CSS for a seamless design.
Web3 Community Platform: Create an interactive platform for web3 enthusiasts to share knowledge and projects. Integrate Solidity-based smart contracts for user reputation and use Next.js for a dynamic content experience.
Dynamic Form Builder with Zod Validation: Build an application for creating customizable web forms that leverage Zod for type validation. Use React and Tailwind Aria for styling, ensuring accessibility and responsiveness.
Cryptocurrency Wallet Application: Develop a secure wallet application using TypeScript and React for interacting with various blockchain networks. Implement Viem for efficient Ethereum operations and Tailwind CSS for UI design.
Blockchain-Based Voting System: Create a decentralized voting platform using Solidity for managing elections securely. Use Next.js for the frontend interface and ensure dynamic component loading for a smooth experience.
Interactive Tutorials for Learning Solidity: Build an educational platform offering guided Solidity coding tutorials, featuring live code execution. Use Node.js for the backend and implement interactive UI components with Radix.
Benefits
- Emphasizes functional, declarative programming with concise technical TypeScript examples, using interfaces over types and avoiding classes.
- Prioritizes error handling with early returns, guard clauses, and custom errors; promotes consistent error handling with ActionResponse in Next.js.
- Enhances responsive design using Tailwind CSS and mobile-first approach; optimizes images with WebP, lazy loading, and minimizes client-side hooks.
Synopsis
Developers building Next.js applications with TypeScript and React who want to implement efficient error handling, responsive design, and optimized server/client interactions will benefit from this prompt.
Overview of .cursorrules prompt
The .cursorrules file outlines comprehensive guidelines for developers working with technologies including Solidity, TypeScript, Node.js, Next.js, React, and several UI and styling frameworks. It emphasizes writing concise and accurate TypeScript code using functional, declarative programming paradigms. Key principles include module reuse, descriptive naming conventions, and a preference for named exports. The file provides specific structure and syntax recommendations for JavaScript/TypeScript, enforces robust error handling, and advocates for using certain tools and libraries for UI development. For React/Next.js applications, it prescribes functional components, mobile-first responsive design, and best practices for state management and error handling. Furthermore, it highlights conventions for server actions, using Zod for validation, and strategies for optimizing performance and handling errors. The file also stresses adhering to Next.js documentation for best practices in data fetching and rendering.