Skip to content

sergioaz/FastAPI-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Projects

This repository contains various FastAPI projects showcasing different functionalities and use cases.

Overview

This collection of projects demonstrates the versatility and capabilities of FastAPI, a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints. Each project focuses on a specific feature or use case, providing practical examples and implementations using FastAPI.

Projects

  1. Role Base Resource Access Management: A FastAPI application for role-based access control (RBAC) to manage resources, providing endpoints for user authentication, authorization, and resource management with dynamic configuration.

  2. CRUD Operation With SQLAlchemy: A FastAPI application for performing CRUD (Create, Read, Update, Delete) operations using SQLAlchemy as the ORM (Object-Relational Mapping) tool, showcasing full database interaction capabilities.

  3. Fastapi with Middleware: Who to leaverage the Middleware in FastAPI.

  4. FastAPI with Python Logging: It is a important for every project to have a logging facility. FastAPI provides a simple and powerful logging facility.

  5. Pytest Testing With FastAPI: A FastAPI project showcasing how to use Pytest for testing. Testing is essential to ensure the reliability and correctness of your application. This project demonstrates how to write unit and integration tests for FastAPI endpoints.

  6. Schedule Your Job with Apscheduler: Learn how to schedule jobs using APScheduler with FastAPI. APScheduler is a library that allows you to schedule tasks to be executed at specific times or intervals. This project demonstrates how to integrate APScheduler with FastAPI to run periodic tasks.

  7. Pagination with FastAPI: Implement pagination in FastAPI to handle large datasets efficiently. Pagination is essential for applications dealing with a significant amount of data, enabling you to load data in chunks. This project demonstrates how to add pagination to your FastAPI endpoints.

  8. Resource Access Management: A FastAPI project to manage resource access. This project explores various methods for controlling access to resources, including role-based access control (RBAC) and attribute-based access control (ABAC).

  9. Fastapi Template Rendering: A FastAPI project demonstrating how to render HTML templates using FastAPI. This project shows how to use Jinja2 templates for rendering dynamic HTML content and includes a basic project structure for easy expansion and maintenance.

  10. JWT Authentication In FastAPI: A FastAPI project demonstrating how to implement JSON Web Token (JWT) authentication. This includes generating, signing, and validating tokens to secure API endpoints, along with examples for managing user authentication and authorization.

  11. FastAPI With MongoDB: A FastAPI project showcasing integration with MongoDB. This project covers connecting to MongoDB, performing CRUD operations, and leveraging FastAPI's async capabilities for efficient database interactions.

  12. DiskCache in FastAPI Applications: A FastAPI project showcasing the implementation of DiskCache for caching API responses to optimize performance and reduce redundant computations. This project explores how to use DiskCache as a lightweight and file-based caching mechanism, including scenarios where it is suitable.

  13. Fastapi Metadata Configuration: A FastAPI project focused on customizing API metadata, such as title, description, and version, to improve API documentation and usability. It includes tips on structuring metadata for OpenAPI specifications.

  14. FastAPI with Docker: A FastAPI project demonstrating how to containerize applications using Docker. This includes creating a Dockerfile, defining dependencies, and running the application in isolated environments for ease of deployment.

  15. Implementation of Pg bounce in FastAPI: A FastAPI project detailing the implementation of PgBouncer for connection pooling with PostgreSQL. It explains the setup process, configuration, and performance improvements when handling high volumes of database connections.

  16. Celery in FastAPI: A FastAPI project showcasing the integration of Celery for background task processing. This includes examples of setting up Celery with RabbitMQ.

  17. Redis in FastAPI:

  18. FastAPI Documentation: A comprehensive FastAPI project demonstrating advanced OpenAPI documentation customization and API documentation best practices. This project showcases how to enhance your API documentation with custom metadata, rich descriptions, endpoint grouping with tags, request/response examples, deprecated endpoint marking, and custom OpenAPI schema generation. It includes integration with modern documentation tools like Scalar for enhanced API documentation presentation, making your APIs more discoverable and developer-friendly.

  19. FastAPI and threads: Benchmark of 4 different approaches to long-running CPU-bound tasks ( Hint: none of 4 should be used in Prod! )

Instructions

Follow the project-specific instructions provided in the README.md file within each project directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages