Skip to main content

Production-oriented unified runtime for FastAPI + Streamlit

Project description

FluxLit (fluxlit)

Documentation Status PyPI version Python versions CI Release License

One port for FastAPI and Streamlit: a FluxLit app object, a Starlette gateway (Uvicorn), and Streamlit in a managed subprocess.

Docs: fluxlit.readthedocs.io · Security: SECURITY.md

Quick start Architecture · CLI · Configuration
Deployment · Observability · Rate limiting Auth recipes · Auth migration · Security · Troubleshooting
API reference Testing · Contributing · Changelog · Roadmap

Longer product context: PLAN.md.


Install

Python 3.10+.

pip install fluxlit

Optional JWT / OIDC / BFF helpers: pip install "fluxlit[auth]" — see Auth recipes.

Hack on FluxLit: git clone this repo, then pip install -e ".[dev]".


Quick start

fluxlit new my-app && cd my-app   # optional

app.py:

from fluxlit import FluxLit

app = FluxLit(title="Admin Portal")

@app.api.get("/users")
def users():
    return [{"name": "Ada"}]

@app.page("/")
def home(st, client):
    st.title("Dashboard")
    st.write(client.get("/users").json())
fluxlit dev    # default target app:app; or fluxlit dev your.module:app
  • UI: app root on the URL Uvicorn prints (default port 8000).
  • API: under /api (e.g. GET /api/users). OpenAPI: /api/docs.
  • Health / readiness: /api/healthz, /api/readyz (see Deployment).

In Streamlit, use paths like client.get("/users"), not "/api/users". Secured routes need a client with credentials — Auth recipes.

Routing: /api/* → FastAPI (prefix stripped inside the app); everything else → Streamlit (HTTP + WebSocket). Details: Architecture.


CLI (summary)

Command Role
fluxlit dev Dev server; optional --reload and --reload-scope (gateway or full)
fluxlit run Same stack, no reloader (typical in containers)
fluxlit doctor Import, bind, env sanity checks
fluxlit build Emit starter Dockerfile + .dockerignore
fluxlit new Minimal scaffold

Proxy / subpath: FLUXLIT_ROOT_PATH, FLUXLIT_TRUST_PROXY. Full flags and PID file: CLI.


Configuration

Precedence: CLI → environment (FLUXLIT_*, .env) → fluxlit.toml / [tool.fluxlit] → defaults.

# fluxlit.toml (optional)
target = "app:app"
gateway_host = "127.0.0.1"
gateway_port = 8000

Variable reference: Configuration.


Project layout (sketch)

my_app/
├── app.py
├── fluxlit.toml
├── .env              # not committed
└── pkg/pages/        # optional: discover_pages(...)

Contributors

pip install -e ".[dev]"
ruff check src tests && ruff format src tests
python -m pytest -n auto --ignore=tests/e2e -m "not slow"
python -m mypy src/fluxlit

Contributing · Testing


Status

Shipped: unified gateway, @app.page / discover_pages, fluxlit.toml, typed ApiClient, health/readiness probes, optional gateway access logs, dev reload scopes, fluxlit[auth], CI (incl. proxy smoke + Playwright e2e). Roadmap: Read the Docs.

MIT — see LICENSE.

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

fluxlit-0.4.0.tar.gz (91.5 kB view details)

Uploaded Source

Built Distribution

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

fluxlit-0.4.0-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fluxlit-0.4.0.tar.gz
  • Upload date:
  • Size: 91.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fluxlit-0.4.0.tar.gz
Algorithm Hash digest
SHA256 43d9c6d9227ff5233225ba1236733535585f3b326e5d7303060f3e3187287637
MD5 a55b1f14362d6fe1c64217fcbb54b2f7
BLAKE2b-256 388ed464136f8a006491dacc59221456b95b2feb7baba1a23d8bef82b1e4018d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fluxlit-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 51.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fluxlit-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6ca027bb9e0ba18d5e6afbd2cdefbd6bdfe31d5d6e3371d84d5812caf0c427e
MD5 eee92ae153a53c811d6e05e510ae9ad6
BLAKE2b-256 3d74e261937bc914f8d9c85269b085489a8b14074e8b1982472d03ab7d056567

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