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

Uploaded Python 3

File details

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

File metadata

  • Download URL: create_modern_fastapi-0.4.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2.tar.gz
Algorithm Hash digest
SHA256 f6cfdb610d009885e4d870dca7b1a47bf81086968786cdf85a3471c7c677d225
MD5 407b1699250a15dbe97b77b7f4ba5ce7
BLAKE2b-256 30e49a69333dbad3629011ce6305c756b679c6881e3ca8cf39544d6b1f3881b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: create_modern_fastapi-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 50b6531b66bb737348009d2e6f66d10ed8516131b846f29b009ee809e73fac5d
MD5 554e9f2d6724b7144840af0d1f65fc78
BLAKE2b-256 b8366f9680d5434d1913079389267a74526a73bb1f97fe7c7afed4be9e772992

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