TypeScript Node.js Express.js .cursorrules prompt file
About .cursorrules prompt file
What you can build
Authentication Management Service: Develop a web service that provides secure authentication mechanisms using Passport.js and JWT. This service can offer multi-factor authentication and manage user sessions with stateless tokens.
Modular Backend API Generator: Create a tool that helps developers generate a modular Node.js backend following best practices. It would include features like automatic creation of controllers, services, and models, with TypeScript typed interfaces.
Dynamic Form Builder: Build an application that allows users to create and manage forms with server-side validation using EJS. The forms would be styled with TailwindCSS and DaisyUI for a consistent visual theme.
Database Abstraction Layer Library: Develop a TypeScript library that provides a high-level abstraction over SQLite for Node.js applications. It should automatically handle prepared statements and provide easy-to-use methods for data querying.
Email Campaign Platform: Create a platform using Nodemailer and EJS templates to allow businesses to design, schedule, and send email campaigns. The platform should support user authentication and CSRF protection out of the box.
Responsive UI Component Library: Design a library of reusable UI components using TailwindCSS and DaisyUI, focusing on a mobile-first design. This library would help developers rapidly create responsive web applications.
Real-time Collaboration Tool: Develop a web application using Node.js and WebSockets for real-time collaboration, integrating authentication with Passport.js and session management. The tool can be used for editing documents or drawing collaboratively.
Secure Blogging Platform: Build a blogging platform that focuses on security with features like bcrypt password hashing and JWT authentication for user management. The platform should offer customizable EJS themes styled with TailwindCSS.
E-commerce Backend System: Design a backend system for e-commerce applications, implementing RESTful APIs with optimized SQLite queries and caching strategies. Include features for authentication, product management, and order processing.
Educational Code Lab: Develop an interactive online platform for learning TypeScript and Node.js with guided exercises and code challenges. The platform should use server-side rendered EJS views with user progress tracking via a secure authentication system.
Benefits
- Emphasizes concise and maintainable TypeScript code with clear separation of concerns, promoting clean architecture.
- Focuses on security and authentication best practices, ensuring secure applications with Passport.js, bcryptjs, and JWT.
- Incorporates TailwindCSS and DaisyUI for consistent UI/UX design backed by performance optimization strategies like caching and asynchronous operations.
Synopsis
Full-stack developers can create secure, efficient web applications with best practices, structured code, and consistent styling using TypeScript, Node.js, Express.js, EJS, SQLite, Passport.js, and TailwindCSS.
Overview of .cursorrules prompt
The .cursorrules file details coding and project structure guidelines for a TypeScript-based application using Node.js, Express.js, EJS, and various supporting libraries. It emphasizes best practices such as writing clean and maintainable TypeScript code, preferring interfaces over types, and using functional programming patterns. The file outlines naming conventions, syntax preferences, backend architecture, and security measures, including authentication with Passport.js and JWT, as well as password hashing with bcryptjs. Email functionality uses Nodemailer with EJS templates, and UI design leverages TailwindCSS and DaisyUI with a mobile-first approach. Performance is optimized through techniques like caching and asynchronous operations. The file also advises following RESTful principles, proper error handling, and consistent use of environment variables. It includes configuration guidelines for version control with .gitignore, ensuring exclusion of files like node_modules, environment-specific files, and IDE-specific files.