Cursor Rules TemplatesCursor Rules Template

Cursor Rules Template: Ecommerce AI Review Analysis Tool

Cursor Rules Template for building an AI-powered product review analysis tool for ecommerce SMEs using Node.js/TypeScript, PostgreSQL, and Prisma.

.cursorrules templatecursor rules templateecommerceai review analysisnode.jstypescriptpostgresqlprismacursor ai rulesauthenticationtesting

Target User

Developers building AI-powered product review analysis tools for ecommerce SMEs using a Node.js/TypeScript stack with PostgreSQL

Use Cases

  • Analyze product reviews for sentiment and features
  • Identify recurring themes and pain points
  • Track brand perception across marketplaces
  • Generate summary dashboards for product teams
  • Alert for negative spikes in review metrics

Markdown Template

Cursor Rules Template: Ecommerce AI Review Analysis Tool

Overview


Direct answer: This Cursor rules template provides a concrete copyable .cursorrules configuration for building an AI powered product review analysis tool on a Node.js TypeScript stack with PostgreSQL and Prisma, tailored for ecommerce SMEs. Cursor AI will enforce stack-specific rules across code, tests, and deployments.



When to Use These Cursor Rules



  - Building an AI driven product review analytics tool for ecommerce SMEs

  - Standardizing prompts for sentiment, feature extraction, and trend analysis

  - Enforcing security, data privacy, and testing discipline in the API layer

  - Guiding CI/CD workflows for Node.js TypeScript projects



Copyable .cursorrules Configuration


Copy this block into your project root as .cursorrules. It provides framework role, code style, architecture, auth, data patterns, tests, and anti-patterns.


framework: node-typescript-express
stack: prisma-postgres
purpose: ecommerce ai review analysis

roles:
  - Framework Role & Context: Node.js Express API with TypeScript
  - Code Style and Style Guides: ESLint + Prettier; strict TS
  - Architecture & Directory Rules: src/controllers, src/services, src/repositories, prisma/

authentication:
  - Method: JWT
  - Roles: admin, analyst, user

security:
  - Secrets: env vars; avoid code level secrets
  - Data: encrypt sensitive fields; never log PII

database:
  - ORM: Prisma; database: PostgreSQL
  - Migrations: prisma/migrate

testing:
  - Unit: validators and services
  - Integration: API endpoints with supertest
  - E2E: ingestion and analysis pipeline

lint:
  - Tooling: eslint + prettier; pre-commit hooks

prohibited:
  - Do not eval user input
  - Do not bypass auth
  - Do not trust client side to enforce security

Recommended Project Structure


/
├─ src
│  ├─ controllers
│  │  └─ reviewController.ts
│  ├─ services
│  │  └─ reviewService.ts
│  ├─ repositories
│  │  └─ reviewRepository.ts
│  ├─ middleware
│  │  └─ auth.ts
│  └─ index.ts
├─ prisma
│  └─ schema.prisma
├─ tests
│  ├─ unit
│  └─ integration
├─ .eslintrc.js
├─ .prettierrc
├─ package.json

Core Engineering Principles



  - Clear API contracts and typed data

  - Security by default and minimal data exposure

  - Observability with structured logging and tracing

  - Test-driven approach and CI assurance

  - Modular design with explicit boundaries for AI usage



Code Construction Rules



  - Use TypeScript with strict mode; avoid any

  - Adopt Prisma for PostgreSQL access and migrations

  - Validate inputs with Zod or similar schema validators

  - Version API endpoints and keep controllers thin

  - Favor dependency injection and isolated services

  - Avoid hard-coded secrets and avoid privileged operations in routes



Security and Production Rules



  - Store secrets in environment variables; rotate keys

  - Implement rate limiting and authentication for APIs

  - Sanitize and validate user input; never trust client data

  - Enforce HTTPS and secure cookies in production

  - Audit AI prompts for safety and data handling



Testing Checklist



  - Unit tests for validators and services

  - Integration tests for API endpoints and data flow

  - End-to-end tests for review ingestion and analysis pipelines

  - Lint and type checks in CI

  - Security tests for inputting malicious payloads



Common Mistakes to Avoid



  - Bypassing input validation for speed

  - Storing secrets in source code or logs

  - Mixing business logic with AI prompt construction

  - Ignoring data privacy when analyzing reviews



Related implementation resources: AI Agent Use Case for Mental Wellness Practices Using Anonymized Session Notes to Identify Common Client Concerns and Domain-Specific Skill Files for Production Dashboards: Reusable AI Workflows for Enterprise AI.





FAQ


What is the purpose of this Cursor Rules Template?


This template provides a concrete copyable .cursorrules block and stack-specific guidance for building an AI powered product review analysis tool for ecommerce SMEs using a Node.js TypeScript stack.


Which stack does this template target?


The template targets Node.js with TypeScript, Express, Prisma ORM, and PostgreSQL for building ecommerce AI review analysis tools.


How do I integrate Cursor AI with the analytics workflow?


Use the Cursor rules block to guide prompts that process product reviews, then route results to APIs and dashboards.


