Skip to content

Commit ceff293

Browse files
committed
Use firesore for persistent storage
1 parent 5cd37c2 commit ceff293

File tree

14 files changed

+82
-13
lines changed

14 files changed

+82
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Setting `debug=true` in URL query will show debug overlay.
1818

1919
Sometimes you may want to run parts of application on their own. You can do this like this:
2020

21-
- Run firebase emulators with `npx firebase emulators:start`.
21+
- Run firebase emulators with `npm run start:firebase`.
2222
- Run react dev server with `npm run start:client`.
23-
- Run game server with: `node -r esm src/server.js`.
23+
- Run game server with: `npm run start:server`.
2424
- Run storybook wiht: `npm run start:storybook`.
2525

2626
## Note
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "kind": "identitytoolkit#DownloadAccountResponse", "users": [] }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "signIn": { "allowDuplicateEmails": false } }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "9.5.0",
3+
"firestore": {
4+
"version": "1.11.12",
5+
"path": "firestore_export",
6+
"metadata_file": "firestore_export/firestore_export.overall_export_metadata"
7+
},
8+
"auth": {
9+
"version": "9.5.0",
10+
"path": "auth_export"
11+
}
12+
}
Binary file not shown.
Binary file not shown.

firebase.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@
99
"ui": {
1010
"enabled": true
1111
}
12+
},
13+
"firestore": {
14+
"rules": "firestore.rules",
15+
"indexes": "firestore.indexes.json"
1216
}
1317
}

firestore.indexes.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"indexes": [],
3+
"fieldOverrides": []
4+
}

firestore.rules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
rules_version = '2';
2+
service cloud.firestore {
3+
match /databases/{database}/documents {
4+
function isUpdateToOwnedField(attr, auth) {
5+
return (auth != null) && attr.diff(resource.data).affectedKeys().hasOnly([auth.uid]);
6+
}
7+
match /users/public_profiles {
8+
allow read;
9+
allow update: if isUpdateToOwnedField(request.resource.data, request.auth);
10+
}
11+
match /game_credentials/{userId} {
12+
allow read, write: if request.auth.uid == userId;
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)