Cursor Rules Template: Freight Rate Intelligence Dashboards from Historical Lane Data
Cursor rules template for Freight rate dashboards using historical lane data with Cursor AI. A copyable .cursorrules configuration and stack-specific guidance.
Target User
Developers building AI-powered rate dashboards for freight brokers using historical lane data
Use Cases
- Build rate intelligence dashboards from lane history
- Detect rate volatility and seasonality
- Compare lanes over time
- Forecast pricing scenarios
- Automate data-quality checks
Markdown Template
Cursor Rules Template: Freight Rate Intelligence Dashboards from Historical Lane Data
.cursorrules
// Cursor rules for Freight Rate Intelligence Dashboard (Cursor AI)
// Framework Role & Context
role: 'Freight Rate Dashboard Architect'
context: 'Cursor AI orchestrates data from historical lane data to drive freight rate dashboards for brokers.'
// Code Style and Style Guides
style: 'TypeScript 4.x, ESLint + Prettier, strict type checks'
// Architecture & Directory Rules
directoriesRoot: 'project root'
directories: [
'src/api',
'src/dashboards/freight-rate',
'src/data',
'src/models',
'tests',
'cursorrules'
]
// Authentication & Security Rules
auth: 'OAuth 2.0 with short-lived access tokens; no secrets in code; env vars only'
// Database and ORM patterns
database: 'PostgreSQL; use parameterized queries; avoid string-concatenated SQL'
orms: 'No heavy ORM; prefer raw SQL with query builders when needed'
// Testing & Linting Workflows
testing: 'Unit tests with Jest; integration tests for API; lint with ESLint; CI on push'
// Prohibited Actions and Anti-patterns for the AI
antiPatterns: [
'Do not embed secrets in rules or code; do not generate unsafe SQL; do not bypass auth; do not mutate production data'
]Overview
The Cursor rules configuration is designed to help Cursor AI build and enforce rules for a freight rate intelligence dashboard using historical lane data. It targets a stack with a Node.js backend, PostgreSQL data warehouse, and a React-based frontend. The goal is to produce deterministic, auditable guidance for data parsing, transformation, and visualization.
Direct answer: This Cursor rules template offers a copyable .cursorrules block and stack-specific constraints you can paste into your project to generate consistent dashboards for freight brokers.
When to Use These Cursor Rules
- You are building an AI-assisted rate dashboard from historical lane data for freight brokers.
- You need strict data contracts between ingestion, transformation, and presentation layers.
- You require reproducible dashboards across environments and teams.
- You want to prevent unsafe queries and ensure secure access to rate data.
Copyable .cursorrules Configuration
.cursorrules
// Cursor rules for Freight Rate Intelligence Dashboard (Cursor AI)
// Framework Role & Context
role: 'Freight Rate Dashboard Architect'
context: 'Cursor AI orchestrates data from historical lane data to drive freight rate dashboards for brokers.'
// Code Style and Style Guides
style: 'TypeScript 4.x, ESLint + Prettier, strict type checks'
// Architecture & Directory Rules
directoriesRoot: 'project root'
directories: [
'src/api',
'src/dashboards/freight-rate',
'src/data',
'src/models',
'tests',
'cursorrules'
]
// Authentication & Security Rules
auth: 'OAuth 2.0 with short-lived access tokens; no secrets in code; env vars only'
// Database and ORM patterns
database: 'PostgreSQL; use parameterized queries; avoid string-concatenated SQL'
orms: 'No heavy ORM; prefer raw SQL with query builders when needed'
// Testing & Linting Workflows
testing: 'Unit tests with Jest; integration tests for API; lint with ESLint; CI on push'
// Prohibited Actions and Anti-patterns for the AI
antiPatterns: [
'Do not embed secrets in rules or code; do not generate unsafe SQL; do not bypass auth; do not mutate production data'
]
Recommended Project Structure
project-root/
├── src/
│ ├── api/ # backend API endpoints
│ │ └── index.ts
│ ├── dashboards/ # UI dashboards
│ │ └── freight-rate/ # freight-rate dashboard components
│ ├── data/ # data ingestion and transformation
│ │ ├── models/
│ │ └── pipelines/
│ ├── models/ # data models (Lane, Rate, etc)
│ ├── tests/ # tests
│ └── cursorrules/ # local copy of .cursorrules templates
│ └── freight-rate-cursor-rules-template.cursorrules
└── package.json
Core Engineering Principles
- Single source of truth for lane data and rate metrics.
- Deterministic data processing with explicit contracts across ingest, transform, and presentation.
- Strong typing and validation at every boundary (API, data, UI).
- Secure by default: least-privilege access, secrets managed via env vars, encrypted at rest.
- Idempotent deployments and clear rollback paths.
Code Construction Rules
- Use TypeScript end-to-end; define interfaces for lane, rate, and dashboard widgets.
- Parameterize all SQL; never concatenate user-supplied data into queries.
- Validate all inputs; fail fast for invalid lane keys, dates, or rate values.
- Keep business logic out of UI rules; use Cursor AI to enforce policies, not implement them.
- Maintain explicit API contracts; version your endpoints and schemas.
Security and Production Rules
- Enforce OAuth 2.0 with short-lived tokens; store no secrets in code.
- Use TLS everywhere; enable rotation of credentials and keys.
- Audit-limited access to lane data; implement row-level security where appropriate.
- Implement rate limiting and monitoring for dashboards and APIs.
Testing Checklist
- Unit tests for data models, validation, and utility functions.
- Integration tests for API endpoints and data pipelines.
- End-to-end tests for dashboard rendering and data accuracy.
- Linting and type checks in CI; ensure tests run on PRs.
Common Mistakes to Avoid
- Ignoring input validation leading to SQL injection vectors.
- Embedding business logic in Cursor rules instead of the application codebase.
- Skipping secret management, exposing credentials in config or repo.
- Overcustomizing rules for a single environment; ensure environment parity.
Related implementation resources: AI Agent Use Case for Freight Brokers Using Historical Lane Data to Suggest Competitive Customer Pricing and Using Skill Files to Stop SQL Injection in Generated Backend Code.
FAQ
What is a Cursor rules template for freight rate dashboards?
A Cursor rules template provides a copyable .cursorrules block and stack-specific guidance to help Cursor AI build rate dashboards from historical lane data for freight brokers.
Which stack does this template target?
It targets a Node.js backend, PostgreSQL data warehouse, and a React frontend for freight broker rate intelligence dashboards using Cursor AI rules.
How do I apply the .cursorrules block?
Copy the code from the Copyable section, paste it at the project root as .cursorrules, and run the Cursor AI tooling to scaffold the dashboard with enforced rules.
How do I test this template?
Run unit tests for data validation, integration tests for API routes, and end-to-end checks for dashboard accuracy; validate against historical lane data.
What about security and secrets?
Use OAuth 2.0, manage credentials via environment variables, encrypt data at rest, and monitor access to lane data and dashboards.