https://github.com/barabum0/fastapi-template
Template for FastAPI applications. Typed with mypy, tested with pytest and logged with loguru.
https://github.com/barabum0/fastapi-template
fastapi loguru mypy pytest python template template-repository
Last synced: over 1 year ago
JSON representation
Template for FastAPI applications. Typed with mypy, tested with pytest and logged with loguru.
- Host: GitHub
- URL: https://github.com/barabum0/fastapi-template
- Owner: barabum0
- License: mit
- Created: 2023-12-09T12:55:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-17T12:26:06.000Z (almost 2 years ago)
- Last Synced: 2025-01-21T09:48:52.243Z (over 1 year ago)
- Topics: fastapi, loguru, mypy, pytest, python, template, template-repository
- Language: Python
- Homepage:
- Size: 107 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FastAPI Project Template with Loguru
[](https://github.com/psf/black)
[](https://pycqa.github.io/isort/)
[](https://mypy-lang.org/)
[](https://docs.pytest.org/en/stable/)
## About 📘
This repository serves as a template for a **minimal FastAPI project** with enhanced logging using **Loguru**. It's managed with **Poetry** for efficient dependency resolution, ensuring a robust and maintainable codebase.
## Features 🌟
- **FastAPI Framework**: Utilizes the latest FastAPI framework for high performance and ease of development.
- **Loguru Integration**: Includes pre-configured Loguru for superior logging capabilities.
- **Poetry for Dependency Management**: Employs Poetry to simplify package management and dependency resolution.
- **Black Code Style**: Adheres to the Black code style for consistent and clean Python code.
- **isort for Import Sorting**: Ensures imports are neatly organized and consistent using isort.
- **mypy for Static Type Checking**: Incorporates mypy to catch errors and ensure type safety in your codebase.
- **pytest for Testing**: Leverages pytest for comprehensive and efficient testing of your application.
## Usage 🛠️
To use this template, simply press the button on GitHub to create a new repository based on this template.
Next, rename the project and docker image in following files
- [`pyproject.toml`](pyproject.toml)
- [`docker-compose.yml`](docker-compose.yml)
- [`.github/workflows/build-docker-image-release.yml`](.github/workflows/build-docker-image-release.yml)
- **and uncomment the `on` section in this file for it to work**
## Installation 💻
```shell
poetry install
```
## Running 🏃♂️
```shell
poetry shell
poetry run app
```
## Troubleshooting 🔍
For any issues or troubleshooting queries, please refer to the [Issues section](https://github.com/barabum0/fastapi-template/issues) of this GitHub repository.
## Contribution 👥
Contributions are welcome. Please fork the repository, make your changes, and submit a pull request.
## License 📜
This project is open-sourced under the [MIT License](LICENSE).