From 16a607d4d7f95e07d21743dfc6fbf33fd378d75b Mon Sep 17 00:00:00 2001 From: Arya Venkatesan Date: Sun, 26 Jul 2026 17:09:15 -0400 Subject: [PATCH 1/2] feat(backend): add events rules/indexes and messages timestamp overrides Backend counterpart to the calendar (#42) and chat search (#43) features, which merged without it. Without these, the catch-all deny at the end of firestore.rules blocks every /events read, and the calendar's date+startTime query has no composite index to run against. - events: signed-in read, writes stay server-side only - events index on (date ASC, startTime ASC) for the calendar query - messages.timestamp fieldOverrides incl. COLLECTION_GROUP DESCENDING, required by chat search's collection-group query - referrals index on (isDeleted ASC, dateSubmitted DESC) These rules are already deployed to Firebase; this commit brings the repo in line with the deployed state. Co-Authored-By: Claude --- backend/firestore.indexes.json | 54 +++++++++++++++++++++++++++++++++- backend/firestore.rules | 5 ++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/backend/firestore.indexes.json b/backend/firestore.indexes.json index b0ca055..52fbf03 100644 --- a/backend/firestore.indexes.json +++ b/backend/firestore.indexes.json @@ -189,7 +189,59 @@ "order": "DESCENDING" } ] + }, + { + "collectionGroup": "events", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "date", + "order": "ASCENDING" + }, + { + "fieldPath": "startTime", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "referrals", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "isDeleted", + "order": "ASCENDING" + }, + { + "fieldPath": "dateSubmitted", + "order": "DESCENDING" + } + ] } ], - "fieldOverrides": [] + "fieldOverrides": [ + { + "collectionGroup": "messages", + "fieldPath": "timestamp", + "ttl": false, + "indexes": [ + { + "order": "ASCENDING", + "queryScope": "COLLECTION" + }, + { + "order": "DESCENDING", + "queryScope": "COLLECTION" + }, + { + "arrayConfig": "CONTAINS", + "queryScope": "COLLECTION" + }, + { + "order": "DESCENDING", + "queryScope": "COLLECTION_GROUP" + } + ] + } + ] } diff --git a/backend/firestore.rules b/backend/firestore.rules index 5a73b82..4dd4fb8 100644 --- a/backend/firestore.rules +++ b/backend/firestore.rules @@ -121,6 +121,11 @@ service cloud.firestore { allow create, update, delete: if false; } + match /events/{eventId} { + allow read: if signedIn(); + allow create, update, delete: if false; + } + match /{document=**} { allow read, write: if false; } From 9137fd884f5117af42ec8e6bd518e94950479387 Mon Sep 17 00:00:00 2001 From: Arya Venkatesan Date: Sun, 26 Jul 2026 17:09:15 -0400 Subject: [PATCH 2/2] chore(web): gitignore Vite cache directory Co-Authored-By: Claude --- web/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/.gitignore b/web/.gitignore index 9b4c9d9..493f087 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -5,6 +5,9 @@ /.react-router/ /build/ +# Vite +/.vite/ + #environment files .env