Skip to main content

A CLI tool to create a FastAPI project.

Project description

Clean Architecture Template for FastAPI Applications

SQLModel SQLModel

This template provides a clean and well-structured foundation for building FastAPI applications using Clean Architecture principles. It uses SQLModel as the ORM and PostgreSQL as the database. It clearly separates business logic, use cases, infrastructure, and the API layer to ensure maintainability, testability, and scalability. With an explicit project structure and built-in testing strategy, it serves as a solid starting point for developing professional and production-ready backends.

Requirements

  • Python 3.10 or higher
  • PostgreSQL
  • uv for managing virtual environments and dependencies
  • justfile for command runner

Todo

Description Status
Setup project structure
Create database models and implement database connection
Test with real database (e.g., PostgreSQL, MySQL)
Setup migration (alembic)
Test on real project
Implement end-to-end tests setup
Implement integration tests setup

Setup

  1. Create project with
    uvx create-modern-fastapi
    
  2. Navigate to the project directory:
  3. Install dependencies:
    uv sync
    
  4. Run the application:
    just start
    

Flow

flowchart LR
    ENTRY[Entry Point]
    PRESENTATION[Presentation]
    APPLICATION[Application]
    INFRASTRUCTURE[Infrastructure]
    DOMAIN[Domain]

    ENTRY --> PRESENTATION
    PRESENTATION --> APPLICATION
    PRESENTATION --> INFRASTRUCTURE
    PRESENTATION --> DOMAIN
    APPLICATION --> DOMAIN
    INFRASTRUCTURE --> DOMAIN

Project Structure

In progress...

Testing

To run tests, use the following command:

  • Run unit tests:
    just test-unit
    
  • Run tests with coverage:
    just test-coverage
    
  • Run test for clean architecture dependency rules:
    just test-clean
    

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

create_modern_fastapi-0.4.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

create_modern_fastapi-0.4.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file create_modern_fastapi-0.4.0.tar.gz.

File metadata

  • Download URL: create_modern_fastapi-0.4.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for create_modern_fastapi-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5a3b042ade71f3384b90f9de3c13cb402c3e52b2924874bd25a083ba1d6e5346
MD5 d701f80596bf6a036d05940f54e12d40
BLAKE2b-256 3f34d72dd8e64fbc87e6a4879656091ca56ead43170bd5502afa56f47d03acfa

See more details on using hashes here.

File details

Details for the file create_modern_fastapi-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: create_modern_fastapi-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for create_modern_fastapi-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40d4a07ef8c1dc62caa6662680ea21ab172c4cdd91a3f79ada5306498e2dfce8
MD5 9c15d9c72c343a79a7ef0809a76d69f0
BLAKE2b-256 40e4d931ad42616e75714995a8df30f5d2205d37758632b6418edd6132f4b2b9

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