Cursor Rules TemplatesCursor Rules Template

Cursor Rules Template — Real Estate Dashboard with Cash Flow, ROI, and Analytics

Cursor rules template for building a real estate investment dashboard with Cursor AI on a Next.js + TypeScript stack, covering cash flow, ROI, occupancy, debt, and portfolio analytics.

cursor-rules-templatecursor-rulesreal-estate-dashboardreal-estate-analyticsNext.jsTypeScriptPostgreSQLPrismaCursor AI rulescash-flowROIoccupancydebt

Target User

Developers building real estate analytics dashboards with Cursor AI

Use Cases

  • Create a production-ready Cursor rules configuration for a Next.js + TypeScript real estate dashboard
  • Enforce data modeling for properties, mortgages, cash flow, occupancy, and ROI
  • Provide a copyable .cursorrules block for deployment in project root
  • Define authentication, security, testing, and linting workflows for Cursor AI

Markdown Template

Cursor Rules Template — Real Estate Dashboard with Cash Flow, ROI, and Analytics

// Cursor Rules for Real Estate Dashboard
Framework: Next.js (App Router) + TypeScript
Stack: Prisma + PostgreSQL
Context: Real estate investment dashboard with cash flow, ROI, occupancy, debt, portfolio analytics
Role: Cursor AI code assistant for production-grade implementation
CodeStyle: ESLint + Prettier; 4-space indent; TS strict
Architecture:
  app/
  components/
  lib/
  prisma/
  data/
Authentication:
  method: NextAuth with JWT sessions; secure cookies; server-side session validation
Database & ORM:
  ORM: Prisma
  DB: PostgreSQL
  models:
    - Property
    - Mortgage
    - CashFlow
    - Occupancy
    - ROI
    - Portfolio
Testing & Linting:
  unit: vitest
  integration: playwright
  lint: eslint + prettier + pre-commit
Prohibited:
  - Do not use eval
  - Do not embed secrets in code
  - Do not bypass SSR for data fetch

Overview

Direct answer: This Cursor rules configuration enables production-grade Cursor AI guidance for building a real estate investment dashboard on a Next.js + TypeScript stack with PostgreSQL and Prisma. It includes a copyable .cursorrules block and explicit guardrails for architecture, security, testing, and deployment to deliver cash flow, ROI, occupancy, debt, and portfolio analytics.

When to Use These Cursor Rules

  • When starting a new Next.js + Prisma real estate dashboard project that tracks cash flow, ROI, occupancy, and debt.
  • When you need a paste-ready .cursorrules configuration to enforce architecture, security, and testing patterns.
  • When onboarding new developers and ensuring consistent data models for properties, mortgages, and portfolios.
  • When you require production-grade guidelines for authentication, data access, and deployment workflows.

Copyable .cursorrules Configuration

// Cursor Rules for Real Estate Dashboard
Framework: Next.js (App Router) + TypeScript
Stack: Prisma + PostgreSQL
Context: Real estate investment dashboard with cash flow, ROI, occupancy, debt, portfolio analytics
Role: Cursor AI code assistant for production-grade implementation
CodeStyle: ESLint + Prettier; 4-space indent; TS strict
Architecture:
  app/
  components/
  lib/
  prisma/
  data/
Authentication:
  method: NextAuth with JWT sessions; secure cookies; server-side session validation
Database & ORM:
  ORM: Prisma
  DB: PostgreSQL
  models:
    - Property
    - Mortgage
    - CashFlow
    - Occupancy
    - ROI
    - Portfolio
Testing & Linting:
  unit: vitest
  integration: playwright
  lint: eslint + prettier + pre-commit
Prohibited:
  - Do not use eval
  - Do not embed secrets in code
  - Do not bypass SSR for data fetch

Recommended Project Structure

// Recommended project structure for Next.js + Prisma real estate dashboard
root
├── app
│   ├── dashboard
│   │   ├── page.tsx
│   │   └── dashboard.module.css
│   ├── layout.tsx
│   └── globals.css
├── components
│   ├── DashboardCard.tsx
│   └── PropertyTable.tsx
├── lib
│   └── db.ts
├── prisma
│   └── schema.prisma
├── data
│   └── seed.ts
├── tests
│   ├── unit
│   └── integration
└── README.md

Core Engineering Principles

  • Security by default: validate all data on the server and never trust client input.
  • Data modeling first: design Prisma schemas to reflect properties, mortgages, cash flow, occupancy, ROI, and portfolios.
  • Server components for data fetching: fetch data on the server when possible to protect secrets and improve performance.
  • Type safety and strict TS: enforce TS strict mode and explicit types for all models and API boundaries.
  • Observability: integrate structured logging, metrics, and trace IDs for production troubleshooting.

Code Construction Rules

  • Use Next.js App Router with server components for data access and client components for UI only.
  • Model all analytics entities: Property, Mortgage, CashFlow, Occupancy, ROI, Portfolio in Prisma and expose via API routes.
  • Enforce strict input validation and sanitized queries to prevent SQL injection and XSS.
  • Return deterministic results with proper pagination, caching, and time-zone handling for cash flow metrics.
  • Keep business logic in server-side modules; keep UI independent of data-fetching concerns.

Security and Production Rules

  • Use JWT-based sessions with secure cookies and CSRF protection for API routes.
  • Store secrets in environment variables; never commit to VCS; rotate credentials regularly.
  • Harden API routes with rate limiting and IP allowlists where appropriate.
  • Validate data against Prisma schemas and enforce row-level security at the database level where possible.
  • Implement automated security testing in CI, including dependency scanning and static analysis.

Testing Checklist

  • Unit tests for data models, utilities, and business logic with Vitest.
  • Integration tests for API routes and database access with Playwright or Supertest.
  • End-to-end tests for dashboard flows in a staging environment with real data seeds.
  • Linting and type checks running on pre-commit hooks and CI.
  • Security tests including input validation, auth flows, and vulnerability scanning.

Common Mistakes to Avoid

  • Mixing server and client logic; avoid fetching secrets on the client.
  • Hardcoding secrets or credentials in code or config files.
  • Skipping type definitions and letting TypeScript drift.
  • Ignoring time zones in cash flow and ROI calculations.
  • Overusing client state for data that should be server-fetched.

Related Cursor rules templates

Explore adjacent Cursor rules templates for similar stacks, workflows, and production constraints.

FAQ

What is a Cursor Rules Template for a real estate dashboard?

A Cursor Rules Template provides a copyable .cursorrules block that guides Cursor AI through framework, architecture, security, and testing constraints to produce production-ready code for a real estate dashboard built with Next.js, Prisma, and PostgreSQL.

Which stack does this template target?

This template targets a Next.js (App Router) + TypeScript stack with Prisma as the ORM and PostgreSQL as the database, suitable for cash flow and ROI analytics, occupancy tracking, and portfolio analytics in real estate.

How do I paste and apply the .cursorrules block?

Copy the block under Copyable .cursorrules Configuration and paste it into the root of your project as .cursorrules. Cursor AI will read the rules to guide generation, enforcement, and testing throughout development.

Can I extend the data models for additional metrics?

Yes. The template defines core models like Property, Mortgage, CashFlow, Occupancy, ROI, and Portfolio. You can extend with additional models but maintain clear relationships and migrations to preserve data integrity.

What testing and deployment steps are recommended?

Maintain unit tests with Vitest, integration tests for API routes, and end-to-end tests for dashboards. Integrate with CI/CD for linting, type checks, and automated migrations on deployment.