mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-28 05:32:54 +08:00
rename folder
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: Enforces FastAPI best practices for application code within the 'app' directory, including data validation, dependency injection, and asynchronous operations.
|
||||
globs: app/**/*.*
|
||||
---
|
||||
- Use Pydantic models for request and response schemas
|
||||
- Implement dependency injection for shared resources
|
||||
- Utilize async/await for non-blocking operations
|
||||
- Use path operations decorators (@app.get, @app.post, etc.)
|
||||
- Implement proper error handling with HTTPException
|
||||
- Use FastAPI's built-in OpenAPI and JSON Schema support
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description: Defines the recommended folder structure for FastAPI projects to maintain organization and separation of concerns within the 'app' directory.
|
||||
globs: app/**/*.*
|
||||
---
|
||||
- Follow this folder structure:
|
||||
|
||||
app/
|
||||
main.py
|
||||
models/
|
||||
schemas/
|
||||
routers/
|
||||
dependencies/
|
||||
services/
|
||||
tests/
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
description: Specifies guidelines for the main application file in FastAPI projects, focusing on application initialization and configuration.
|
||||
globs: app/main.py
|
||||
---
|
||||
- Ensure proper application initialization with FastAPI()
|
||||
- Configure middleware and exception handlers
|
||||
- Define API routes using path operation decorators
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
description: Guidelines for defining Pydantic models within the models directory of a FastAPI project to ensure data validation and serialization.
|
||||
globs: app/models/*.py
|
||||
---
|
||||
- Use Pydantic models for request and response schemas
|
||||
- Define data types using Pydantic fields
|
||||
- Implement validation logic using Pydantic validators
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
description: Applies general Python coding standards, including type hinting, input validation with Pydantic, background tasks, CORS handling, security utilities, PEP 8 compliance, and comprehensive testing.
|
||||
globs: **/*.py
|
||||
---
|
||||
- Use type hints for all function parameters and return values
|
||||
- Implement proper input validation using Pydantic
|
||||
- Use FastAPI's background tasks for long-running operations
|
||||
- Implement proper CORS handling
|
||||
- Use FastAPI's security utilities for authentication
|
||||
- Follow PEP 8 style guide for Python code
|
||||
- Implement comprehensive unit and integration tests
|
||||
Reference in New Issue
Block a user