The template for building scalable web APIs based on FastAPI, Tortoise ORM and other.

Overview

FastAPI and Tortoise ORM.

Powerful but simple template for web APIs w/ FastAPI (as web framework) and Tortoise-ORM (for working via database without headache).

Features

* Deploy with Docker.
* Local development with docker-compose.
* Fast and powerful web framework and ORM.
* Clear and fast code.
* Some powerful utils out-of-the-box that highly customizable with tests.

How to use?

  1. Clone this repository (git clone https://github.com/prostomarkeloff/fastapi-tortoise)
  2. Rename .env.example to .env
  3. Delete unnecessary code (like hello router and tests for it)
  4. Customize!
Comments
  •  Service 'api' failed to build

    Service 'api' failed to build

    • git clone
    • cp .env.example .env
    • docker-compose -f docker-compose-dev.yml up
    [root@k38uq20rb3czmnz fastapi-tortoise]# docker-compose -f docker-compose-dev.yml up
    Building api
    Step 1/8 : FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
     ---> 23579a0a7c50
    Step 2/8 : RUN pip install poetry
     ---> Using cache
     ---> 6ce9991d8168
    Step 3/8 : RUN poetry config settings.virtualenvs.create false
     ---> Running in c967b38acf5a
    
    [ValueError]
    Setting settings.virtualenvs.create does not exist
    ERROR: Service 'api' failed to build: The command '/bin/sh -c poetry config settings.virtualenvs.create false' returned a non-zero code: 1
    
    
    opened by lihuacai168 1
  • Typos in fastapi-tortoise/app/config/db.py

    Typos in fastapi-tortoise/app/config/db.py

    POSGTRES_USER, POSGTRES_PASSWORD, POSGTRES_DB

    class PostgresSettings(BaseSettings):
        """Postgres env values"""
    
        postgres_user: str = Field("postgres", env="POSGTRES_USER")
        postgres_password: str = Field("postgres", env="POSGTRES_PASSWORD")
        postgres_db: str = Field("mydb", env="POSGTRES_DB")
        postgres_port: str = Field("5432", env="POSTGRES_PORT")
        postgres_host: str = Field("postgres", env="POSTGRES_HOST")
    

    Thanks for creating the project. Cheers, Paul.

    opened by pjcunningham 1
  • Fix poetry

    Fix poetry

    Remove settings from RUN poetry config settings.virtualenvs.create false because it isn't required anymore and will fail (See: https://stackoverflow.com/a/62071321/14796439)

    opened by 2e12 0
  • Traefik support

    Traefik support

    Motivation: You usually have a frontend and API, frontend runs at domain.com, api at api.domain.com and maybe you have a other services. Traefik helps you with it!

    opened by prostomarkeloff 0
  • running ./docker-dev-up.sh is throwing errors

    running ./docker-dev-up.sh is throwing errors

    api_1  |   File "/usr/local/lib/python3.7/site-packages/asyncpg/connect_utils.py", line 663, in _connect                                                                                       
    api_1  |     raise last_error                                                                                                                                                                  
    api_1  |   File "/usr/local/lib/python3.7/site-packages/asyncpg/connect_utils.py", line 655, in _connect                                                                                       
    api_1  |     connection_class=connection_class)                                                                                                                                                
    api_1  |   File "/usr/local/lib/python3.7/site-packages/asyncpg/connect_utils.py", line 622, in _connect_addr                                                                                  
    api_1  |     connector, timeout=timeout)
    api_1  |   File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    api_1  |     return fut.result()
    api_1  |   File "uvloop/loop.pyx", line 1914, in create_connection
    api_1  | socket.gaierror: [Errno -3] Temporary failure in name resolution
    
    api_1  | ERROR:    Application startup failed. Exiting.
    db_1   | syncing data to disk ... initdb: warning: enabling "trust" authentication for local connections
    db_1   | You can change this by editing pg_hba.conf or using the option -A, or
    db_1   | --auth-local and --auth-host, the next time you run initdb.
    

    stack trace of the error. Any solutions?

    opened by codehia 0
Owner
prostomarkeloff
Author of VKWave and lots of other libraries.. Python/Rust dev
prostomarkeloff
fastapi-admin2 is an upgraded fastapi-admin, that supports ORM dialects, true Dependency Injection and extendability

FastAPI2 Admin Introduction fastapi-admin2 is an upgraded fastapi-admin, that supports ORM dialects, true Dependency Injection and extendability. Now

Glib 14 Dec 5, 2022
Flask-vs-FastAPI - Understanding Flask vs FastAPI Web Framework. A comparison of two different RestAPI frameworks.

Flask-vs-FastAPI Understanding Flask vs FastAPI Web Framework. A comparison of two different RestAPI frameworks. IntroductionIn Flask is a popular mic

