From d3e61d2ad418d4a28b7e675d7b8c608f8320e8aa Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sat, 12 Apr 2025 22:35:32 +0000 Subject: [PATCH] add cursor rules group #1 --- .cursorrules | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .cursorrules diff --git a/.cursorrules b/.cursorrules new file mode 100644 index 0000000..a747aad --- /dev/null +++ b/.cursorrules @@ -0,0 +1,26 @@ +# Cursor Rules - Group 1: Development Philosophy & Coding Conventions + +1. Overall Architecture & Structure: + - Enforce a clear separation of concerns between the backend (Express, Passport, Swagger-documented API routes, service layers, and configuration files) and the frontend (Next.js with React and TypeScript, using functional components, hooks, and proper layouts). + - Ensure that backend modules (routes, services, helpers) and frontend components (pages, components, layouts) are organized for reusability and maintainability. + +2. Coding Style & Formatting: + - For the backend (JavaScript): + • Use ES6+ features (const/let, arrow functions) consistently. + • Follow Prettier and ESLint configurations (e.g., consistent 2-space indentation, semicolons, and single quotes). + • Maintain clear asynchronous patterns with helper wrappers (e.g., wrapAsync) for error handling. + • Document API endpoints with inline Swagger comments to ensure API clarity and consistency. + - For the frontend (TypeScript/React): + • Use functional components with strict typing and separation of concerns. + • Follow naming conventions: PascalCase for components and types/interfaces, camelCase for variables, hooks, and function names. + • Utilize hooks (useEffect, useState) to manage state and lifecycle in a clear and concise manner. + +3. Code Quality & Best Practices: + - Ensure code modularity by splitting complex logic into smaller, testable units (e.g., dedicated route handlers, service functions, and reusable UI components). + - Write self-documenting code and add comments where the logic is non-trivial, especially for asynchronous operations. + - Embrace declarative programming and adhere to SOLID principles, making sure that responsibilities are clearly delineated between layers. + +4. Consistency & Tools Integration: + - Leverage existing tools like Prettier and ESLint to automatically enforce style and formatting rules in both backend and frontend codebases. + - Use TypeScript in the frontend to ensure type safety and catch errors early in the development cycle. + - Maintain uniformity in API design and error handling strategies (e.g., consistent use of passport for authentication and common error handling middleware). \ No newline at end of file