FIRESTORE REFERENCE
This README contains vital information on setting up Firestore for a copy of your Ring project.
Indexesβ
Create a firestore.indexes.json
file with the following content:
{
"indexes": [
{
"collectionGroup": "opportunities",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "visibility", "order": "ASCENDING" },
{ "fieldPath": "deadline", "order": "ASCENDING" }
]
},
{
"collectionGroup": "opportunities",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "visibility", "order": "ASCENDING" },
{ "fieldPath": "type", "order": "ASCENDING" },
{ "fieldPath": "dateAdded", "order": "DESCENDING" }
]
},
{
"collectionGroup": "entities",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "visibility", "order": "ASCENDING" },
{ "fieldPath": "type", "order": "ASCENDING" },
{ "fieldPath": "name", "order": "ASCENDING" }
]
},
{
"collectionGroup": "userProfiles",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "name", "order": "ASCENDING" },
{ "fieldPath": "email", "order": "ASCENDING" }
]
}
],
"fieldOverrides": []
}
Data Structureβ
Ensure your Firestore collections follow these structures:
opportunities
: Contains documents representing opportunities.entities
: Contains documents representing entities (companies, organizations).userProfiles
: Contains documents representing user profiles.userSettings
: Contains documents representing user settings.contactForms
: Contains documents representing submitted contact forms.
Refer to the TypeScript interfaces in your project for detailed field information.
Local Developmentβ
- Install the Firebase CLI:
npm install -g firebase-tools
- Log in to Firebase:
firebase login
- Initialize your project:
firebase init firestore
- Use the Firebase Local Emulator Suite for testing:
firebase emulators:start
Deploymentβ
To deploy Firestore rules:
firebase deploy --only firestore:rules
To deploy Firestore indexes:
firebase deploy --only firestore:indexes
To deploy both rules and indexes:
firebase deploy --only firestore
Remember to update your Firebase configuration in your app's environment variables when switching between development and production environments.