-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
680 additions
and
282 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
NEXT_PUBLIC_FIREBASE_API_KEY="" | ||
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="" | ||
NEXT_PUBLIC_FIREBASE_PROJECT_ID="" | ||
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="" | ||
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="" | ||
NEXT_PUBLIC_FIREBASE_APP_ID="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.next/ | ||
lib/firebase/config.js | ||
.next/ | ||
.firebase/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"emulators": { | ||
"auth": { | ||
"port": 9099 | ||
}, | ||
"functions": { | ||
"port": 5001 | ||
}, | ||
"firestore": { | ||
"port": 8080 | ||
}, | ||
"database": { | ||
"port": 9000 | ||
}, | ||
"storage": { | ||
"port": 9199 | ||
}, | ||
"ui": { | ||
"enabled": true | ||
}, | ||
"singleProjectMode": true, | ||
"hosting": { | ||
"port": 5000 | ||
} | ||
}, | ||
"functions": [ | ||
{ | ||
"source": "functions", | ||
"codebase": "default", | ||
"ignore": [ | ||
"node_modules", | ||
".git", | ||
"firebase-debug.log", | ||
"firebase-debug.*.log" | ||
] | ||
} | ||
], | ||
"firestore": { | ||
"rules": "firestore.rules", | ||
"indexes": "firestore.indexes.json" | ||
}, | ||
"hosting": { | ||
"source": ".", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
], | ||
"frameworksBackend": { | ||
"region": "us-central1" | ||
} | ||
}, | ||
"storage": { | ||
"rules": "storage.rules" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"indexes": [ | ||
{ | ||
"collectionGroup": "restaurants", | ||
"queryScope": "COLLECTION", | ||
"fields": [ | ||
{ | ||
"fieldPath": "category", | ||
"order": "ASCENDING" | ||
}, | ||
{ | ||
"fieldPath": "avgRating", | ||
"order": "DESCENDING" | ||
} | ||
] | ||
}, | ||
{ | ||
"collectionGroup": "restaurants", | ||
"queryScope": "COLLECTION", | ||
"fields": [ | ||
{ | ||
"fieldPath": "category", | ||
"order": "ASCENDING" | ||
}, | ||
{ | ||
"fieldPath": "numRatings", | ||
"order": "DESCENDING" | ||
} | ||
] | ||
}, | ||
{ | ||
"collectionGroup": "restaurants", | ||
"queryScope": "COLLECTION", | ||
"fields": [ | ||
{ | ||
"fieldPath": "category", | ||
"order": "ASCENDING" | ||
}, | ||
{ | ||
"fieldPath": "price", | ||
"order": "ASCENDING" | ||
} | ||
] | ||
}, | ||
{ | ||
"collectionGroup": "restaurants", | ||
"queryScope": "COLLECTION", | ||
"fields": [ | ||
{ | ||
"fieldPath": "city", | ||
"order": "ASCENDING" | ||
}, | ||
{ | ||
"fieldPath": "avgRating", | ||
"order": "DESCENDING" | ||
} | ||
] | ||
}, | ||
{ | ||
"collectionGroup": "restaurants", | ||
"queryScope": "COLLECTION", | ||
"fields": [ | ||
{ | ||
"fieldPath": "city", | ||
"order": "ASCENDING" | ||
}, | ||
{ | ||
"fieldPath": "numRatings", | ||
"order": "DESCENDING" | ||
} | ||
] | ||
}, | ||
{ | ||
"collectionGroup": "restaurants", | ||
"queryScope": "COLLECTION", | ||
"fields": [ | ||
{ | ||
"fieldPath": "city", | ||
"order": "ASCENDING" | ||
}, | ||
{ | ||
"fieldPath": "price", | ||
"order": "ASCENDING" | ||
} | ||
] | ||
}, | ||
{ | ||
"collectionGroup": "restaurants", | ||
"queryScope": "COLLECTION", | ||
"fields": [ | ||
{ | ||
"fieldPath": "price", | ||
"order": "ASCENDING" | ||
}, | ||
{ | ||
"fieldPath": "avgRating", | ||
"order": "DESCENDING" | ||
} | ||
] | ||
}, | ||
{ | ||
"collectionGroup": "restaurants", | ||
"queryScope": "COLLECTION", | ||
"fields": [ | ||
{ | ||
"fieldPath": "price", | ||
"order": "ASCENDING" | ||
}, | ||
{ | ||
"fieldPath": "numRatings", | ||
"order": "DESCENDING" | ||
} | ||
] | ||
} | ||
], | ||
"fieldOverrides": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
rules_version = '2'; | ||
service cloud.firestore { | ||
|
||
// Determine if the value of the field "key" is the same | ||
// before and after the request. | ||
function unchanged(key) { | ||
return (key in resource.data) | ||
&& (key in request.resource.data) | ||
&& (resource.data[key] == request.resource.data[key]); | ||
} | ||
|
||
match /databases/{database}/documents { | ||
// Restaurants: | ||
// - Authenticated user can read | ||
// - Authenticated user can create/update (for demo purposes only) | ||
// - Updates are allowed if no fields are added and name is unchanged | ||
// - Deletes are not allowed (default) | ||
match /restaurants/{restaurantId} { | ||
allow read; | ||
allow create: if request.auth != null; | ||
allow update: if request.auth != null | ||
&& unchanged("name"); | ||
|
||
// Ratings: | ||
// - Authenticated user can read | ||
// - Authenticated user can create if userId matches | ||
// - Deletes and updates are not allowed (default) | ||
match /ratings/{ratingId} { | ||
allow read; | ||
allow create: if request.auth != null; | ||
allow update: if request.auth != null | ||
&& request.resource.data.userId == request.auth.uid; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
Oops, something went wrong.