Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Custom Template

Overview

This repository servers as a template for applications build with FastAPI web framework

I included the whole basic functionality based on my experience most projects used:

  1. Pipenv with pre-listed libraries;
  2. Makefile for improving developer experience;
  3. Docker & Docker Compose;
  4. Dockerized PostgreSQL;
  5. Ready-to-use Alembic;
  6. Ready-to-use SQLAlchemy with CRUDMixin;
  7. Authentication middleware;
  8. Caching middleware with Redis;
  9. RequestService for making external HTTP requests;
  10. Ready-to-use test environment.

The application uses Python 3.12 and all newest versions as in 2024-10-20.

There are two database declared in the docker-compose.yml file:

  1. PostgreSQL as a primary database;
  2. Redis for caching HTTP requests.

Prerequisites

  • Pipenv
  • Docker & Docker Compose
  • Make

How to run

Create .env file in the project root directory and fill it up according to .env.sample file.

To spin up the whole application, you can enter:

make start

To shut it down, you can enter:

make down

Note

When adding a new database model, remember to import it in init.py file.

Explore other available Make commands

To display all available commands and their description, you can enter:

make help

About

Custom template for FastAPI applications

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages