Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ name: Build

on:
push:
branches: ["**"]
paths-ignore:
- "**.md"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
workflow_dispatch:
workflow_call:

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build stage
FROM docker.io/library/python:3.14-slim as build
FROM docker.io/library/python:3.14-slim AS build
ARG REVISION
WORKDIR /opt/app
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${REVISION} \
Expand All @@ -20,9 +20,9 @@ FROM docker.io/library/python:3.14-slim
ARG REVISION
LABEL org.opencontainers.image.title="FastAPI Template"
LABEL org.opencontainers.image.description="FastAPI Template"
LABEL org.opencontainers.image.source="https://github.com/zbhavyai/fastapi-template"
LABEL org.opencontainers.image.source="https://github.com/devscompass/fastapi-template"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="Bhavyai Gupta <https://zbhavyai.github.io>"
LABEL org.opencontainers.image.authors="Devs Compass"
LABEL org.opencontainers.image.version="${REVISION}"
WORKDIR /opt/app
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${REVISION} \
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Bhavyai Gupta
Copyright (c) 2026 Devs Compass

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
# FastAPI Template

![Build](https://img.shields.io/github/actions/workflow/status/zbhavyai/fastapi-template/build.yml?label=Build)
![Release](https://img.shields.io/github/actions/workflow/status/zbhavyai/fastapi-template/release.yml?label=Release)
![License](https://img.shields.io/github/license/zbhavyai/fastapi-template?label=License)
[![Build](https://img.shields.io/github/actions/workflow/status/devscompass/fastapi-template/build.yml?label=Build)](https://github.com/devscompass/fastapi-template/actions/workflows/build.yml)
[![Release](https://img.shields.io/github/actions/workflow/status/devscompass/fastapi-template/release.yml?label=Release)](https://github.com/devscompass/fastapi-template/actions/workflows/release.yml)
[![License](https://img.shields.io/github/license/devscompass/fastapi-template?label=License)](https://github.com/devscompass/fastapi-template/blob/main/LICENSE)

A **starter template** for building backend applications with [FastAPI](https://fastapi.tiangolo.com/), the high-performance Python web framework.

## :sparkles: Tech Stack and Features

- :zap: [FastAPI](http://fastapi.tiangolo.com/), the high-performance Python web framework
- :jigsaw: [Pydantic](https://docs.pydantic.dev/) for data validation and settings management
- :gear: [SQLAlchemy](https://www.sqlalchemy.org/) and [asyncpg](https://github.com/MagicStack/asyncpg) for non-blocking database access
- :elephant: [PostgreSQL](https://www.postgresql.org/) as the production-ready relational database
- :luggage: [Alembic](https://alembic.sqlalchemy.org/) for version-controlled database migrations
- :open_file_folder: Defined project structure with ready-to-use [`pyproject.toml`](pyproject.toml) and [pydantic settings](app/core/settings.py)
- :pen: [VS Code](https://code.visualstudio.com/) settings included
- :art: [Ruff](https://docs.astral.sh/ruff/) for consistent code formatting and linting
- :page_facing_up: [.editorconfig](https://editorconfig.org/) for consistent coding styles across editors
- :broom: A `pre-commit` hook for style enforcement
- :test_tube: [pytest](https://docs.pytest.org/en/stable/) tests to keep code honest
- :whale: Containerization with Dockerfile and docker compose
- :otter: Automatic [Podman](https://podman.io/)/[Docker](https://www.docker.com/) detection for local dev
- :hammer_and_wrench: [Makefile](https://www.gnu.org/software/make/) targets for format, build, run, and container tasks
- :vertical_traffic_light: [GitHub Actions](https://github.com/features/actions) for CI/CD
- :label: Artifact versioning based on Git SHA or tag, both in CI/CD and local builds
- :robot: [Dependabot](https://github.com/dependabot) for automated dependency updates
- :zap: [FastAPI](http://fastapi.tiangolo.com/), the high-performance Python web framework
- :jigsaw: [Pydantic](https://docs.pydantic.dev/) for data validation and settings management
- :gear: [SQLAlchemy](https://www.sqlalchemy.org/) and [asyncpg](https://github.com/MagicStack/asyncpg) for non-blocking database access
- :elephant: [PostgreSQL](https://www.postgresql.org/) as the production-ready relational database
- :luggage: [Alembic](https://alembic.sqlalchemy.org/) for version-controlled database migrations
- :open_file_folder: Defined project structure with ready-to-use [`pyproject.toml`](pyproject.toml) and [pydantic settings](app/core/settings.py)
- :pen: [VS Code](https://code.visualstudio.com/) settings included
- :art: [Ruff](https://docs.astral.sh/ruff/) for consistent code formatting and linting
- :page_facing_up: [.editorconfig](https://editorconfig.org/) for consistent coding styles across editors
- :broom: A `pre-commit` hook for style enforcement
- :test_tube: [pytest](https://docs.pytest.org/en/stable/) tests to keep code honest
- :whale: Containerization with Dockerfile and docker compose
- :otter: Automatic [Podman](https://podman.io/)/[Docker](https://www.docker.com/) detection for local dev
- :hammer_and_wrench: [Makefile](https://www.gnu.org/software/make/) targets for format, build, run, and container tasks
- :vertical_traffic_light: [GitHub Actions](https://github.com/features/actions) for CI/CD
- :label: Artifact versioning based on Git SHA or tag, both in CI/CD and local builds
- :robot: [Dependabot](https://github.com/dependabot) for automated dependency updates

## :rocket: Getting started

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

```shell
make init
```

- Run the application in dev mode that enables live coding.
- Run the application in dev mode that enables live coding.

```shell
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.
- 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.

```shell
make format
Expand All @@ -58,7 +58,7 @@ A **starter template** for building backend applications with [FastAPI](https://
make container-build
```

1. Run the application
2. Run the application

```shell
make run
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@pytest.fixture(scope="session")
def postgres_container() -> Generator[PostgresContainer]:
container = PostgresContainer(
"docker.io/library/postgres:17.0",
"docker.io/library/postgres:18",
username="appuser",
password="apppass",
dbname="appdb",
Expand Down