A full stack boilerplate for FastAPI

Overview

FastAPI Full-Stack Boilerplate

Features

  1. All the goodness of modern, async FastAPI
  2. Seamless Jinja2 templating, just like Flask
  3. SQLAlchemy ORM and Alembic migrations (PostgreSQL)
  4. Flask-Admin plugged right in
  5. Pipenv for python dependency management

Explore the full docs here

Get Started

  1. Copy .env.example to .env (or create your own)
  2. docker-compose up -d to start the database
  3. pipenv shell
  4. uvicorn --factory app.main:create_app --reload --port=8080

Configuration

  • Change the database configuration/credentials in .env and docker-compose.yaml
  • Set DEBUG_ADMIN=1 to disable the authorization for the admin panel

Why?

The dependency-injection provided by FastAPI is such a huge improvement over any other python web framework. It's OpenAPI integration is excellent, and it's asgi-first, unlike Flask or Django.

But Django is famous for its admin panel, and the ability to rapidly build server side applications. For this, we include Flask-Admin, and centralied Jinja2 templates as a dependency.

Built On

You might also like...
King is a simple boilerplate from a bigger Discord Bot project created for my Discord Server.
King is a simple boilerplate from a bigger Discord Bot project created for my Discord Server.

King A simple Discord bot boilerplate. King is a simple boilerplate from a bigger Discord Bot project created for my Discord Server. I intend to showc

This is a boilerplate for a basic backend app using Python, Django and SQLite, as developed after tutorials with Programming with Mosh

This is a boilerplate for a basic backend app using Python, Django and SQLite, as developed after tutorials with Programming with Mosh

Vue + Django with no compromises. Django Templates and Vue SFCs in harmony without sacrificing the full power of either.

Cookiecutter Vue Django Vue + Django with no compromise. Cookiecutter Vue Django is a framework for jumpstarting production-ready Django + Vue project

Combine the power of FastAPI and Django to build a production-ready application capable of utilizing all of the best features of both worlds.
Combine the power of FastAPI and Django to build a production-ready application capable of utilizing all of the best features of both worlds.

FastAPI and Django Combo This projects aims to combine FastAPI and Django to build a Production ready application capable of utilizing all of the feat

This is a FastAPI, React, MongoDB stack Boilerplate. It's as glorious as a highland coo.
This is a FastAPI, React, MongoDB stack Boilerplate. It's as glorious as a highland coo.

Coo - F.A.R.M stack BoilerPlate F.A.R.M - FastAPI, React, MongoDB This boilerplate utilizes FastAPI to build a REST API, MongoDB for data storage, and

Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more.
Full stack, modern web application generator. Using FastAPI, PostgreSQL as database, Docker, automatic HTTPS and more.

Full Stack FastAPI and PostgreSQL - Base Project Generator Generate a backend and frontend stack using Python, including interactive API documentation

Python-boilerplate - Python Boilerplate Project Structure

python-boilerplate Python Boilerplate Project Structure Folder Structure .github

FastyAPI is a Stack boilerplate optimised for heavy loads.
FastyAPI is a Stack boilerplate optimised for heavy loads.

FastyAPI A FastAPI based Stack boilerplate for heavy loads. Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Pr

Stream-Kafka-ELK-Stack - Weather data streaming using Apache Kafka and Elastic Stack.
Stream-Kafka-ELK-Stack - Weather data streaming using Apache Kafka and Elastic Stack.

Streaming Data Pipeline - Kafka + ELK Stack Streaming weather data using Apache Kafka and Elastic Stack. Data source: https://openweathermap.org/api O

Free and open source full-stack enterprise framework for agile development of secure database-driven web-based applications, written and programmable in Python.

Readme web2py is a free open source full-stack framework for rapid development of fast, scalable, secure and portable database-driven web-based applic

A collection of full-stack resources for programmers.
A collection of full-stack resources for programmers.

A collection of full-stack resources for programmers.

Cloud Native sample microservices showcasing Full Stack Observability using AppDynamics and ThousandEyes
Cloud Native sample microservices showcasing Full Stack Observability using AppDynamics and ThousandEyes

Cloud Native Sample Bookinfo App Observability Bookinfo is a sample application composed of four Microservices written in different languages.

A generalized framework for prototyping full-stack cooperative driving automation applications under CARLA+SUMO.
A generalized framework for prototyping full-stack cooperative driving automation applications under CARLA+SUMO.

OpenCDA OpenCDA is a SIMULATION tool integrated with a prototype cooperative driving automation (CDA; see SAE J3216) pipeline as well as regular autom

A full-stack clone of Instagram, allowing the user to interact with posts and other users.
A full-stack clone of Instagram, allowing the user to interact with posts and other users.

This project is a full-stack clone of Instagram, allowing the user to interact with posts and other users

A full stack e-learning application, this is the backend using django restframework and docker.

DevsPrime API API Service backing client interfaces Technologies Python 3.9 : Base programming language for development Bash Scripting : Create conven

