Skip to content

BassMastaCod/FastPWA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ FastPWA

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.

🌟 What It Does

  • 🧾 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

πŸ“¦ Installation

pip install fastpwa

πŸ§ͺ Quickstart

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 route

πŸ“ Static Folder Layout

FastPWA auto-discovers and injects these assets if present:

static/
β”œβ”€β”€ index.html
β”œβ”€β”€ index.css
β”œβ”€β”€ index.js
β”œβ”€β”€ global.css
β”œβ”€β”€ global.js
└── favicon.png

🧬 Manifest Customization

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"
)

πŸ“œ License

MIT

About

Make your FastAPI app installable on mobile devices.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages