Welcome to the FastAPI Web Push API repository! This project showcases a powerful API built using Python and the FastAPI framework, specifically designed to streamline web push notification integration. Stay connected with your users in real-time and deliver timely updates with ease.
Demo: Web Push Demo
- Seamless Python integration
- Leveraging the efficiency of the FastAPI framework
- Effortless web push notification implementation
- Auto-generated Swagger UI for interactive API documentation with OpenAPI 3 specification.
Get started with enhancing your user engagement today! Feel free to explore the codebase, contribute, and customize the API to suit your notification needs.
- Clone the repository
git clone https://github.com/m-abdi/web-push-python- Install dependencies
pip install -r requirements.txt- Run the API
uvicorn main:app --host 0.0.0.0 --port 8000-
Visit https://localhost:8000 to send notifications to client
-
There is a Swagger UI for interactive with api in http://localhost:8000/docs
-
For production use, replace the contents of “private_key.pem” and “public_key.pem”files with some other keys. You can use this service to generate random keys for you. Also, set the “SUBJECT” environment variable to something like “mailto: m.abdi.public@gmail.com”
-
Sending bulk messages is handled by BackgroundTasks from FastAPI, which is based on the BackgroundTask object in starlette. Although it works nicely, it is not fast enough for a lot of messages. Celery can be a good option for that.
Contributions, issues, and feature requests are welcome! Create a pull request to collaborate with us on advancing this project further.
This project is licensed under the MIT license.