A multi-functional library for full-stack Deep Learning. Simplifies Model Building, API development, and Model Deployment.
A multi-functional library for full-stack Deep Learning. Simplifies Model Building, API development, and Model Deployment.

chitra What is chitra? chitra (चित्र) is a multi-functional library for full-stack Deep Learning. It simplifies Model Building, API development, and M

 cLoops2: full stack analysis tool for chromatin interactions
cLoops2: full stack analysis tool for chromatin interactions

cLoops2: full stack analysis tool for chromatin interactions Introduction cLoops2 is an extension of our previous work, cLoops. From loop-calling base

Open-source full-stack seed project that uses a React UI powered by a simple Flask API Server
Open-source full-stack seed project that uses a React UI powered by a simple Flask API Server

React Flask Authentication Open-source full-stack seed project that uses a React UI powered by a simple Flask API Server.

4Geeks Academy Full-Stack Developer program final project.

Final Project Chavi, Clara y Pablo 4Geeks Academy Full-Stack Developer program final project. Authors Javier Manteca - Coding - chavisam Clara Rojano

Comments
  • No such file or directory - cache_manifest.json

    No such file or directory - cache_manifest.json

    @ttymck looks like a a great code. However I am getting the following error on the first, wanna check if you might know the fix? Tried googling, not much help.

    ((fastapi-fullstack-boilerplate) ) [email protected]:~/mynotes/fastapi/fastapi-fullstack-boilerplate$ uvicorn --factory app.main:create_app --reload --port=8080
    INFO:     Will watch for changes in these directories: ['/home/coder/mynotes/fastapi/fastapi-fullstack-boilerplate']
    INFO:     Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
    INFO:     Started reloader process [31471] using statreload
    Process SpawnProcess-1:
    Traceback (most recent call last):
      File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
        self.run()
      File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
        self._target(*self._args, **self._kwargs)
      File "/home/coder/.local/share/virtualenvs/fastapi-fullstack-boilerplate-IipA4anG/lib/python3.8/site-packages/uvicorn/subprocess.py", line 76, in subprocess_started
        target(sockets=sockets)
      File "/home/coder/.local/share/virtualenvs/fastapi-fullstack-boilerplate-IipA4anG/lib/python3.8/site-packages/uvicorn/server.py", line 68, in run
        return asyncio.run(self.serve(sockets=sockets))
      File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
        return loop.run_until_complete(main)
      File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
        return future.result()
      File "/home/coder/.local/share/virtualenvs/fastapi-fullstack-boilerplate-IipA4anG/lib/python3.8/site-packages/uvicorn/server.py", line 76, in serve
        config.load()
      File "/home/coder/.local/share/virtualenvs/fastapi-fullstack-boilerplate-IipA4anG/lib/python3.8/site-packages/uvicorn/config.py", line 454, in load
        self.loaded_app = self.loaded_app()
      File "/home/coder/mynotes/fastapi/fastapi-fullstack-boilerplate/./app/main.py", line 53, in create_app
        static_digest = StaticDigest(source_dir=settings.STATIC_DIR)
      File "/home/coder/.local/share/virtualenvs/fastapi-fullstack-boilerplate-IipA4anG/lib/python3.8/site-packages/fastapi_static_digest/digest.py", line 51, in __init__
        self.manifest = self._load_manifest()
      File "/home/coder/.local/share/virtualenvs/fastapi-fullstack-boilerplate-IipA4anG/lib/python3.8/site-packages/fastapi_static_digest/digest.py", line 54, in _load_manifest
        with open(self.manifest_file, "r") as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/home/coder/mynotes/fastapi/fastapi-fullstack-boilerplate/app/static/_digest/cache_manifest.json'
    

    Here are my steps:

    pip install pipenv
    pipenv shell
    pipenv install --dev
    uvicorn --factory app.main:create_app --reload --port=8080
    
    opened by am1ru1 2
  • some issues about db connection

    some issues about db connection

    Hi ttymck, thank you for sharing your project! It's great!

    I ran into few issues in calling /api, after some research I fixed. I would like to share my fix:

    for .env.example, the DB_URL should be:

    DB_URL='postgresql+psycopg2://${DB_HOST}/${DB_NAME}'
    

    for dependencies.py, there should have a new function for APIRoutes class:

    def get_db():
        with get_db_session() as db:
            return db
    

    in main.py, APIRoutes depends should be:

    from .dependencies import get_db, Templates, Render
    db: Session = Depends(get_db)
    

    thanks for your sharing!

    opened by lwz7512 2
  • A few adjustments to make setup easier

    A few adjustments to make setup easier

    I realized that there's some missing dependencies and steps in "Getting started" instructions.

    I had problems with "StaticDigest" so I created a DEV env var. If it's set to 1, StaticDigest is turned off.

    opened by vidz1979 0
