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
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
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
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

Mike Hoolehan 122 Dec 22, 2022
Ultimate Django3.2 Template for starting any project from not zero!

Ultimate Django3.2 Template for starting any project from not zero!

TheAliBigdeli 37 Dec 20, 2022
Cookiecutter-allpurpose-minimal-python - A simple cookiecutter template for general-purpose python projects.

cookiecutter-allpurpose-minimal-python A simple cookiecutter template for general-purpose python projects. To use, run pip install cookiecutter cookie

E. Tolga Ayan 2 Jan 24, 2022
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
Django starter project with 🔋

A batteries-included Django starter project. For a production-ready version see the book Django for Professionals. 🚀 Features Django 3.1 & Python 3.8

William Vincent 1.5k Jan 08, 2023
NHS Theme for Streamlit applications

NHS Streamlit App Template Deployment (local) The tool has been built using Stre

nhs.pycom 3 Nov 07, 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
Generic template for python service

Cookie cutter template example Technology stack Flask Gevent UWSGI Poetry Docker Docker-compose Installation pip install cookiecutter cookiecutter git

Churkin Oleg 11 Oct 22, 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
Django Boilerplate - Material Kit Design | AppSeed

Django Boilerplate - Material Kit Design | AppSeed

App Generator 45 Dec 23, 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
The starter for the Flask React project

Flask React Project This is the starter for the Flask React project. Getting started Clone this repository (only this branch) git clone https://github

Parker Bolick 2 May 14, 2022
A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.

Cookiecutter A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python

18.7k Jan 08, 2023
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

Peter Waters 2 Feb 06, 2022
Launchr is an open source SaaS starter kit, based on Django.

Launchr Launchr is an open source SaaS starter kit. About Launchr is a fully-equipped starter template, ready to start a SaaS web app. It implements t

Jannis Gebauer 183 Jan 06, 2023
Code Kata Python Template

Code Kata Python Template This is the code kata template for python created by Aula de Software Libre de la Universidad de Córdoba Step 1. Use this re

Sergio Gómez 2 Nov 30, 2021
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
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