v2 backend: generate and serve case stats
rjhuijsman opened this issue · comments
Summary
Currently, the case stats being served by the v2 backend are...
- Static, out-of-date, not-localized stats, useful only as an example.
- Served by the old
v1
API (getCaseStats
) instead of using Firestore-based "API-less" access.
Desired Solution
We'd like to...
- Determine a good data layout in which to store case stats in Firestore Native.
- Periodically generate actual case stats (via scheduled Cloud Function)
- Modify the clients to read the case stats directly from Firestore, instead of going through the
v1
API.
Additional Context
There is existing AppEngine code to generate case stats in RefreshCaseStatsServlet.java
. We're looking to replace this code with our new Cloud Functions approach - its logic can likely be mostly maintained.
To allow for direct access from the client to Firestore, we will need to update our Firestore security rules in firestore.rules
. Please also update the unit tests in firestore_rules.spec.ts
to demonstrate which parts of the database should and should not be accessible directly to clients.
This item has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.