Skip to main content

A toolkit for building FastAPI projects with apps - internal and external pluggable apps

Project description

fastappkit

A toolkit for building FastAPI projects with apps — internal and external pluggable apps

License: MIT Python 3.11+

fastappkit brings Django-like app architecture to FastAPI, enabling modular development with both project-specific internal apps and reusable external pluggable apps.

What is fastappkit?

fastappkit is a toolkit for building FastAPI projects with a modular app architecture. It enables:

  • Internal apps — project-specific feature modules (like Django apps)
  • External apps — reusable, pluggable packages (like WordPress plugins)
  • Unified migrations — coordinated database schema management
  • Automatic router mounting — seamless integration of app routes
  • App validation and isolation — ensure apps don't conflict with each other

✨ Key Features

  • Clean project structure with automatic app discovery
  • Shared migrations for internal apps, isolated migrations for external apps
  • Automatic router mounting with configurable prefixes
  • Fail-fast validation and error handling
  • Support for both monorepo and multi-repo workflows
  • Simple CLI for project and app management

📦 Installation

Install fastappkit using pip or poetry:

pip install fastappkit

or

poetry add fastappkit

🏃 Quick Start

1. Create a new project

fastappkit core new myproject
cd myproject

This creates a complete FastAPI project structure with:

  • Core application setup
  • Database configuration
  • Migration system
  • App directory structure

2. Create an internal app

fastappkit app new blog

This creates a new internal app in apps/blog/ with models, router, and registers it in fastappkit.toml.

3. Run migrations

fastappkit migrate all

This runs all migrations in the correct order: core → internal apps → external apps.

4. Start the development server

fastappkit core dev

Your FastAPI application is now running at http://127.0.0.1:8000!

📚 Documentation

Comprehensive documentation is available at Read the Docs (coming soon).

For now, see docs/Usage.md for detailed usage instructions.

🎯 Core Concepts

Internal Apps

Internal apps are project-specific modules that live in your project's apps/ directory. They share the same migration system and database connection.

fastappkit app new blog
# Creates apps/blog/ with models, router, etc.

External Apps

External apps are reusable packages that can be installed via pip and plugged into any fastappkit project.

fastappkit app new payments --as-package
# Creates a standalone package structure

Migrations

fastappkit provides unified migration management:

  • Core migrations: Project-level schema changes
  • Internal app migrations: Shared migration directory for all internal apps
  • External app migrations: Isolated migrations per external app
# Create migrations for an internal app
fastappkit migrate app blog makemigrations -m "Add post model"

# Run all migrations
fastappkit migrate all

# Preview SQL before applying
fastappkit migrate preview

🛠️ CLI Commands

Project Management

fastappkit core new <name>          # Create a new project
fastappkit core dev                  # Run development server

App Management

fastappkit app new <name>            # Create an internal app
fastappkit app new <name> --as-package  # Create an external app
fastappkit app list                  # List all apps
fastappkit app validate <name>       # Validate an app

Migration Management

fastappkit migrate core -m "message"           # Create core migration
fastappkit migrate app <name> makemigrations   # Create app migration
fastappkit migrate app <name> upgrade         # Upgrade app migrations
fastappkit migrate app <name> downgrade -r <rev>  # Downgrade app migrations
fastappkit migrate all                        # Run all migrations
fastappkit migrate preview                    # Preview SQL for all migrations

📖 Example Project Structure

myproject/
├── core/
│   ├── config.py          # Settings (loads from .env)
│   ├── app.py             # create_app() factory
│   └── db/
│       └── migrations/    # Core migrations
├── apps/                   # Internal apps directory
│   └── blog/
│       ├── models.py
│       └── router.py
├── fastappkit.toml        # Project configuration
├── .env                   # Environment variables
└── main.py                # Entry point

🔧 Configuration

fastappkit uses fastappkit.toml for project configuration:

[tool.fastappkit]
apps = [
    "apps.blog",
    "apps.users",
    "external_package_name"
]

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📞 Support


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

fastappkit-0.1.4.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

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

fastappkit-0.1.4-py3-none-any.whl (71.9 kB view details)

Uploaded Python 3

File details

Details for the file fastappkit-0.1.4.tar.gz.

File metadata

  • Download URL: fastappkit-0.1.4.tar.gz
  • Upload date:
  • Size: 45.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastappkit-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5a27a8ebcbd081d402ed63888c66f77669ffd213ff98297884068873007d97be
MD5 a5e9c6e4aee5632470e479681ef59b50
BLAKE2b-256 af438d7ad0edf4bd3564ae5880abab527777a22f9e0683778dcc85dade588694

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastappkit-0.1.4.tar.gz:

Publisher: publish.yml on vanylabs/fastappkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastappkit-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: fastappkit-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 71.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastappkit-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 52d7ec6c5088461f96d08a7c7deaadf2fe6a7d3d907af81aa411a42df4123dc1
MD5 ec45c1061a9d291e4c091a89e3aa02a4
BLAKE2b-256 3e9f39d71c47ccb82b47a5fb600b8d32194e12c4fe9c7b6319901e056cbd985d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastappkit-0.1.4-py3-none-any.whl:

Publisher: publish.yml on vanylabs/fastappkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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