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.2.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.2-py3-none-any.whl (71.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastappkit-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 22b818e92b23c66d73078ce90b53529c2161ffc135ec300c7555971afc4329c1
MD5 40534890505ab2cf95828632e45518dd
BLAKE2b-256 249826348eb100728074b675c96d4625cd78f8310999f69e7ef3c0b8fccc78c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastappkit-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: fastappkit-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 56ce8ea108e29cf3bca0ff26b2089292b28f7500496b3750a0a3c11955f8b1d4
MD5 b795cc7b24bc89dd24a5932d22b2ff57
BLAKE2b-256 242aa8c24bc51663aacb6ab1fdae032f554831b371a411fd5a8783360cdf9030

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastappkit-0.1.2-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