Skip to main content

A customizable Cookiecutter template for generating production-ready FastAPI projects

Project description

FastAPI Cookiecutter

⚡ A Powerhouse Template for FastAPI Projects ⚡

FastAPI Cookiecutter is a highly customizable Python template designed to kickstart your FastAPI applications with a production-ready structure. Perfect for developers who want a scalable, modular foundation without the setup grind.


Key Features

  • Flexible Setup: Choose between PostgreSQL or SQLite databases.
  • Optional Add-Ons: Enable Docker, Redis, or GitHub Actions CI/CD with a single prompt.
  • Modular Design: Prebuilt structure with routers, models, schemas, and services.
  • Testing Ready: Built-in Pytest support for async testing.
  • Database Migrations: Seamless integration with Alembic for schema management.
  • Health Checks: Monitor your app’s status with a dedicated endpoint.

Installation

Install FastAPI Cookiecutter via PyPI (assuming you publish it):

pip install fastapi-cookiecutter

Requirements

  • Python 3.11+
  • Dependencies: cookiecutter (automatically installed via pip)

Quick Start

After installation, generate a new FastAPI project:

fastapi-cookiecutter

Or use it directly from GitHub:

cookiecutter gh:<your-username>/fastapi-cookiecutters

Answer the prompts to customize your project, and you’re good to go!


Usage Examples

Here’s how to wield FastAPI Cookiecutter:

Basic Project

Generate a simple FastAPI app with SQLite:

cookiecutter gh:<your-username>/fastapi-cookiecutters
# Enter project_name="MyAPI", database="sqlite", use_docker="no", use_ci_cd="no"

Full-Stack Setup

Create a loaded project with Postgres, Docker, and CI/CD:

cookiecutter gh:<your-username>/fastapi-cookiecutters --no-input \
  project_name="MyAPI" database="postgres" use_redis="yes" use_docker="yes" use_ci_cd="yes"

Check the generated README.md for next steps!


Configuration Options

When running the template, you’ll be prompted for:

Option Description Choices/Default
project_name Name of your project e.g., "MyAPI"
project_slug Auto-generated project directory name Auto-filled
author Your name e.g., "Your Name"
version Project version "0.1.0"
description Short project description e.g., "A FastAPI app"
database Database type "postgres" / "sqlite"
use_redis Include Redis support "yes" / "no"
use_docker Include Docker and Compose files "yes" / "no"
use_ci_cd Include GitHub Actions CI/CD pipeline "yes" / "no"

Why FastAPI Cookiecutter?

  • Speedy Setup: From template to running app in under 5 minutes.
  • Custom Power: Tailor your project with zero bloat.
  • Scalable Base: Ready for small scripts or massive APIs.
  • Pro Features: Everything you need, nothing you don’t.

License

FastAPI Cookiecutter is licensed under the MIT License. Use it, tweak it, share it—responsibly.


Notes

  • Responsible Customization: Only include what your project needs—keep it lean!
  • Feedback: Got ideas? Open an issue on GitHub!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_cookiecutters-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_cookiecutters-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_cookiecutters-0.1.0.tar.gz.

File metadata

  • Download URL: fastapi_cookiecutters-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for fastapi_cookiecutters-0.1.0.tar.gz
Algorithm Hash digest
SHA256 faa396bbe21b855ab5e8d30b4a268c7ff54dd531d5512176327541be8266a01f
MD5 bb9b09954fa38f3b2a5845405807a800
BLAKE2b-256 8cfad86535749c1e0019f65b8cd9de1dfc7aed8013e7106b1988be5542eea879

See more details on using hashes here.

File details

Details for the file fastapi_cookiecutters-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_cookiecutters-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07d8ae52f47c6a2c2bf3fcc952e441999eca0a4ed4457cc4ad9dc9411e695819
MD5 d9c15fd76716df3cfed711a2e5d65811
BLAKE2b-256 a582e74f997a51efb5c6fda87133e20e312cc9ccdc173fb42e0757bd23aa23a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page