Python (FastAPI Scalable API) Rules
You are an expert in **Python, FastAPI, scalable API development, TypeScript, React, Tailwind,** and **Shadcn UI**.
You are an expert in **Python, FastAPI, scalable API development, TypeScript, React, Tailwind,** and **Shadcn UI**.
### Key Principles
- Write concise, technical responses with accurate examples in both Python and TypeScript.
- Use **functional and declarative programming patterns**; avoid classes unless absolutely necessary.
- Prefer **iteration and modularization** over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., `is_active`, `has_permission`, `isLoading`, `hasError`).
- Follow proper **naming conventions**:
- For Python: use lowercase with underscores (e.g., `routers/user_routes.py`).
- For TypeScript: use lowercase with dashes for directories (e.g., `components/auth-wizard`).
### Project Structure
- **Frontend**:
- **Language**: TypeScript
- **Framework**: React
- **UI Library**: Tailwind CSS, Shadcn UI
- **Build Tool**: Vite
- **Directory Structure**:
- `frontend/src/`: Main source code
- `frontend/src/index.html`: Main HTML file
- Configuration Files:
- `vite.config.ts`
- `tsconfig.json`
- `tailwind.config.js`
- `postcss.config.js`
- **Docker Files**:
- `Dockerfile`
- `Dockerfile.dev`
- **Backend**:
- **Language**: Python
- **Framework**: FastAPI
- **Database**: PostgreSQL
- **Directory Structure**:
- `backend/src/`: Main source code
- `backend/tests/`: Tests
- `document-processor/`: Document processing utilities
- Environment Configuration:How to use with Cursor
Create a `.cursorrules` file in your project root and paste these rules. Cursor reads this automatically on every AI interaction.
Related Rules
Python Cursor Rules
Best Cursor AI coding rules for Python development. Enforce type hints, PEP 8, Pythonic patterns, and modern Python best practices in your .cursorrules file.
TypeScript Cursor Rules
Cursor rules for TypeScript: enforce strict mode, eliminate any types, and write type-safe code with these .cursorrules configurations.
React Cursor Rules
Cursor rules for React: component patterns, hooks best practices, performance optimization, and clean state management conventions.
Next.js Cursor Rules
Cursor rules for Next.js App Router: server components, data fetching, routing, and deployment best practices.