Releases(2022.06)
  • 2022.06(Jun 25, 2022)

    • extracted Jinja2 Templates dependency to dedicated package: fastapi-jinja-utils
    • take fastapi-utils as a dependency instead of copy-pasta the cbv
    • update fastapi, jinja versions
    Source code(tar.gz)
    Source code(zip)
Owner
Tyler M. Kontra
head -c64 /dev/ttymck | cowsay
Tyler M. Kontra
Cookiecutter Flask OpenAPI is a template for jumpstarting production-ready Flask projects quickly.

Cookiecutter Flask OpenAPI is a template for jumpstarting production-ready Flask projects quickly. It has a well organized and scalable structure. It uses API design first

Roger Camargo 3 Nov 17, 2022
Django project/application starter for lazybones :)

Django Project Starter Template My custom project starter for Django! I’ll try to support every upcoming Django releases as much as I can! Requirement

Uğur Özyılmazel 40 Jul 16, 2022
A template repository implementing HTML5 Boilerplate 8.0 in Sanic using the Domonic framework.

sanic-domonic-h5bp A template repository implementing HTML5 Boilerplate 8.0 in Sanic using the Domonic framework. If you need frontend interactivity,

PyXY 3 Dec 12, 2022
PyPC is a very simple tool that creates Python projects from templates.

PyPC (Python Project Creator) PyPC is a very simple tool that creates Python projects from templates. In 0.1v#alpha, custom template creation will be

art3m1s 1 Nov 26, 2021
Setup a flask project using a single command, right from creating virtual environment to creating Procfile for deployment.

AutoFlask-Setup About AutoFlask-Setup can help you set up a new Flask Project, right from creating virtual environment to creating Procfile for deploy

Ashutosh Krishna 1 Oct 21, 2021
CRUD app to create and save code snippets, Flask/Python restful Api/backend and React/Typescript frontend

MS3 Cheat-Hub A cheatsheet hub. An app that organizes your code snippets into collections of cheat sheets and allows you to view, like and save others

Joem Elias Sanez 21 Dec 28, 2022
The starter repository for submissions to the GeneDisco challenge for optimized experimental design in genetic perturbation experiments

GeneDisco ICLR-22 Challenge Starter Repository The starter repository for submissions to the GeneDisco challenge for optimized experimental design in

22 Dec 06, 2022
A platform for developers 👩‍💻 who wants to share their programs and projects.

Hacktoberfest-2021 A platform for developers 👩‍💻 who wants to share their projects and programs. Hacktoberfest has updated their rules and now this

Mayank Choudhary 40 Nov 07, 2022
Forkable, Minimal Template for Starknet Projects.

Forkable, Minimal Template for Starknet Projects.

andreas 44 Oct 09, 2022
Starter project for python based lambda project.

Serverless Python Starter Starter project for python based lambda project. Features FastAPI - Frontend dev with Hot Reload API Gateway Integration (+r

4 Feb 22, 2022
Backend Boilerplate using Django,celery,Redis

Backend Boilerplate using Django,celery,Redis

Daniel Mawioo 2 Sep 14, 2022
A test Django application with production-level docker setup

DockerApp A test Django application with production-level docker setup. Blog: https://medium.com/@siddharth.sahu/the-near-perfect-dockerfile-for-djang

Siddharth Sahu 44 Nov 18, 2022
Creating Templates and components so those can be reusable some time and makes workflow a lot easier!

TEMPLATES AND COMPONENTS IN ANY LANG! This is an Open Repository For Students to Contribute code in Hackoctoberfest in different Languages and Tech me

SriSravyaN 9 Feb 19, 2022
This is a boilerplate for a basic backend app using Python, Django and SQLite, as developed after tutorials with Programming with Mosh

This is a boilerplate for a basic backend app using Python, Django and SQLite, as developed after tutorials with Programming with Mosh

Gustavo Catala Sverdrup 1 Jan 07, 2022
A template repo for use in the Advent of Code

AoC-Template A template repo for use in the Advent of Code The README_template.md must contain "STATS_TABLE" to be replaced by the generated table, an

0 Jan 14, 2022
Python-boilerplate - Python Boilerplate Project Structure

python-boilerplate Python Boilerplate Project Structure Folder Structure .github

1 Jan 18, 2022
Template to quickly start your playwright-python project

Playwright-python template 🍪 Template to quickly start your playwright-python project Getting started • Demo • Configuration Getting started Clone th

Constantin 1 Dec 13, 2021
Boilerplate for starting a python project

Python Project Boilerplate Simple boilerplate for starting a python proect. Using the repo Follow following steps to install client on server Create a

Prajwal Dahal 1 Nov 19, 2021
Django sample app with users including social auth via Django-AllAuth

demo-allauth-bootstrap Simple, out-of-the-box Django all-auth demo app A "brochure" or visitor (no login required) area A members-only (login required

Andrew E 215 Dec 20, 2022
Mad-cookiecutter - Cookiecutter templates for MaD projects

MaD Cookiecutter Templates A set of templates that can be used to quickly get st

Machine Learning and Data Analytics Lab FAU 1 Jan 10, 2022