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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastappkit-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 8508cd0bf39c3e1f071d7b47cbde3e16023ba4b0deb32a47bf00e131556de9c4
MD5 76192e5dc83fbb35dea3599c1db7b9cd
BLAKE2b-256 b5abe22f11ddbf7ca3e972a83cfbc9b13b72cc7e089da8b039166a169836a5e8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: fastappkit-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 72.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1451561c18cc934733916a87d76e81ad2c4bdb7b5b3e9d1b59eb7d4e3cd8c1df
MD5 378e8e1a891241a8f9172efd74cd4988
BLAKE2b-256 b6bf04ef5ddc0f4291a97ba41b5231d66e5a7c0df127cd2fadb018c6d7792d10

See more details on using hashes here.

Provenance

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