Skip to content

devscompass/fastapi-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

FastAPI Template

Build Release License

A starter template for building backend applications with FastAPI, the high-performance Python web framework.

✨ Tech Stack and Features

  • ⚑ FastAPI, the high-performance Python web framework
  • 🧩 Pydantic for data validation and settings management
  • βš™οΈ SQLAlchemy and asyncpg for non-blocking database access
  • 🐘 PostgreSQL as the production-ready relational database
  • 🧳 Alembic for version-controlled database migrations
  • πŸ“‚ Defined project structure with ready-to-use pyproject.toml and pydantic settings
  • πŸ–ŠοΈ VS Code settings included
  • 🎨 Ruff for consistent code formatting and linting
  • πŸ“„ .editorconfig for consistent coding styles across editors
  • 🧹 A pre-commit hook for style enforcement
  • πŸ§ͺ pytest tests to keep code honest
  • 🐳 Containerization with Dockerfile and docker compose
  • 🦦 Automatic Podman/Docker detection for local dev
  • πŸ› οΈ Makefile targets for format, build, run, and container tasks
  • 🚦 GitHub Actions for CI/CD
  • 🏷️ Artifact versioning based on Git SHA or tag, both in CI/CD and local builds
  • πŸ€– Dependabot for automated dependency updates

πŸš€ Getting started

  • Before you start development on this project, run the init target. This will install a pre-commit hook and install dependencies.

    make init
  • Run the application in dev mode that enables live coding.

    make dev
  • To format the code while developing, you may use for IDE and turn on the auto-formatting on save. You may also use the format target.

    make format

πŸ“¦ Packaging and running

  1. Build the application

    make build
    
    # OR
    
    make container-build
  2. Run the application

    make run
    
    # OR
    
    make container-run

πŸ“„ License

The FastAPI Template is licensed under the terms of the MIT license.

About

A ready-to-use template for building backend applications using Python and FastAPI

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors