Package: fastapi-mvc
Documentation:https://fastapi-mvc.netlify.appSource Code:https://github.com/fastapi-mvc/fastapi-mvcProject scaffold:https://github.com/fastapi-mvc/copier-projectExample generated project:https://github.com/fastapi-mvc/exampleFastapi-mvc is a developer productivity tool for FastAPI web framework.
It is designed to make programming FastAPI applications easier by making assumptions about what every developer needs to get started.
It allows you to write less code while accomplishing more. Core features:Generated project based on MVC architectural patternWSGI + ASGI production serverGenerated project comes with Sphinx documentation and 100% tests coverageKubernetes deployment with Redis HA clusterMakefile, GitHub actions and utilitiesHelm chart for Kubernetes deploymentDockerfile with K8s and cloud in mindGenerate pieces of code or even your own generatorsUses Poetry dependency managementIncludes set of Nix expressionsUpdate already generated project with changes from the new template versionVirtualized reproducible development environment using VagrantFastapi-mvc comes with a number of scripts called generators that are designed to make your development life easier by
creating everything that’s necessary to start working on a particular task. One of these is the new application generator,
which will provide you with the foundation of a fresh FastAPI application so that you don’t have to write it yourself.Creating a new project is as easy as:$fastapi-mvcnew/tmp/galactic-empireThis will create a fastapi-mvc project called galactic-empire in a/tmp/galactic-empiredirectory and install its dependencies usingmake install.Once project is generated and installed lets run development uvicorn server (ASGI):$cd/tmp/galactic-empire
$fastapi-mvcrunTo confirm it’s actually working:$curl127.0.0.1:8000/api/ready{"status":"ok"}Now let's add new API endpoints. For that we need to generate new controller:$fastapi-mvcgeneratecontrollerdeath_starstatusload:postfire:deleteAnd then test generated controller endpoints:$curl127.0.0.1:8000/api/death_star/status{"hello":"world"}$curl-XPOST127.0.0.1:8000/api/death_star/load{"hello":"world"}$curl-XDELETE127.0.0.1:8000/api/death_star/fire{"hello":"world"}You will see it working in server logs as well:INFO:127.0.0.1:47284-"GET /api/ready HTTP/1.1"200OK
INFO:127.0.0.1:55648-"GET /api/death_star/status HTTP/1.1"200OK
INFO:127.0.0.1:55650-"POST /api/death_star/load HTTP/1.1"200OK
INFO:127.0.0.1:55652-"DELETE /api/death_star/fire HTTP/1.1"200OKYou can get the project directly from PyPI:pipinstallfastapi-mvcOr build with Nix from flake:# Optionally setup fastapi-mvc Nix binary cache to speed up the build process# https://app.cachix.org/cache/fastapi-mvc#pullnix-env-iAcachix-fhttps://cachix.org/api/v1/install
cachixusefastapi-mvc# Install with Nix from flake:nixbuildgithub:fastapi-mvc/fastapi-mvc#default--profile$HOME/.nix-profileProjects created with fastapi-mvcIf you have created a project with fastapi-mvc, feel free to open PR and add yourself to the list. Share your story and project. Your success is my success :)Projects:fastapi-mvc/example- Default generated project byfastapi-mvc new ...Community generatorsList of community generators that can be used with fastapi-mvc:rszamszur/copier-python-base- Copier template for scaffolding new Python projectContributingCONTRIBUTINGLicenseMIT