What safety practices are included?


The template enforces environment based secrets, strict input validation, and restricted AI usage to prevent data leakage.


What should I test in this stack?


Unit tests for validators and services, integration tests for API routes, and end-to-end checks for ingestion and analysis pipelines.


Where is the recommended project structure?


The template includes a src directory with controllers, services, and repositories, plus a prisma folder for schema and migrations, and a tests folder for unit and integration tests.

Overview

Direct answer: This Cursor rules template provides a concrete copyable .cursorrules configuration for building an AI powered product review analysis tool on a Node.js TypeScript stack with PostgreSQL and Prisma, tailored for ecommerce SMEs. Cursor AI will enforce stack-specific rules across code, tests, and deployments.

When to Use These Cursor Rules

  • Building an AI driven product review analytics tool for ecommerce SMEs
  • Standardizing prompts for sentiment, feature extraction, and trend analysis
  • Enforcing security, data privacy, and testing discipline in the API layer
  • Guiding CI/CD workflows for Node.js TypeScript projects

Copyable .cursorrules Configuration

Copy this block into your project root as .cursorrules. It provides framework role, code style, architecture, auth, data patterns, tests, and anti-patterns.

framework: node-typescript-express
stack: prisma-postgres
purpose: ecommerce ai review analysis

roles:
  - Framework Role & Context: Node.js Express API with TypeScript
  - Code Style and Style Guides: ESLint + Prettier; strict TS
  - Architecture & Directory Rules: src/controllers, src/services, src/repositories, prisma/

authentication:
  - Method: JWT
  - Roles: admin, analyst, user

security:
  - Secrets: env vars; avoid code level secrets
  - Data: encrypt sensitive fields; never log PII

database:
  - ORM: Prisma; database: PostgreSQL
  - Migrations: prisma/migrate

testing:
  - Unit: validators and services
  - Integration: API endpoints with supertest
  - E2E: ingestion and analysis pipeline

lint:
  - Tooling: eslint + prettier; pre-commit hooks

prohibited:
  - Do not eval user input
  - Do not bypass auth
  - Do not trust client side to enforce security

Recommended Project Structure

/
├─ src
│  ├─ controllers
│  │  └─ reviewController.ts
│  ├─ services
│  │  └─ reviewService.ts
│  ├─ repositories
│  │  └─ reviewRepository.ts
│  ├─ middleware
│  │  └─ auth.ts
│  └─ index.ts
├─ prisma
│  └─ schema.prisma
├─ tests
│  ├─ unit
│  └─ integration
├─ .eslintrc.js
├─ .prettierrc
├─ package.json

Core Engineering Principles

  • Clear API contracts and typed data
  • Security by default and minimal data exposure
  • Observability with structured logging and tracing
  • Test-driven approach and CI assurance
  • Modular design with explicit boundaries for AI usage

Code Construction Rules

  • Use TypeScript with strict mode; avoid any
  • Adopt Prisma for PostgreSQL access and migrations
  • Validate inputs with Zod or similar schema validators
  • Version API endpoints and keep controllers thin
  • Favor dependency injection and isolated services
  • Avoid hard-coded secrets and avoid privileged operations in routes

Security and Production Rules

  • Store secrets in environment variables; rotate keys
  • Implement rate limiting and authentication for APIs
  • Sanitize and validate user input; never trust client data
  • Enforce HTTPS and secure cookies in production
  • Audit AI prompts for safety and data handling

Testing Checklist

  • Unit tests for validators and services
  • Integration tests for API endpoints and data flow
  • End-to-end tests for review ingestion and analysis pipelines
  • Lint and type checks in CI
  • Security tests for inputting malicious payloads

Common Mistakes to Avoid

  • Bypassing input validation for speed
  • Storing secrets in source code or logs
  • Mixing business logic with AI prompt construction
  • Ignoring data privacy when analyzing reviews

Related implementation resources: AI Agent Use Case for Mental Wellness Practices Using Anonymized Session Notes to Identify Common Client Concerns and Domain-Specific Skill Files for Production Dashboards: Reusable AI Workflows for Enterprise AI.

FAQ

What is the purpose of this Cursor Rules Template?

This template provides a concrete copyable .cursorrules block and stack-specific guidance for building an AI powered product review analysis tool for ecommerce SMEs using a Node.js TypeScript stack.

Which stack does this template target?

The template targets Node.js with TypeScript, Express, Prisma ORM, and PostgreSQL for building ecommerce AI review analysis tools.

How do I integrate Cursor AI with the analytics workflow?

Use the Cursor rules block to guide prompts that process product reviews, then route results to APIs and dashboards.

What safety practices are included?

The template enforces environment based secrets, strict input validation, and restricted AI usage to prevent data leakage.

What should I test in this stack?

Unit tests for validators and services, integration tests for API routes, and end-to-end checks for ingestion and analysis pipelines.

Where is the recommended project structure?

The template includes a src directory with controllers, services, and repositories, plus a prisma folder for schema and migrations, and a tests folder for unit and integration tests.