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.7.tar.gz (45.4 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.7-py3-none-any.whl (71.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastappkit-0.1.7.tar.gz
  • Upload date:
  • Size: 45.4 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.7.tar.gz
Algorithm Hash digest
SHA256 3ed4b7eee2501fd215f39d5b7ede2541c425d66c77787dac08ee849fe68fc732
MD5 22ca166e77062322df5cc61014ec6c0f
BLAKE2b-256 d241fd3c8ae5e19463aa71531416961495a64b28ac2ffa6161cdd1d5fda407bd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: fastappkit-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 71.8 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c204ff403c2bede4dd9d5d153d1f8895ea714f69b9928e8b0f4bd782f15aa8b9
MD5 36ac420877b9f787a0c5f1f46a70d866
BLAKE2b-256 584c1b9ff56ef9265c80380d05c4698106e82777fd96be6b23865cee1cf20b6c

See more details on using hashes here.

Provenance

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