README.org
43 lines · 886 bytes
1#+title: hutch-notify
2
3* what
4backend for push notifications in hutch.
5
6* does
7- register apns device tokens
8- store notification subscriptions
9- poll sr.ht for changes
10- send pushes via apns
11
12* stack
13python (fastapi), sqlite, apns (http/2, token auth).
14
15* status
16early development. current scope: device registration and a test
17push endpoint. planned: build, ticket, and inbox notifications.
18
19* run
20#+begin_src sh
21python3.12 -m venv .venv
22source .venv/bin/activate
23pip install -r requirements.txt
24uvicorn app.main:app --reload
25#+end_src
26
27* env
28create .env:
29
30#+begin_src conf
31API_KEY=change-me
32DATABASE_URL=sqlite+aiosqlite:///./hutch_notify.db
33APNS_KEY_ID=
34APNS_TEAM_ID=
35APNS_BUNDLE_ID=
36APNS_PRIVATE_KEY_PATH=
37SRHT_TOKEN=
38#+end_src
39
40* notes
41- the ios app registers with apns and sends its token here.
42- keep the apns .p8 key secure.
43- event-driven eventually; the first version polls.