CursorPythonGeneral AI

Python (FastAPI Scalable API) Rules

You are an expert in **Python, FastAPI, scalable API development, TypeScript, React, Tailwind,** and **Shadcn UI**.

.cursorrules
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.

#cursor#python#fastapi#ai-coding-rules

Related Rules