Skip to main content Switch to mobile version ui-foundation-backend 6.1.1 The auth and security layer shared by FastAPI + SQLModel backends built on ui-foundation: sessions, sign-in limits, TOTP, error reporting, deploy checks, AI chats' OAuth.
pip install ui-foundation-backend==6.1.1 Copy PIP instructions
The auth and security layer shared by the FastAPI + SQLModel backends of apps built on ui-foundation: the half of every app's backend that apps never change on purpose. Import package foundation_backend. Released with @tristan2828/ui-foundation, under the same version number, from the same commit.
An app keeps everything else: its entities, models, routers and migrations, its McpEntity list (app/mcp_entities.py), the jobs it registers by name, and its main.py, which includes the package's routers and starts its jobs.
backend/pyproject.toml pins it to the release the app is on, the same version as its @tristan2828/ui-foundation:
dependencies = [ "ui-foundation-backend==6.1.1", ... ] The app's own modules re-export it, so from app.models import User keeps working (the template's app/config.py, db.py, models.py, schemas.py, openapi_responses.py, security.py, errors.py, spa.py do this), and its main.py includes the routers it offers:
from foundation_backend.routers import auth, client_errors, environment, oauth app.include_router(auth.router, prefix="/api") app.include_router(auth.register_router, prefix="/api") # only if people make their own accounts app.include_router(client_errors.router, prefix="/api") app.include_router(environment.router, prefix="/api") app.include_router(oauth.router) # only with AI chats (MCP) register_router is separate on purpose. An app where accounts are made by whoever runs it leaves it out, with /auth/register out of its openapi.yaml (the path is x-optional) and LoginRoute registerPath={null}. Including router alone serves sign-in with no way to make an account through the API.
DATABASE_URL can be a connection string as a provider or a compose file gives it: postgres:// and postgresql:// become postgresql+asyncpg://, libpq's sslmode and channel_binding are dropped from the query (asyncpg reads neither), and sslmode (require, verify-ca, verify-full) sets DATABASE_SSL's default. An explicit DATABASE_SSL wins; with neither, SSL is off. So the scripts run as python -m foundation_backend.scripts.
A setting the package reads is changed at runtime (a test's monkeypatch) on foundation_backend.config or on the module that imported it, never on the app's re-export, which is a copy.
Upgrading: bump the pin with the npm package, run the migrations the changelog names for that release, then npm run verify:backend (docs/consuming.md).
template/backend/ depends on ui-foundation-backend unpinned. Install both editable in one pip call, so the dependency resolves to this folder and never to PyPI:
cd template/backend python -m venv .venv .venv/Scripts/python -m pip install -e ../../packages/backend-foundation -e ".[dev]" # .venv/bin/python elsewhere template/backend/scripts/dev.sh and the cloud session hook do this. Installing template/backend on its own would pull the published version (or fail before the first release), and its tests would run against code that isn't this commit's.
npm run verify:backend (repo root) runs this package's gate, scripts/verify.sh (mypy strict, then pytest over SQLite against tests/minimal_app.py, an app made of the package alone), then the template's. On its own: cd packages/backend-foundation && pytest.
.github/workflows/release.yml builds it (build-py, with the release's version written into pyproject.toml) and publishes it to PyPI by trusted publishing (publish-py), beside the npm package, before tagging. The committed version in pyproject.toml is a floor, like packages/ui-foundation/package.json's; keep the two the same.
Released: Nov 30, 2026
Both files in this release have provenance metadata.
View provenance details
MIT View SPDX License List
Release files for ui-foundation-backend 6.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 270.5 kB
Release files / ui_foundation_backend-6.1.1.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Security for ui-foundation-backend 6.1.1
Both files in this release have been uploaded with provenance metadata.
With provenance ui_foundation_backend-6.1.1.tar.gz Nov 30, 2026
Attestation for ui_foundation_backend-6.1.1.tar.gz
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Nov 30, 2026 2 release files Full provenance
Nov 29, 2026 2 release files Full provenance
Nov 28, 2026 2 release files Full provenance
Nov 27, 2026 2 release files Full provenance
Nov 25, 2026 2 release files Full provenance
Nov 23, 2026 2 release files Full provenance
Nov 22, 2026 2 release files Full provenance
Nov 21, 2026 2 release files Full provenance
Nov 20, 2026 2 release files Full provenance
Nov 19, 2026 2 release files Full provenance
Nov 18, 2026 2 release files Full provenance
Nov 17, 2026 2 release files Full provenance
Nov 16, 2026 2 release files Full provenance
Nov 15, 2026 2 release files Full provenance
Nov 14, 2026 2 release files Full provenance
Nov 13, 2026 2 release files Full provenance
Nov 12, 2026 2 release files Full provenance
Nov 11, 2026 2 release files Full provenance
Nov 9, 2026 2 release files Full provenance
Nov 8, 2026 2 release files Full provenance
Nov 7, 2026 2 release files Full provenance
Nov 6, 2026 2 release files Full provenance
Nov 5, 2026 2 release files Full provenance
Nov 4, 2026 2 release files Full provenance
Nov 1, 2026 2 release files Full provenance
Oct 31, 2026 2 release files Full provenance
Oct 30, 2026 2 release files Full provenance
Oct 29, 2026 2 release files Full provenance
Oct 28, 2026 2 release files Full provenance
Oct 26, 2026 2 release files Full provenance
Oct 25, 2026 2 release files Full provenance
Oct 23, 2026 2 release files Full provenance
Oct 22, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from a8e35ed











