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.1.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.1-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fluxlit-0.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 646e024f9293c3669daaee85aa3df2cdee23c887e12bea0ec7962c1a734c84a2
MD5 fbe9c55122d632a0b021ff43748bab3d
BLAKE2b-256 88adebe15cb012c7e28a7a17d29c7c85dca98c0bbd789c59d5815edd9aea5894

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fluxlit-0.4.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e4ef136b127a736f32d846504a54f1fec3977a3e75ff73a41ff8d78806dfd6a
MD5 d6dcffecfa7dc20a39f399e91aaa2d83
BLAKE2b-256 be469e09274bd5793e3022be0215c66a0077a4879e7c1912ddbb0814c448fdd7

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