FastPWA is a minimal FastAPI extension that makes your app installable as a Progressive Web App (PWA). It handles manifest generation, service worker registration, and automatic asset injectionβgiving you a native-like install prompt with almost no setup.
- π§Ύ Generates a compliant webmanifest from your app metadata
- βοΈ Registers a basic service worker for installability
- πΌοΈ Discovers and injects favicon and static assets (index.css, index.js, etc.)
- π§© Mounts static folders and serves your HTML entrypoint
pip install fastpwa
from fastpwa import PWA
app = PWA(title="My App", summary="Installable FastAPI app", prefix="app")
app.static_mount("static") # Mounts static assets and discovers favicon
app.register_pwa(html="static/index.html") # Registers manifest, SW, and index routeFastPWA auto-discovers and injects these assets if present:
static/
βββ index.html
βββ index.css
βββ index.js
βββ global.css
βββ global.js
βββ favicon.png
You can override manifest fields via register_pwa():
app.register_pwa(
html="static/index.html",
app_name="MyApp",
app_description="A simple installable app",
color="#3367D6",
background_color="#FFFFFF"
)MIT