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) ) coder@MYSERVER:~/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
Python-boilerplate - Python Boilerplate Project Structure

python-boilerplate Python Boilerplate Project Structure Folder Structure .github

null 1 Jan 18, 2022
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.

App Generator 37 Dec 24, 2022
Brif is a boilerplate tool based on Docker and FastAPI, designed to streamline the development and deployment of IIIF compliant platforms.

brif A boilerplate tool based on Docker, designed to streamline the development and deployment of IIIF compliant platforms. Embedded with FastAPI, Cel

Pierre 8 Sep 17, 2022
A boilerplate for Django web applications

Django Hackathon Starter A boilerplate application for Django web applications. If you've attented hackathons, you already know how much time can be w

David Leonard 1.6k Dec 31, 2022
Backend Boilerplate using Django,celery,Redis

Backend Boilerplate using Django,celery,Redis

Daniel Mawioo 2 Sep 14, 2022
A boilerplate Django project for quickly getting started.

The Definitive Django Learning Platform. Django Project Boilerplate This repository is a boilerplate Django project for quickly getting started. Getti

Le Huynh Long 1 Nov 1, 2021
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
Boilerplate code for a Python Flask API

MrMat :: Python :: API :: Flask Boilerplate code for a Python Flask API This variant of a Python Flask API is code-first and using native Flask Featur

null 0 Dec 26, 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
A Boilerplate repo for Scientific Python Open Science projects

A Boilerplate repo for Scientific Python Open Science projects Installation Clone this repo If you need a fresh python environment, run $ conda env cr

Vincent Choqueuse 2 Dec 23, 2021