surp-hovhannes / bahk

App for Christians curious about how, when, and why to fast
MIT License
3 stars 1 forks source link

Feature/push notifications #89

Closed mattash closed 1 week ago

mattash commented 1 week ago

The main purpose of this PR is the introduction of push notification management. Testing is... tricky. I don't have a LAN that allows for testing local client with local backend. I tested against the deployed version at https://bahk-staging-b03c4b296be6.herokuapp.com. Expected behavior is that when the client logs in, if its on a device (iOS/android), a push token is registered on the backend. The token can be used for sending push messages to the client. A manual testing function is included in this PR, via API request or the backend admin, but the admin interface is not working yet. The API request test can be performed from:

curl -X POST http://URL/api/notifications/test-push/ \ -H "Content-Type: application/json" \ -d '{ "token": "ExponentPushToken[XXXXXX. X]", "message": "Hello! This is a test notification" }'

No logic is provided in this PR to send programmatic notifications to users about fasts. That will come in a separate PR.

Note: testing this also requires defining the APNS_CERTIFICATE_FILENAME in environment variables. The value can be sent to you via email, as it should be kept a secret.


This pull request includes significant updates to the bahk and hub applications, as well as the introduction of a new notifications app to handle push notifications. The most important changes include configuring AWS S3 settings, enhancing the database seeding process, and adding functionalities for managing and sending push notifications.

Configuration and Settings Updates:

Database Seeding Enhancements:

Push Notifications Implementation:

These changes enhance the project's configuration management, streamline the database seeding process, and introduce a robust system for handling push notifications.This pull request introduces a new push notifications feature to the project. It includes changes to settings, URLs, models, serializers, views, and utility functions to support the new functionality.

Settings and Configuration:

URL Routing:

Notifications App:

Testing:

andylitalo commented 1 week ago

Merged main