Skip to main content

A comprehensive toolkit for kickstarting FastAPI projects with best practices.

Project description

FastAPI Init Project ๐Ÿš€

Python 3.8+ FastAPI License: MIT

A comprehensive toolkit for kickstarting FastAPI projects with best practices, production-ready configurations, and modern development tools.


โœจ Features

  • ๐Ÿ—๏ธ Project scaffolding with best-practice structure
  • ๐Ÿ” JWT authentication & security
  • ๐Ÿ—„๏ธ SQLAlchemy ORM & Alembic migrations
  • ๐Ÿงช Pytest-based test setup
  • ๐Ÿณ Docker & Docker Compose support
  • ๐Ÿ“Š Health checks & onboarding reports
  • ๐Ÿ”’ CORS & environment validation
  • ๐Ÿ“ Structured logging
  • ๐Ÿ“š Automatic API documentation

๐Ÿš€ Quick Start

Installation

pip install -e .

Create a New Project

fastapi-init-project init my-api
# Options:
#   --with-database   Include database setup
#   --with-auth       Include JWT authentication
#   --with-docker     Include Docker & Compose
#   --with-tests      Include test setup

# Example:
fastapi-init-project init my-api --with-database --with-auth --with-docker --with-tests

CLI Commands

fastapi-init-project init <project_name> [options]   # Scaffold a new project
fastapi-init-project env-check                      # Check environment for issues
fastapi-init-project onboarding-report              # Generate onboarding report
fastapi-init-project setup-database                 # Set up Alembic migrations
fastapi-init-project docker-setup                   # Add Docker configuration

๐Ÿ“ Project Structure

my-api/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ””โ”€โ”€ v1/
โ”‚   โ”‚       โ”œโ”€โ”€ auth_router.py
โ”‚   โ”‚       โ”œโ”€โ”€ health.py
โ”‚   โ”‚       โ””โ”€โ”€ router.py
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ auth.py
โ”‚   โ”‚   โ”œโ”€โ”€ config.py
โ”‚   โ”‚   โ”œโ”€โ”€ database.py
โ”‚   โ”‚   โ”œโ”€โ”€ logging.py
โ”‚   โ”‚   โ””โ”€โ”€ middleware.py
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ””โ”€โ”€ models.py
โ”‚   โ”œโ”€โ”€ schemas/
โ”‚   โ”‚   โ””โ”€โ”€ schemas.py
โ”‚   โ””โ”€โ”€ main.py
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ alembic/
โ”œโ”€โ”€ logs/
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ .env.example
โ””โ”€โ”€ README.md

๐Ÿงช Testing

pytest
pytest --cov=app

๐Ÿณ Docker

docker build -t my-api .
docker run -p 8000:8000 my-api
docker-compose up -d

โš™๏ธ Configuration

Copy .env.example to .env and edit as needed:

  • SECRET_KEY: JWT secret key
  • DATABASE_URL: Database connection string
  • DEBUG: Enable debug mode
  • ALLOWED_ORIGINS: CORS allowed origins

๐Ÿ“š Documentation


๐Ÿค Contributing

Contributions are welcome! Please open issues or pull requests on GitHub.


๐Ÿ“„ License

MIT License. See LICENSE for details.


Made with โค๏ธ for the FastAPI community

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_init_project-0.2.2.tar.gz (25.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_init_project-0.2.2-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_init_project-0.2.2.tar.gz.

File metadata

  • Download URL: fastapi_init_project-0.2.2.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for fastapi_init_project-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b0fa944efc92d6e2af162472857314e6a2f12089da30a4870bed0a1bba57581a
MD5 fa783df03c75f40688cbf14e799213ab
BLAKE2b-256 4fe296a30f52ae37e6189cb5ce8bf76db0987e79424642356230830042ec6301

See more details on using hashes here.

File details

Details for the file fastapi_init_project-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_init_project-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0336c77ada59de7e6360bf8f1b1aa85cd78c1872fccda2c563dc5510f2ec54b6
MD5 b15ebc66e4f0783b9711bd5be0a2f04f
BLAKE2b-256 ece3ea414d18c1d1ce3be40c80da6c93c092ffa62c85aa6bbf1c6dc17bb7f4db

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