Mithlesh Navlakhe 1 Jan 1, 2022
CLI and Streamlit applications to create APIs from Excel data files within seconds, using FastAPI

FastAPI-Wrapper CLI & APIness Streamlit App Arvindra Sehmi, Oxford Economics Ltd. | Website | LinkedIn (Updated: 21 April, 2021) fastapi-wrapper is mo

Arvindra 49 Dec 3, 2022
Easy and secure implementation of Azure AD for your FastAPI APIs 🔒

FastAPI-Azure-auth Azure AD Authentication for FastAPI apps made easy. ?? Description FastAPI is a modern, fast (high-performance), web framework for

Intility 216 Dec 27, 2022
FastAPI Server Session is a dependency-based extension for FastAPI that adds support for server-sided session management

FastAPI Server-sided Session FastAPI Server Session is a dependency-based extension for FastAPI that adds support for server-sided session management.

DevGuyAhnaf 5 Dec 23, 2022
SuperSaaSFastAPI - Python SaaS Boilerplate for building Software-as-Service (SAAS) apps with FastAPI, Vue.js & Tailwind

Python SaaS Boilerplate for building Software-as-Service (SAAS) apps with FastAP

Rudy Bekker 31 Jan 10, 2023
🚀 Cookiecutter Template for FastAPI + React Projects. Using PostgreSQL, SQLAlchemy, and Docker

FastAPI + React · A cookiecutter template for bootstrapping a FastAPI and React project using a modern stack. Features FastAPI (Python 3.8) JWT authen

Gabriel Abud 1.4k Jan 2, 2023
Cookiecutter template for FastAPI projects using: Machine Learning, Poetry, Azure Pipelines and Pytests

cookiecutter-fastapi In order to create a template to FastAPI projects. ?? Important To use this project you don't need fork it. Just run cookiecutter

Arthur Henrique 225 Dec 28, 2022
🚀 Cookiecutter Template for FastAPI + React Projects. Using PostgreSQL, SQLAlchemy, and Docker

FastAPI + React · A cookiecutter template for bootstrapping a FastAPI and React project using a modern stack. Features FastAPI (Python 3.8) JWT authen

Gabriel Abud 448 Feb 19, 2021
🐍 Simple FastAPI template with factory pattern architecture

Description This is a minimalistic and extensible FastAPI template that incorporates factory pattern architecture with divisional folder structure. It

Redowan Delowar 551 Dec 24, 2022
FastAPI + Postgres + Docker Compose + Heroku Deploy Template

FastAPI + Postgres + Docker Compose + Heroku Deploy ⚠️ For educational purpose only. Not ready for production use YET Features FastAPI with Postgres s

DP 12 Dec 27, 2022
FastAPI CRUD template using Deta Base

Deta Base FastAPI CRUD FastAPI CRUD template using Deta Base Setup Install the requirements for the CRUD: pip3 install -r requirements.txt Add your D

Sebastian Ponce 2 Dec 15, 2021
FastAPI Project Template

The base to start an openapi project featuring: SQLModel, Typer, FastAPI, JWT Token Auth, Interactive Shell, Management Commands.

A.Freud 4 Dec 5, 2022
FastAPI-Amis-Admin is a high-performance, efficient and easily extensible FastAPI admin framework. Inspired by django-admin, and has as many powerful functions as django-admin.

简体中文 | English 项目介绍 FastAPI-Amis-Admin fastapi-amis-admin是一个拥有高性能,高效率,易拓展的fastapi管理后台框架. 启发自Django-Admin,并且拥有不逊色于Django-Admin的强大功能. 源码 · 在线演示 · 文档 · 文

AmisAdmin 318 Dec 31, 2022
:rocket: CLI tool for FastAPI. Generating new FastAPI projects & boilerplates made easy.

Project generator and manager for FastAPI. Source Code: View it on Github Features ?? Creates customizable project boilerplate. Creates customizable a

Yagiz Degirmenci 1k Jan 2, 2023
Simple FastAPI Example : Blog API using FastAPI : Beginner Friendly

fastapi_blog FastAPI : Simple Blog API with CRUD operation Steps to run the project: git clone https://github.com/mrAvi07/fastapi_blog.git cd fastapi-

Avinash Alanjkar 1 Oct 8, 2022
Пример использования GraphQL Ariadne с FastAPI и сравнение его с GraphQL Graphene FastAPI

FastAPI Ariadne Example Пример использования GraphQL Ariadne с FastAPI и сравнение его с GraphQL Graphene FastAPI - GitHub ###Запуск на локальном окру

ZeBrains Team 9 Nov 10, 2022
Sample-fastapi - A sample app using Fastapi that you can deploy on App Platform

Getting Started We provide a sample app using Fastapi that you can deploy on App

Erhan BÜTE 2 Jan 17, 2022
Code Specialist 27 Oct 16, 2022