This project is a starter template for building web APIs using Python FastAPI.
This project is built using the following tools and libraries:
- FastAPI for building the API
- SQLAlchemy for database interactions
- Alembic for database migrations
- Pydantic for data validation
- PyTest for unit testing
- Swagger and ReDoc for API documentation
- Follow the established directory structure for organizing your code
- Use snake_case for variable and function names
- Use
__init__.pyfiles for new modules - Use Pydantic models for request and response validation
- Use SQLAlchemy for database interactions
- Use Alembic for managing database schema changes
- Document your API endpoints using Swagger and ReDoc
- Ensure code quality by using Ruff, PyLint, Black, and isort
- Implement JWT authentication for protected routes
- Write unit tests for all new features and bug fixes
- Use PyTest for writing and running unit tests
- Organize tests in a separate
testsdirectory - Write tests for all public functions and methods
- Use fixtures for setup and teardown of test environments
- Use Ruff for linting and code style checks
- Use PyLint for static code analysis
- Use Black for automatic code formatting
- Use isort for sorting imports
- Aim for clean, readable, and maintainable code