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
A template for some new Python tool or package with a reasonable basic setup.

python-app-template A template with a reasonable basic setup, including: black (formatting) flake8 (linting) mypy (type checking) isort (import sortin

Anton Pirogov 3 Jul 19, 2022
A project to get you started with Docker and Django.

Docker Django tl;dr $ git clone [email protected]:erroneousboat/docker-django.git $ d

JP Bruins Slot 176 Dec 29, 2022
A Project Template With Python

File Structure . ├── LICENSE ├── Makefile # commands ├── README.md ├──

Annotation AI 61 Jan 02, 2023
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
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
A Django starter template with a sound foundation.

SOS Django Template SOS Django Tempalate is a Django starter template that has opinionated and good solutions while starting your new Django project.

Eray Erdin 19 Oct 30, 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
Project template layout for Django 3.0+

Django 3.0+ project template This is a simple Django 3.0+ project template with my preferred setup. Most Django project templates make way too many as

José Padilla 649 Dec 30, 2022
Django Webpack starter template for using Webpack 5 with Django 3.1 & Bootstrap 4. Yes, it can hot-reload.

Django Webpack Starter Hello fellow human. The repo uses Python 3.9.* Django 3.1.* Webpack 5.4.* Bootstrap 4.5.* Pipenv If you have any questions twe

Ganesh Khade 56 Nov 28, 2022
The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages that you need to jumpstart your next project.

Django Base Site The Django Base Site is a Django site that is built using the best Django practices and comes with all the common Django packages tha

Brent O'Connor 167 Jan 03, 2023
Forkable, Minimal Template for Starknet Projects.

Forkable, Minimal Template for Starknet Projects.

andreas 44 Oct 09, 2022
Um template para quem quiser usar o Docker + PGSQL + Django.

Um template para quem quiser usar o Docker + PGSQL + Django.

Drack 2 Mar 11, 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 01, 2021
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
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
Forkable, Minimal Template for Starknet Projects.

Forkable, Minimal Template for Starknet Projects.

velleity.eth 44 Oct 09, 2022
Template for creating PyPI project

template-for-creating-pypi-project Template for creating PyPI project Hello there! This is a template for creating a PyPI project. Fork or clone this

4 Apr 25, 2022
A framework for launching new Django Rest Framework projects quickly.

DRFx A framework for launching new Django Rest Framework projects quickly. Comes with a custom user model, login/logout/signup, social authentication

William Vincent 400 Dec 29, 2022
Template repository to build PyTorch projects from source on any version of PyTorch/CUDA/cuDNN.

Template repository to build PyTorch projects from source on any version of PyTorch/CUDA/cuDNN.

Joonhyung Lee/이준형 651 Dec 12, 2022
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