fastapi-templatekit
A FastAPI TemplateKit with a root-level, Django-style app layout.
CLI
Create a new project without installing this template into that project's environment:
uvx fastapi-templatekit startproject myproject
cd myproject
uvx fastapi-templatekit startapp users
Create the project files directly in the current directory:
uvx fastapi-templatekit startproject myproject .
If generated files already exist, the CLI asks before overwriting them. Use
--force to overwrite without a prompt:
uvx fastapi-templatekit startproject myproject . --force
Create the project at a custom path:
uvx fastapi-templatekit startproject myproject ../services/myproject
For local development from this repository:
uvx --from . fastapi-templatekit startproject myproject
Generated projects include a Typer management command to discover registered HTTP and websocket routes:
uv run myproject urls
Show available commands and details:
uvx fastapi-templatekit help
Add health probes to an existing generated project:
uvx fastapi-templatekit addhealthprobes
Create an app with optional websocket and database scaffolding:
uvx fastapi-templatekit startapp users
uvx fastapi-templatekit startapp users --with-websockets --with-database
Generated projects keep the main router beside main.py:
myproject/
├── pyproject.toml
├── fastapi_templatekit.toml
├── myproject/
│ ├── __init__.py
│ ├── main.py
│ ├── config.py
│ └── router.py
└── users/
├── __init__.py
├── router.py
├── endpoints/
│ ├── __init__.py
│ └── api.py
├── schemas/
│ ├── __init__.py
│ └── validator.py
├── service/
│ ├── __init__.py
│ └── users_service.py
├── models/ # created only with database/tables enabled
│ └── __init__.py
└── websocket/ # created only with websockets enabled
├── __init__.py
└── router.py
Structure
.
├── api/ # top-level router registration
├── health/ # example domain app at project root
├── main/
│ ├── config.py # settings and config live here
│ └── app.py # FastAPI declaration lives here
└── pyproject.toml
This follows the same domain-first idea from fastapi-best-practices, but without a src/ directory.
Feature apps and the shared API router live directly under the project root, similar to Django apps.
Run
uv run uvicorn main.app:app --reload
WebSockets
WebSocket routes are mounted under the same API prefix, so the default endpoint is:
/api/v1/ws/{room_name}
There is also a built-in browser test page at:
/api/v1/ws/test
This app uses fastapi-websockets with the package's environment-based channel-layer loader.
For websocket-related environment configuration, refer to https://github.com/Amogha-Hegde/fastapi-websockets.
Tests force FASTAPI_WEBSOCKETS_BACKEND=inmemory so they do not depend on a running database.
Example session:
connect ws://127.0.0.1:8000/api/v1/ws/demo
receive {"event":"connected","room":"demo",...}
send {"sender":"alice","message":"hello"}
receive {"event":"message","room":"demo","sender":"alice","message":"hello"}
Add a new app
Create a root-level package such as users/ or orders/, define its router there, and include it from your project's main router.py.
Metadata
Release files for fastapi-templatekit 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastapi_templatekit-0.1.1.tar.gz | 16.6 kB | With provenance | Details for fastapi_templatekit-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastapi_templatekit-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for fastapi_templatekit-0.1.1-py3-none-any.whl |
Total release size: 38.8 kB
Release files / fastapi_templatekit-0.1.1.tar.gz
| Download URL | fastapi_templatekit-0.1.1.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9479fbd7b05bcd8383cb9167acfc3d078b6eb0d93a487284f05269a5e8183ef
|
|
BLAKE2b-256 checksum How to use checksums |
c0e776bce1cf6c370a1e66b4ee19771a01ce20a8ea7eabf8b624ba26b443a271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 14, 2026.
Transparency logRelease files / fastapi_templatekit-0.1.1-py3-none-any.whl
| Download URL | fastapi_templatekit-0.1.1-py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7fdce6b36ea7a34086c6ccf9fea81bdcf4a81bde1cd9a404a56d5eb98d7dac0
|
|
BLAKE2b-256 checksum How to use checksums |
f838adf9f8e48ac8794d7c8e23067196d8f7a62b67f014448e6abb63b8567105
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 14, 2026.
Transparency logSecurity for fastapi-templatekit 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for fastapi_templatekit-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.