Prompt file imported from Harmeet10000/AgentNexus-LangChain-FastAPI (
.github/prompts/.prompt.md). Copyright stays with the author.
Create a production-ready FastAPI application that follows best practices, including:
- Clear project structure with modular components
- Secure authentication and authorization
- Input validation and error handling
- Database integration with SQLAlchemy
- API documentation using OpenAPI/Swagger
- Request/response models using Pydantic
- Logging and monitoring setup
- Environment configuration management
- Unit tests and integration tests
- Docker containerization
- Async/await patterns for performance
- Middleware for CORS, security headers, and rate limiting
- Type hints and proper documentation
- Health check endpoints
- API versioning strategy
Please include code examples demonstrating key concepts and configurations.