Python FastAPI Scalable API .cursorrules prompt file
About .cursorrules prompt file
What you can build
- API Development Platform
- An online platform where developers can design, develop, and test scalable APIs using FastAPI and Python. It would include features like automatic documentation generation, integrated testing, and on-demand deployment using Docker.
- Frontend & Backend Boilerplate Generator
- A tool that generates boilerplate code for projects using FastAPI, PostgreSQL, React, and TypeScript. It would follow the advanced development guidelines specified above, including Docker configuration, environment setup, and directory structures.
- Async Operations Management Dashboard
- A web application for monitoring and managing asynchronous operations in FastAPI applications. Features would include real-time performance metrics, error logs, and caching statistics, built with a React frontend utilizing Tailwind and Shadcn UI.
- Dynamic Component Library
- A library of TypeScript-based React components styled with Tailwind and Shadcn UI that can be dynamically loaded. It would emphasize performance optimization techniques and support SSR where applicable.
- Python & TypeScript Code Linter
- A tool for enforcing code style and structure standards as per the specified guidelines for both Python (FastAPI) and TypeScript (React) projects. It would support integration with popular code editors like VSCode.
- FastAPI Performance Analyzer
- A service that analyzes FastAPI applications to provide insights and recommendations on performance enhancements, including caching strategies, async optimizations, and error handling improvements.
- Interactive API Documentation Generator
- A tool that generates interactive API documentation for FastAPI projects. It would utilize Pydantic models for automatic validation and documentation updates, providing a seamless integration experience.
- Web Vitals Optimization Service
- An online service for analyzing and optimizing web vital metrics (LCP, CLS, FID) for React-based frontend projects. The service would offer reports and suggestions for improving performance based on real-time data analysis.
- Integrated Docker Development Environment
- A platform that provides a cloud-based development environment using Docker for FastAPI and React projects. It would come pre-configured with the necessary setup for Postgres, Redis, and environment configurations.
Automated Deployment & CI/CD Pipeline
- A service that sets up and manages CI/CD pipelines for deploying FastAPI and React applications. It would utilize GitHub Actions or similar services for streamlined deployment processes.
Cross-Platform Mobile App Framework
- A framework for building cross-platform mobile applications using React and TypeScript, leveraging Tailwind CSS and Shadcn UI for a consistent look and feel across devices.
Pydantic Schema Visualizer
- A tool for visualizing and testing Pydantic schemas used in FastAPI applications. It would help developers understand data flow, dependencies, and validation rules efficiently.
Benefits
- Encourages use of both Python and TypeScript with functional, declarative programming patterns, emphasizing iterative development and modularity.
- Distinct frontend and backend structures using modern frameworks and UI libraries, ensuring organized, scalable, and performant applications.
- Requires comprehensive type usage, error handling strategies, and caching techniques for optimized, secure, and reliable API deployment.
Synopsis
Developers skilled in web technologies will benefit by building a scalable, high-performance web application with a FastAPI backend and React/Tailwind frontend, following best practices and optimal project structure.
Overview of .cursorrules prompt
The .cursorrules file provides guidelines and best practices for developing scalable APIs and applications using Python, FastAPI, TypeScript, React, Tailwind, and Shadcn UI. It establishes key principles for code writing, such as using concise, technical responses with clear examples and preferring functional programming patterns over classes. It outlines the project structure for both the frontend and backend, detailing the technologies, directory structure, and important configuration files. It specifies code style and structure, performance optimization techniques, project conventions, as well as testing and deployment practices. These frameworks are intended to ensure efficient, maintainable, and high-performance development of APIs and web applications.